diff options
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-i386.c | 66 |
1 files changed, 22 insertions, 44 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 0b7542f..3a2a1b7 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -6301,50 +6301,26 @@ process_suffix (void) Destination register type is more significant than source register type. crc32 in SSE4.2 prefers source register type. */ - if (i.tm.base_opcode == 0xf20f38f0 - && i.types[0].bitfield.class == Reg) - { - if (i.types[0].bitfield.byte) - i.suffix = BYTE_MNEM_SUFFIX; - else if (i.types[0].bitfield.word) - i.suffix = WORD_MNEM_SUFFIX; - else if (i.types[0].bitfield.dword) - i.suffix = LONG_MNEM_SUFFIX; - else if (i.types[0].bitfield.qword) - i.suffix = QWORD_MNEM_SUFFIX; - } - - if (!i.suffix) - { - int op; + unsigned int op = i.tm.base_opcode != 0xf20f38f0 ? i.operands : 1; - if (i.tm.base_opcode == 0xf20f38f0) - { - /* We have to know the operand size for crc32. */ - as_bad (_("ambiguous memory operand size for `%s`"), - i.tm.name); - return 0; - } - - for (op = i.operands; --op >= 0;) - if (i.tm.operand_types[op].bitfield.instance == InstanceNone - || i.tm.operand_types[op].bitfield.instance == Accum) - { - if (i.types[op].bitfield.class != Reg) - continue; - if (i.types[op].bitfield.byte) - i.suffix = BYTE_MNEM_SUFFIX; - else if (i.types[op].bitfield.word) - i.suffix = WORD_MNEM_SUFFIX; - else if (i.types[op].bitfield.dword) - i.suffix = LONG_MNEM_SUFFIX; - else if (i.types[op].bitfield.qword) - i.suffix = QWORD_MNEM_SUFFIX; - else - continue; - break; - } - } + while (op--) + if (i.tm.operand_types[op].bitfield.instance == InstanceNone + || i.tm.operand_types[op].bitfield.instance == Accum) + { + if (i.types[op].bitfield.class != Reg) + continue; + if (i.types[op].bitfield.byte) + i.suffix = BYTE_MNEM_SUFFIX; + else if (i.types[op].bitfield.word) + i.suffix = WORD_MNEM_SUFFIX; + else if (i.types[op].bitfield.dword) + i.suffix = LONG_MNEM_SUFFIX; + else if (i.types[op].bitfield.qword) + i.suffix = QWORD_MNEM_SUFFIX; + else + continue; + break; + } } else if (i.suffix == BYTE_MNEM_SUFFIX) { @@ -6484,8 +6460,10 @@ process_suffix (void) i.suffix = SHORT_MNEM_SUFFIX; else if (flag_code == CODE_16BIT) i.suffix = WORD_MNEM_SUFFIX; - else + else if (!i.tm.opcode_modifier.no_lsuf) i.suffix = LONG_MNEM_SUFFIX; + else + i.suffix = QWORD_MNEM_SUFFIX; } } |