diff options
author | Alan Modra <amodra@gmail.com> | 2000-02-24 12:40:45 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2000-02-24 12:40:45 +0000 |
commit | 7f3f1ea2a1563fdbdaac1c2dcc2d98cd53894ecc (patch) | |
tree | 3ad5ef13c0e72342f14db09f28d16976ff242c8e /gas/config/tc-i386.c | |
parent | a526d7137a05effebaea85faf639830531a6197e (diff) | |
download | gdb-7f3f1ea2a1563fdbdaac1c2dcc2d98cd53894ecc.zip gdb-7f3f1ea2a1563fdbdaac1c2dcc2d98cd53894ecc.tar.gz gdb-7f3f1ea2a1563fdbdaac1c2dcc2d98cd53894ecc.tar.bz2 |
Correct intel_syntax fsub* and fdiv* handling. Oh, how I'd like to be rid
of UNIXWARE_COMPAT.
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r-- | gas/config/tc-i386.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 7d8a0e7..d9e4b19 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1268,9 +1268,7 @@ md_assemble (line) /* All intel opcodes have reversed operands except for BOUND and ENTER */ if (intel_syntax && i.operands > 1 && (strcmp (mnemonic, "enter") != 0) - && (strcmp (mnemonic, "bound") != 0) - && (strncmp (mnemonic, "fsub", 4) !=0) - && (strncmp (mnemonic, "fdiv", 4) !=0)) + && (strcmp (mnemonic, "bound") != 0)) { union i386_op temp_op; unsigned int temp_type; @@ -1318,16 +1316,12 @@ md_assemble (line) if (i.operands != t->operands) continue; - /* For some opcodes, don't check the suffix */ - if (intel_syntax) - { - if (strcmp (t->name, "fnstcw") - && strcmp (t->name, "fldcw") - && (t->opcode_modifier & suffix_check)) - continue; - } - /* Must not have disallowed suffix. */ - else if ((t->opcode_modifier & suffix_check)) + /* Check the suffix, except for some instructions in intel mode. */ + if ((t->opcode_modifier & suffix_check) + && !(intel_syntax + && t->base_opcode == 0xd9 + && (t->extension_opcode == 5 /* 0xd9,5 "fldcw" */ + || t->extension_opcode == 7))) /* 0xd9,7 "f{n}stcw" */ continue; else if (!t->operands) @@ -1418,10 +1412,21 @@ md_assemble (line) i.tm = *t; if (found_reverse_match) { + /* If we found a reverse match we must alter the opcode + direction bit. found_reverse_match holds bits to change + (different for int & float insns). */ + + i.tm.base_opcode ^= found_reverse_match; + i.tm.operand_types[0] = t->operand_types[1]; i.tm.operand_types[1] = t->operand_types[0]; } + /* Undo UNIXWARE_COMPAT brokenness when in Intel mode. See i386.h */ + if (UNIXWARE_COMPAT + && intel_syntax + && (i.tm.base_opcode & 0xfffffde0) == 0xdce0) + i.tm.base_opcode ^= FloatR; if (i.tm.opcode_modifier & FWait) if (! add_prefix (FWAIT_OPCODE)) @@ -1738,12 +1743,6 @@ md_assemble (line) This is only for optimizing out unnecessary segment overrides. */ const seg_entry *default_seg = 0; - /* If we found a reverse match we must alter the opcode - direction bit. found_reverse_match holds bits to change - (different for int & float insns). */ - - i.tm.base_opcode ^= found_reverse_match; - /* The imul $imm, %reg instruction is converted into imul $imm, %reg, %reg, and the clr %reg instruction is converted into xor %reg, %reg. */ |