diff options
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r-- | gas/config/tc-i386.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index e7bbdc2..7d37b9c 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2277,25 +2277,20 @@ md_assemble (line) if (!match_template ()) return; - if (intel_syntax) - { - /* Zap movzx and movsx suffix. The suffix may have been set from - "word ptr" or "byte ptr" on the source operand, but we'll use - the suffix later to choose the destination register. */ - if ((i.tm.base_opcode & ~9) == 0x0fb6) - { - if (i.reg_operands < 2 - && !i.suffix - && (!i.tm.opcode_modifier.no_bsuf - || !i.tm.opcode_modifier.no_wsuf - || !i.tm.opcode_modifier.no_lsuf - || !i.tm.opcode_modifier.no_ssuf - || !i.tm.opcode_modifier.no_ldsuf - || !i.tm.opcode_modifier.no_qsuf)) - as_bad (_("ambiguous operand size for `%s'"), i.tm.name); - - i.suffix = 0; - } + /* Zap movzx and movsx suffix. The suffix has been set from + "word ptr" or "byte ptr" on the source operand in Intel syntax + or extracted from mnemonic in AT&T syntax. But we'll use + the destination register to choose the suffix for encoding. */ + if ((i.tm.base_opcode & ~9) == 0x0fb6) + { + /* In Intel syntax, there must be a suffix. In AT&T syntax, if + there is no suffix, the default will be byte extension. */ + if (i.reg_operands != 2 + && !i.suffix + && intel_syntax) + as_bad (_("ambiguous operand size for `%s'"), i.tm.name); + + i.suffix = 0; } if (i.tm.opcode_modifier.fwait) |