From 873e7b6cf61b5e3fca8ab55ea1b8574dd00a3caf Mon Sep 17 00:00:00 2001 From: Haochen Jiang Date: Thu, 30 Jul 2020 11:01:01 +0800 Subject: Support Intel AVX10.2 media instructions In disassembler part, for vnni instructions, we extended previous VEX part using %XE in disassembler to promote them to EVEX by reusing the original VEX table. For vmpsadbw, we will also use %XE. However, it is hard to reuse the VEX table, so we are using new ones. In assmbler part, we put the vnni table entries with previous vnni instructions since they are just promotion from AVX-VNNI-INT{8,16}. Since we will prefer VEX encoding, we need to use the different table order in template , which prefers EVEX due to earlier introduction for AVX512_VNNI than AVX_VNNI. This means a new . For vdpphps and vmpsadbw, we put them at the end of the table, with future AVX10.2 instructions. Nit: I will remove the arch requirement for avx_vnni_int{8,16} in evex-promote testcases after AVX10.2 implies AVX-VNNI-INT{8,16}. gas/Changelog: * testsuite/gas/i386/i386.exp: Add AVX10.2 tests. * testsuite/gas/i386/x86-64.exp: Ditto. * testsuite/gas/i386/avx10_2-256-1-intel.d: New. * testsuite/gas/i386/avx10_2-256-1.d: Ditto. * testsuite/gas/i386/avx10_2-256-1.s: Ditto. * testsuite/gas/i386/avx10_2-512-1-intel.d: Ditto. * testsuite/gas/i386/avx10_2-512-1.d: Ditto. * testsuite/gas/i386/avx10_2-512-1.s: Ditto. * testsuite/gas/i386/avx10_2-promote.d: Ditto. * testsuite/gas/i386/avx10_2-promote.s: Ditto. * testsuite/gas/i386/x86-64-avx10_2-256-1-intel.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-256-1.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-256-1.s: Ditto. * testsuite/gas/i386/x86-64-avx10_2-512-1-intel.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-512-1.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-512-1.s: Ditto. * testsuite/gas/i386/x86-64-avx10_2-promote.d: Ditto. * testsuite/gas/i386/x86-64-avx10_2-promote.s: Ditto. opcodes/Changelog: * i386-dis-evex-prefix.h: Adjust PREFIX_EVEX_0F3852. Add PREFIX_EVEX_0F3A42_W_0. * i386-dis-evex-w.h: Adjust EVEX_W_0F3A42. * i386-dis-evex.h: Add table pass for AVX10.2 instructions. * i386-dis.c: Adjust PREFIX_VEX_0F3850_W_0, PREFIX_VEX_0F3851_W_0, PREFIX_VEX_0F38D2_W_0 and PREFIX_VEX_0F38D3_W_0. * i386-opc.tbl: Add AVX10.2 instructions. * i386-mnem.h: Regenerated. * i386-tbl.h: Ditto. Co-authored-by: Lili Cui --- opcodes/i386-dis.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'opcodes/i386-dis.c') diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index e2c7b1b..3a4af4d 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -1199,6 +1199,7 @@ enum PREFIX_EVEX_0F3A0A, PREFIX_EVEX_0F3A26, PREFIX_EVEX_0F3A27, + PREFIX_EVEX_0F3A42_W_0, PREFIX_EVEX_0F3A56, PREFIX_EVEX_0F3A57, PREFIX_EVEX_0F3A66, @@ -3987,18 +3988,18 @@ static const struct dis386 prefix_table[][4] = { /* PREFIX_VEX_0F3850_W_0 */ { - { "vpdpbuud", { XM, Vex, EXx }, 0 }, - { "vpdpbsud", { XM, Vex, EXx }, 0 }, + { "%XEvpdpbuud", { XM, Vex, EXx }, 0 }, + { "%XEvpdpbsud", { XM, Vex, EXx }, 0 }, { "%XVvpdpbusd", { XM, Vex, EXx }, 0 }, - { "vpdpbssd", { XM, Vex, EXx }, 0 }, + { "%XEvpdpbssd", { XM, Vex, EXx }, 0 }, }, /* PREFIX_VEX_0F3851_W_0 */ { - { "vpdpbuuds", { XM, Vex, EXx }, 0 }, - { "vpdpbsuds", { XM, Vex, EXx }, 0 }, + { "%XEvpdpbuuds", { XM, Vex, EXx }, 0 }, + { "%XEvpdpbsuds", { XM, Vex, EXx }, 0 }, { "%XVvpdpbusds", { XM, Vex, EXx }, 0 }, - { "vpdpbssds", { XM, Vex, EXx }, 0 }, + { "%XEvpdpbssds", { XM, Vex, EXx }, 0 }, }, /* PREFIX_VEX_0F385C_X86_64_L_0_W_0 */ { @@ -4046,16 +4047,16 @@ static const struct dis386 prefix_table[][4] = { /* PREFIX_VEX_0F38D2_W_0 */ { - { "vpdpwuud", { XM, Vex, EXx }, 0 }, - { "vpdpwsud", { XM, Vex, EXx }, 0 }, - { "vpdpwusd", { XM, Vex, EXx }, 0 }, + { "%XEvpdpwuud", { XM, Vex, EXx }, 0 }, + { "%XEvpdpwsud", { XM, Vex, EXx }, 0 }, + { "%XEvpdpwusd", { XM, Vex, EXx }, 0 }, }, /* PREFIX_VEX_0F38D3_W_0 */ { - { "vpdpwuuds", { XM, Vex, EXx }, 0 }, - { "vpdpwsuds", { XM, Vex, EXx }, 0 }, - { "vpdpwusds", { XM, Vex, EXx }, 0 }, + { "%XEvpdpwuuds", { XM, Vex, EXx }, 0 }, + { "%XEvpdpwsuds", { XM, Vex, EXx }, 0 }, + { "%XEvpdpwusds", { XM, Vex, EXx }, 0 }, }, /* PREFIX_VEX_0F38CB */ -- cgit v1.1