aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-i386.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-11-24 09:55:29 +0100
committerJan Beulich <jbeulich@suse.com>2023-11-24 09:55:29 +0100
commit39bb3ade816faf42ec34cc7ca962ad350cb4d16a (patch)
tree20ebf46bd6a4f68bb3d7c6e8fcd3c4ae26f889c2 /gas/config/tc-i386.c
parenteb5e952f95423bc6ae18457ccc359c8b6c0fa387 (diff)
downloadgdb-39bb3ade816faf42ec34cc7ca962ad350cb4d16a.zip
gdb-39bb3ade816faf42ec34cc7ca962ad350cb4d16a.tar.gz
gdb-39bb3ade816faf42ec34cc7ca962ad350cb4d16a.tar.bz2
x86: also prefer VEX encoding over EVEX one for VCVTNEPS2BF16 when possible
Deal with what 58bceb182740 ("x86: prefer VEX encodings over EVEX ones when possible") left out, for being slightly less straightforward.
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r--gas/config/tc-i386.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 2651cd2..71e0c4d 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -7475,20 +7475,27 @@ match_template (char mnem_suffix)
}
/* Check whether to use the shorter VEX encoding for certain insns where
- the EVEX enconding comes first in the table. This requires the respective
- AVX-* feature to be explicitly enabled. */
- if (t == current_templates->start
+ the EVEX encoding comes first in the table. This requires the respective
+ AVX-* feature to be explicitly enabled.
+
+ Most of the respective insns have just a single EVEX and a single VEX
+ template. The one that's presently different is generated using the
+ Vxy / Exy constructs: There are 3 suffix-less EVEX forms, the latter
+ two of which may fall back to their two corresponding VEX forms. */
+ j = t->mnem_off != MN_vcvtneps2bf16 ? 1 : 2;
+ if ((t == current_templates->start || j > 1)
&& t->opcode_modifier.disp8memshift
&& !t->opcode_modifier.vex
&& !need_evex_encoding ()
- && t + 1 < current_templates->end
- && t[1].opcode_modifier.vex)
+ && t + j < current_templates->end
+ && t[j].opcode_modifier.vex)
{
i386_cpu_flags cpu;
unsigned int memshift = i.memshift;
i.memshift = 0;
- cpu = cpu_flags_and (cpu_flags_from_attr (t[1].cpu), cpu_arch_isa_flags);
+ cpu = cpu_flags_and (cpu_flags_from_attr (t[j].cpu),
+ cpu_arch_isa_flags);
if (!cpu_flags_all_zero (&cpu)
&& (!i.types[0].bitfield.disp8
|| !operand_type_check (i.types[0], disp)
@@ -7496,6 +7503,7 @@ match_template (char mnem_suffix)
|| fits_in_disp8 (i.op[0].disps->X_add_number)))
{
specific_error = progress (internal_error);
+ t += j - 1;
continue;
}
i.memshift = memshift;