Support Intel AMX-COMPLEX

gas/ChangeLog:

	* NEWS: Support Intel AMX-COMPLEX.
	* config/tc-i386.c: Add amx_complex.
	* doc/c-i386.texi: Document .amx_complex.
	* testsuite/gas/i386/i386.exp: Run AMX-COMPLEX tests.
	* testsuite/gas/i386/amx-complex-inval.l: New test.
	* testsuite/gas/i386/amx-complex-inval.s: Ditto.
	* testsuite/gas/i386/x86-64-amx-complex-bad.d: Ditto.
	* testsuite/gas/i386/x86-64-amx-complex-bad.s: Ditto.
	* testsuite/gas/i386/x86-64-amx-complex-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-amx-complex.d: Ditto.
	* testsuite/gas/i386/x86-64-amx-complex.s: Ditto.

opcodes/ChangeLog:

	* i386-dis.c (MOD_VEX_0F386C_X86_64_W_0): New.
	(PREFIX_VEX_0F386C_X86_64_W_0_M_1_L_0): Ditto.
	(X86_64_VEX_0F386C): Ditto.
	(VEX_LEN_0F386C_X86_64_W_0_M_1): Ditto.
	(VEX_W_0F386C_X86_64): Ditto.
	(mod_table): Add MOD_VEX_0F386C_X86_64_W_0.
	(prefix_table): Add PREFIX_VEX_0F386C_X86_64_W_0_M_1_L_0.
	(x86_64_table): Add X86_64_VEX_0F386C.
	(vex_len_table): Add VEX_LEN_0F386C_X86_64_W_0_M_1.
	(vex_w_table): Add VEX_W_0F386C_X86_64.
	* i386-gen.c (cpu_flag_init): Add CPU_AMX_COMPLEX_FLAGS and
	CPU_ANY_AMX_COMPLEX_FLAGS.
	* i386-init.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-opc.h (CpuAMX_COMPLEX): New.
	(i386_cpu_flags): Add cpuamx_complex.
	* i386-opc.tbl: Add AMX-COMPLEX instructions.
	* i386-tbl.h: Regenerated.
