diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2007-07-29 18:27:59 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2007-07-29 18:27:59 +0000 |
commit | 34828aad95ed9b64ca22d25b190f3fee0b08f808 (patch) | |
tree | 7d2a31518c95d42adb5f094853af8eed7f43bece /gas/config | |
parent | 48f2ff543db37fece56b0a507427917e06dc1b66 (diff) | |
download | gdb-34828aad95ed9b64ca22d25b190f3fee0b08f808.zip gdb-34828aad95ed9b64ca22d25b190f3fee0b08f808.tar.gz gdb-34828aad95ed9b64ca22d25b190f3fee0b08f808.tar.bz2 |
gas/
2007-07-29 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (check_long_reg): Allow cvtss2si to convert
DWORD memory to Reg64 in Intel synax.
(check_qword_reg): Allow cvtsd2si to convert QWORD memory to
Reg32 in Intel syntax.
gas/testsuite/
2007-07-29 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/simd.s: Add tests for cvtss2si/cvtsd2si in Intel
mode.
* gas/i386/x86-64-simd.s: Likewise.
* gas/i386/simd-intel.d: Updated.
* gas/i386/simd.d: Likewise.
* gas/i386/x86-64-simd-intel.d: Likewise.
* gas/i386/x86-64-simd.d: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-i386.c | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 3d935c1..8b5a97d 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -3164,10 +3164,21 @@ check_long_reg (void) else if ((i.types[op] & Reg64) != 0 && (i.tm.operand_types[op] & (Reg32 | Acc)) != 0) { - as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), - register_prefix, i.op[op].regs->reg_name, - i.suffix); - return 0; + if (intel_syntax + && i.tm.base_opcode == 0xf30f2d + && (i.types[0] & RegXMM) == 0) + { + /* cvtss2si converts DWORD memory to Reg64. We want + REX byte. */ + i.suffix = QWORD_MNEM_SUFFIX; + } + else + { + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, + i.suffix); + return 0; + } } return 1; } @@ -3191,16 +3202,26 @@ check_qword_reg (void) return 0; } /* Warn if the e prefix on a general reg is missing. */ - else if (((i.types[op] & Reg16) != 0 - || (i.types[op] & Reg32) != 0) + else if ((i.types[op] & (Reg16 | Reg32)) != 0 && (i.tm.operand_types[op] & (Reg32 | Acc)) != 0) { /* Prohibit these changes in the 64bit mode, since the lowering is more complicated. */ - as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), - register_prefix, i.op[op].regs->reg_name, - i.suffix); - return 0; + if (intel_syntax + && i.tm.base_opcode == 0xf20f2d + && (i.types[0] & RegXMM) == 0) + { + /* cvtsd2si converts QWORD memory to Reg32. We don't want + REX byte. */ + i.suffix = LONG_MNEM_SUFFIX; + } + else + { + as_bad (_("Incorrect register `%s%s' used with `%c' suffix"), + register_prefix, i.op[op].regs->reg_name, + i.suffix); + return 0; + } } return 1; } |