diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2009-07-17 17:54:51 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2009-07-17 17:54:51 +0000 |
commit | bc0844aee76db3dd663d7776e257a0fd15330d0e (patch) | |
tree | b27761d6d88d4034bde17234806986c4bbbf39b4 | |
parent | 9afe6eb82f6abc63f7235771b803497ebb6455f2 (diff) | |
download | fsf-binutils-gdb-bc0844aee76db3dd663d7776e257a0fd15330d0e.zip fsf-binutils-gdb-bc0844aee76db3dd663d7776e257a0fd15330d0e.tar.gz fsf-binutils-gdb-bc0844aee76db3dd663d7776e257a0fd15330d0e.tar.bz2 |
2009-07-17 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (md_assemble): Update operand types.
(update_imm): Updated.
(finalize_imm): Update the first 2 immediate operands only
for instructions with 2 operands or more.
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 25 |
2 files changed, 23 insertions, 9 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index dba01f6..1f4f666 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,12 @@ 2009-07-17 H.J. Lu <hongjiu.lu@intel.com> + * config/tc-i386.c (md_assemble): Update operand types. + (update_imm): Updated. + (finalize_imm): Update the first 2 immediate operands only + for instructions with 2 operands or more. + +2009-07-17 H.J. Lu <hongjiu.lu@intel.com> + * config/tc-i386.c (md_assemble): Check implicit registers only for instructions with 3 operands or less. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 0862ab0..d00424a 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2813,6 +2813,10 @@ md_assemble (char *line) if (!process_suffix ()) return; + /* Update operand types. */ + for (j = 0; j < i.operands; j++) + i.types[j] = operand_type_and (i.types[j], i.tm.operand_types[j]); + /* Make still unresolved immediate matches conform to size of immediate given in i.suffix. */ if (!finalize_imm ()) @@ -4434,9 +4438,7 @@ check_word_reg (void) static int update_imm (unsigned int j) { - i386_operand_type overlap; - - overlap = operand_type_and (i.types[j], i.tm.operand_types[j]); + i386_operand_type overlap = i.types[j]; if ((overlap.bitfield.imm8 || overlap.bitfield.imm8s || overlap.bitfield.imm16 @@ -4500,14 +4502,19 @@ update_imm (unsigned int j) static int finalize_imm (void) { - unsigned int j; + unsigned int j, n; - for (j = 0; j < 2; j++) - if (update_imm (j) == 0) - return 0; + /* Update the first 2 immediate operands. */ + n = i.operands > 2 ? 2 : i.operands; + if (n) + { + for (j = 0; j < n; j++) + if (update_imm (j) == 0) + return 0; - i.types[2] = operand_type_and (i.types[2], i.tm.operand_types[2]); - gas_assert (operand_type_check (i.types[2], imm) == 0); + /* The 3rd operand can't be immediate operand. */ + gas_assert (operand_type_check (i.types[2], imm) == 0); + } return 1; } |