diff options
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r-- | gas/config/tc-i386.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index e36afa8024d..1c9388b1bdc 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -10359,6 +10359,21 @@ i386_addressing_mode (void) if (i.prefix[ADDR_PREFIX]) addr_mode = flag_code == CODE_32BIT ? CODE_16BIT : CODE_32BIT; + else if (flag_code == CODE_16BIT + && current_templates->start->cpu_flags.bitfield.cpumpx + /* Avoid replacing the "16-bit addressing not allowed" diagnostic + from md_assemble() by "is not a valid base/index expression" + when there is a base and/or index. */ + && !i.types[this_operand].bitfield.baseindex) + { + /* MPX insn memory operands with neither base nor index must be forced + to use 32-bit addressing in 16-bit mode. */ + addr_mode = CODE_32BIT; + i.prefix[ADDR_PREFIX] = ADDR_PREFIX_OPCODE; + ++i.prefixes; + gas_assert (!i.types[this_operand].bitfield.disp16); + gas_assert (!i.types[this_operand].bitfield.disp32); + } else { addr_mode = flag_code; |