This commit is contained in:
Haochen Jiang
2023-04-07 10:02:09 +08:00
committed by LiliCui
parent 9340f36109
commit d100d8c1f3
18 changed files with 4912 additions and 4712 deletions
+2
View File
@@ -1,5 +1,7 @@
-*- text -*-
* Add support for Intel AMX-COMPLEX instructions.
* Add SME2 support to the AArch64 port.
* A new .insn directive is recognized by x86 gas.
+1
View File
@@ -1113,6 +1113,7 @@ static const arch_entry cpu_arch[] =
SUBARCH (amx_int8, AMX_INT8, ANY_AMX_INT8, false),
SUBARCH (amx_bf16, AMX_BF16, ANY_AMX_BF16, false),
SUBARCH (amx_fp16, AMX_FP16, ANY_AMX_FP16, false),
SUBARCH (amx_complex, AMX_COMPLEX, ANY_AMX_COMPLEX, false),
SUBARCH (amx_tile, AMX_TILE, ANY_AMX_TILE, false),
SUBARCH (movdiri, MOVDIRI, MOVDIRI, false),
SUBARCH (movdir64b, MOVDIR64B, MOVDIR64B, false),
+3 -1
View File
@@ -208,6 +208,7 @@ accept various extension mnemonics. For example,
@code{amx_int8},
@code{amx_bf16},
@code{amx_fp16},
@code{amx_complex},
@code{amx_tile},
@code{vmx},
@code{vmfunc},
@@ -1636,7 +1637,8 @@ supported on the CPU specified. The choices for @var{cpu_type} are:
@item @samp{.wbnoinvd} @tab @samp{.pconfig} @tab @samp{.waitpkg} @tab @samp{.cldemote}
@item @samp{.shstk} @tab @samp{.gfni} @tab @samp{.vaes} @tab @samp{.vpclmulqdq}
@item @samp{.movdiri} @tab @samp{.movdir64b} @tab @samp{.enqcmd} @tab @samp{.tsxldtrk}
@item @samp{.amx_int8} @tab @samp{.amx_bf16} @tab @samp{.amx_fp16} @tab @samp{.amx_tile}
@item @samp{.amx_int8} @tab @samp{.amx_bf16} @tab @samp{.amx_fp16}
@item @samp{.amx_complex} @tab @samp{.amx_tile}
@item @samp{.kl} @tab @samp{.widekl} @tab @samp{.uintr} @tab @samp{.hreset}
@item @samp{.3dnow} @tab @samp{.3dnowa} @tab @samp{.sse4a} @tab @samp{.sse5}
@item @samp{.syscall} @tab @samp{.rdtscp} @tab @samp{.svme}
@@ -0,0 +1,3 @@
.* Assembler messages:
.*:6: Error: `tcmmimfp16ps' is only supported in 64-bit mode
.*:7: Error: `tcmmrlfp16ps' is only supported in 64-bit mode
@@ -0,0 +1,7 @@
# Check Illegal AMX-COMPLEX instructions
.allow_index_reg
.text
_start:
tcmmimfp16ps %tmm1, %tmm2, %tmm3
tcmmrlfp16ps %tmm1, %tmm2, %tmm3
+4
View File
@@ -493,6 +493,7 @@ if [gas_32_check] then {
run_dump_test "avx-ne-convert-intel"
run_dump_test "raoint"
run_dump_test "raoint-intel"
run_list_test "amx-complex-inval"
run_list_test "sg"
run_dump_test "clzero"
run_dump_test "invlpgb"
@@ -1183,6 +1184,9 @@ if [gas_64_check] then {
run_dump_test "x86-64-avx-ne-convert-intel"
run_dump_test "x86-64-raoint"
run_dump_test "x86-64-raoint-intel"
run_dump_test "x86-64-amx-complex"
run_dump_test "x86-64-amx-complex-intel"
run_dump_test "x86-64-amx-complex-bad"
run_dump_test "x86-64-clzero"
run_dump_test "x86-64-mwaitx-bdver4"
run_list_test "x86-64-mwaitx-reg"
@@ -0,0 +1,19 @@
#as:
#objdump: -drw
#name: x86_64 Illegal AMX-COMPLEX insns
#source: x86-64-amx-complex-bad.s
.*: +file format .*
Disassembly of section \.text:
0+ <\.text>:
[ ]*[a-f0-9]+:[ ]*c4 e2 d9 6c[ ]*\(bad\)[ ]*
[ ]*[a-f0-9]+:[ ]*f5[ ]*cmc.*
[ ]*[a-f0-9]+:[ ]*c4 e2 5d 6c[ ]*\(bad\)[ ]*
[ ]*[a-f0-9]+:[ ]*f5[ ]*cmc.*
[ ]*[a-f0-9]+:[ ]*c4 62 59 6c f5[ ]*tcmmimfp16ps %tmm4,%tmm5,\(bad\)
[ ]*[a-f0-9]+:[ ]*c4 c2 59 6c f5[ ]*tcmmimfp16ps %tmm4,\(bad\),%tmm6
[ ]*[a-f0-9]+:[ ]*c4 e2 31 6c f5[ ]*tcmmimfp16ps \(bad\),%tmm5,%tmm6
#pass
@@ -0,0 +1,17 @@
# Check Illegal 64bit AMX-COMPLEX instructions
.text
#tcmmimfp16ps %tmm4,%tmm5,%tmm6 set VEX.W = 1 (illegal value).
.insn VEX.128.66.0F38.W1 0x6c, %tmm5, %tmm4, %tmm6
#tcmmimfp16ps %tmm4,%tmm4,%tmm6 set VEX.L = 1 (illegal value).
.insn VEX.256.66.0F38.W0 0x6c, %tmm5, %tmm4, %tmm6
#tcmmimfp16ps %tmm4,%tmm5,%tmm6 set VEX.R = 0 (illegal value).
.insn VEX.128.66.0F38.W0 0x6c, %xmm5, %xmm4, %xmm14
#tcmmimfp16ps %tmm4,%tmm5,%tmm6 set VEX.B = 0 (illegal value).
.insn VEX.128.66.0F38.W0 0x6c, %xmm13, %xmm4, %xmm6
#tcmmimfp16ps %tmm4,%tmm5,%tmm6 set VEX.VVVV = 0110 (illegal value).
.insn VEX.128.66.0F38.W0 0x6c, %xmm5, %xmm9, %xmm6
@@ -0,0 +1,18 @@
#as:
#objdump: -dw -Mintel
#name: x86_64 AMX-COMPLEX insns (Intel disassembly)
#source: x86-64-amx-complex.s
.*: +file format .*
Disassembly of section \.text:
0+ <_start>:
\s*[a-f0-9]+:\s*c4 e2 59 6c f5\s+tcmmimfp16ps tmm6,tmm5,tmm4
\s*[a-f0-9]+:\s*c4 e2 71 6c da\s+tcmmimfp16ps tmm3,tmm2,tmm1
\s*[a-f0-9]+:\s*c4 e2 58 6c f5\s+tcmmrlfp16ps tmm6,tmm5,tmm4
\s*[a-f0-9]+:\s*c4 e2 70 6c da\s+tcmmrlfp16ps tmm3,tmm2,tmm1
\s*[a-f0-9]+:\s*c4 e2 59 6c f5\s+tcmmimfp16ps tmm6,tmm5,tmm4
\s*[a-f0-9]+:\s*c4 e2 71 6c da\s+tcmmimfp16ps tmm3,tmm2,tmm1
\s*[a-f0-9]+:\s*c4 e2 58 6c f5\s+tcmmrlfp16ps tmm6,tmm5,tmm4
\s*[a-f0-9]+:\s*c4 e2 70 6c da\s+tcmmrlfp16ps tmm3,tmm2,tmm1
@@ -0,0 +1,15 @@
#as:
#objdump: -dw
#name: x86_64 AMX-COMPLEX insns
#source: x86-64-amx-complex.s
.*: +file format .*
Disassembly of section \.text:
0+ <_start>:
\s*[a-f0-9]+:\s*c4 e2 59 6c f5\s+tcmmimfp16ps %tmm4,%tmm5,%tmm6
\s*[a-f0-9]+:\s*c4 e2 71 6c da\s+tcmmimfp16ps %tmm1,%tmm2,%tmm3
\s*[a-f0-9]+:\s*c4 e2 58 6c f5\s+tcmmrlfp16ps %tmm4,%tmm5,%tmm6
\s*[a-f0-9]+:\s*c4 e2 70 6c da\s+tcmmrlfp16ps %tmm1,%tmm2,%tmm3
#pass
@@ -0,0 +1,15 @@
# Check 64bit AMX-COMPLEX instructions
.allow_index_reg
.text
_start:
tcmmimfp16ps %tmm4, %tmm5, %tmm6 #AMX-COMPLEX
tcmmimfp16ps %tmm1, %tmm2, %tmm3 #AMX-COMPLEX
tcmmrlfp16ps %tmm4, %tmm5, %tmm6 #AMX-COMPLEX
tcmmrlfp16ps %tmm1, %tmm2, %tmm3 #AMX-COMPLEX
.intel_syntax noprefix
tcmmimfp16ps tmm6, tmm5, tmm4 #AMX-COMPLEX
tcmmimfp16ps tmm3, tmm2, tmm1 #AMX-COMPLEX
tcmmrlfp16ps tmm6, tmm5, tmm4 #AMX-COMPLEX
tcmmrlfp16ps tmm3, tmm2, tmm1 #AMX-COMPLEX
+33 -1
View File
@@ -943,6 +943,7 @@ enum
MOD_VEX_0F385E_X86_64_P_1_W_0,
MOD_VEX_0F385E_X86_64_P_2_W_0,
MOD_VEX_0F385E_X86_64_P_3_W_0,
MOD_VEX_0F386C_X86_64_W_0,
MOD_VEX_0F388C,
MOD_VEX_0F388E,
MOD_VEX_0F3A30_L_0,
@@ -1145,6 +1146,7 @@ enum
PREFIX_VEX_0F3851_W_0,
PREFIX_VEX_0F385C_X86_64,
PREFIX_VEX_0F385E_X86_64,
PREFIX_VEX_0F386C_X86_64_W_0_M_1_L_0,
PREFIX_VEX_0F3872,
PREFIX_VEX_0F38B0_W_0,
PREFIX_VEX_0F38B1_W_0,
@@ -1298,6 +1300,7 @@ enum
X86_64_VEX_0F384B,
X86_64_VEX_0F385C,
X86_64_VEX_0F385E,
X86_64_VEX_0F386C,
X86_64_VEX_0F38E0,
X86_64_VEX_0F38E1,
X86_64_VEX_0F38E2,
@@ -1398,6 +1401,7 @@ enum
VEX_LEN_0F385E_X86_64_P_1_W_0_M_0,
VEX_LEN_0F385E_X86_64_P_2_W_0_M_0,
VEX_LEN_0F385E_X86_64_P_3_W_0_M_0,
VEX_LEN_0F386C_X86_64_W_0_M_1,
VEX_LEN_0F38DB,
VEX_LEN_0F38F2,
VEX_LEN_0F38F3,
@@ -1565,6 +1569,7 @@ enum
VEX_W_0F385E_X86_64_P_1,
VEX_W_0F385E_X86_64_P_2,
VEX_W_0F385E_X86_64_P_3,
VEX_W_0F386C_X86_64,
VEX_W_0F3872_P_1,
VEX_W_0F3878,
VEX_W_0F3879,
@@ -4119,6 +4124,13 @@ static const struct dis386 prefix_table[][4] = {
{ VEX_W_TABLE (VEX_W_0F385E_X86_64_P_3) },
},
/* PREFIX_VEX_0F386C_X86_64_W_0_M_1_L_0 */
{
{ "tcmmrlfp16ps", { TMM, EXtmm, VexTmm }, 0 },
{ Bad_Opcode },
{ "tcmmimfp16ps", { TMM, EXtmm, VexTmm }, 0 },
},
/* PREFIX_VEX_0F3872 */
{
{ Bad_Opcode },
@@ -4486,6 +4498,12 @@ static const struct dis386 x86_64_table[][2] = {
{ PREFIX_TABLE (PREFIX_VEX_0F385E_X86_64) },
},
/* X86_64_VEX_0F386C */
{
{ Bad_Opcode },
{ VEX_W_TABLE (VEX_W_0F386C_X86_64) },
},
/* X86_64_VEX_0F38E0 */
{
{ Bad_Opcode },
@@ -6461,7 +6479,7 @@ static const struct dis386 vex_table[][256] = {
{ Bad_Opcode },
{ Bad_Opcode },
{ Bad_Opcode },
{ Bad_Opcode },
{ X86_64_TABLE (X86_64_VEX_0F386C) },
{ Bad_Opcode },
{ Bad_Opcode },
{ Bad_Opcode },
@@ -7181,6 +7199,11 @@ static const struct dis386 vex_len_table[][2] = {
{ "tdpbssd", {TMM, EXtmm, VexTmm }, 0 },
},
/* VEX_LEN_0F386C_X86_64_W_0_M_1 */
{
{ PREFIX_TABLE (PREFIX_VEX_0F386C_X86_64_W_0_M_1_L_0) },
},
/* VEX_LEN_0F38DB */
{
{ "vaesimc", { XM, EXx }, PREFIX_DATA },
@@ -7849,6 +7872,10 @@ static const struct dis386 vex_w_table[][2] = {
/* VEX_W_0F385E_X86_64_P_3 */
{ MOD_TABLE (MOD_VEX_0F385E_X86_64_P_3_W_0) },
},
{
/* VEX_W_0F386C_X86_64 */
{ MOD_TABLE (MOD_VEX_0F386C_X86_64_W_0) },
},
{
/* VEX_W_0F3872_P_1 */
{ "%XVvcvtneps2bf16%XY", { XMM, EXx }, 0 },
@@ -8696,6 +8723,11 @@ static const struct dis386 mod_table[][2] = {
{ Bad_Opcode },
{ VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_3_W_0_M_0) },
},
{
/* MOD_VEX_0F386C_X86_64_W_0 */
{ Bad_Opcode },
{ VEX_LEN_TABLE (VEX_LEN_0F386C_X86_64_W_0_M_1) },
},
{
/* MOD_VEX_0F388C */
{ "vpmaskmov%DQ", { XM, Vex, Mx }, PREFIX_DATA },
+3
View File
@@ -240,6 +240,8 @@ static const dependency isa_dependencies[] =
"AMX_TILE" },
{ "AMX_FP16",
"AMX_TILE" },
{ "AMX_COMPLEX",
"AMX_TILE" },
{ "KL",
"SSE2" },
{ "WIDEKL",
@@ -378,6 +380,7 @@ static bitfield cpu_flags[] =
BITFIELD (AMX_INT8),
BITFIELD (AMX_BF16),
BITFIELD (AMX_FP16),
BITFIELD (AMX_COMPLEX),
BITFIELD (AMX_TILE),
BITFIELD (MOVDIRI),
BITFIELD (MOVDIR64B),
+280 -262
View File
File diff suppressed because it is too large Load Diff
+550 -548
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -248,6 +248,8 @@ enum
CpuAMX_BF16,
/* AMX-FP16 instructions required */
CpuAMX_FP16,
/* AMX-COMPLEX instructions required. */
CpuAMX_COMPLEX,
/* AMX-TILE instructions required */
CpuAMX_TILE,
/* GFNI instructions required */
@@ -432,6 +434,7 @@ typedef union i386_cpu_flags
unsigned int cpuamx_int8:1;
unsigned int cpuamx_bf16:1;
unsigned int cpuamx_fp16:1;
unsigned int cpuamx_complex:1;
unsigned int cpuamx_tile:1;
unsigned int cpugfni:1;
unsigned int cpuvaes:1;
+3
View File
@@ -3146,6 +3146,9 @@ xresldtrk, 0xf20f01e9, TSXLDTRK, NoSuf, {}
ldtilecfg, 0x49/0, AMX_TILE|x64, Modrm|Vex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex }
sttilecfg, 0x6649/0, AMX_TILE|x64, Modrm|Vex128|Space0F38|VexW0|NoSuf, { Unspecified|BaseIndex }
tcmmimfp16ps, 0x666c, AMX_COMPLEX|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM }
tcmmrlfp16ps, 0x6c, AMX_COMPLEX|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM }
tdpbf16ps, 0xf35c, AMX_BF16|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM }
tdpfp16ps, 0xf25c, AMX_FP16|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM }
tdpbssd, 0xf25e, AMX_INT8|x64, Modrm|Vex128|Space0F38|VexVVVV|VexW0|SwapSources|NoSuf, { RegTMM, RegTMM, RegTMM }
+3936 -3900
View File
File diff suppressed because it is too large Load Diff