diff options
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r-- | gas/config/tc-i386.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 1b1b0a9..959fda2 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -3975,10 +3975,13 @@ optimize_encoding (void) && !i.rounding && is_evex_encoding (&i.tm) && (i.vec_encoding != vex_encoding_evex + || cpu_arch_flags.bitfield.cpuavx + || cpu_arch_isa_flags.bitfield.cpuavx + || cpu_arch_flags.bitfield.cpuavx512vl + || cpu_arch_isa_flags.bitfield.cpuavx512vl || i.tm.cpu_flags.bitfield.cpuavx512vl || (i.tm.operand_types[2].bitfield.zmmword - && i.types[2].bitfield.ymmword) - || cpu_arch_isa_flags.bitfield.cpuavx512vl))) + && i.types[2].bitfield.ymmword)))) && ((i.tm.base_opcode == 0x55 || i.tm.base_opcode == 0x6655 || i.tm.base_opcode == 0x66df @@ -4032,14 +4035,19 @@ optimize_encoding (void) */ if (is_evex_encoding (&i.tm)) { - if (i.vec_encoding == vex_encoding_evex) - i.tm.opcode_modifier.evex = EVEX128; - else + if (i.vec_encoding != vex_encoding_evex + && (cpu_arch_flags.bitfield.cpuavx + || cpu_arch_isa_flags.bitfield.cpuavx)) { i.tm.opcode_modifier.vex = VEX128; i.tm.opcode_modifier.vexw = VEXW0; i.tm.opcode_modifier.evex = 0; } + else if (cpu_arch_flags.bitfield.cpuavx512vl + || cpu_arch_isa_flags.bitfield.cpuavx512vl) + i.tm.opcode_modifier.evex = EVEX128; + else + return; } else if (i.tm.operand_types[0].bitfield.regmask) { |