diff options
author | Jan Beulich <jbeulich@novell.com> | 2005-07-26 15:34:11 +0000 |
---|---|---|
committer | Jan Beulich <jbeulich@novell.com> | 2005-07-26 15:34:11 +0000 |
commit | 9cd969923762b28e8bbe82fff7b995e72fe3e5f9 (patch) | |
tree | 94b4e091b0bc0b6368bdaa8dd4b357d81f109303 /gas/config/tc-i386.c | |
parent | f41d945baeff0467b6f35aba7a3d54ec916f90af (diff) | |
download | gdb-9cd969923762b28e8bbe82fff7b995e72fe3e5f9.zip gdb-9cd969923762b28e8bbe82fff7b995e72fe3e5f9.tar.gz gdb-9cd969923762b28e8bbe82fff7b995e72fe3e5f9.tar.bz2 |
gas/
2005-07-26 Jan Beulich <jbeulich@novell.com>
* config/tc-i386.c (optimize_imm): Calculate candidate immediates
mask from guessed suffix, but mask out other immediate types only
if at least on candidate is valid for the insn.
gas/testsuite/
2005-07-26 Jan Beulich <jbeulich@novell.com>
* gas/i386/immed32.[sd]: New.
* gas/i386/immed64.[sd]: New.
* gas/i386/i386.exp: Run new tests.
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r-- | gas/config/tc-i386.c | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index df3a35b..139e403 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2087,22 +2087,36 @@ optimize_imm () /* Symbols and expressions. */ default: - /* Convert symbolic operand to proper sizes for matching. */ - switch (guess_suffix) - { - case QWORD_MNEM_SUFFIX: - i.types[op] &= Imm64 | Imm32S; - break; - case LONG_MNEM_SUFFIX: - i.types[op] &= Imm32; - break; - case WORD_MNEM_SUFFIX: - i.types[op] &= Imm16; - break; - case BYTE_MNEM_SUFFIX: - i.types[op] &= Imm8 | Imm8S; - break; - } + /* Convert symbolic operand to proper sizes for matching, but don't + prevent matching a set of insns that only supports sizes other + than those matching the insn suffix. */ + { + unsigned int mask, allowed = 0; + const template *t; + + for (t = current_templates->start; t < current_templates->end; ++t) + allowed |= t->operand_types[op]; + switch (guess_suffix) + { + case QWORD_MNEM_SUFFIX: + mask = Imm64 | Imm32S; + break; + case LONG_MNEM_SUFFIX: + mask = Imm32; + break; + case WORD_MNEM_SUFFIX: + mask = Imm16; + break; + case BYTE_MNEM_SUFFIX: + mask = Imm8; + break; + default: + mask = 0; + break; + } + if (mask & allowed) + i.types[op] &= mask; + } break; } } |