[PATCH 2/2] Support x86 ACE_OP_FP16/32/64 instructions
Haochen Jiang
haochen.jiang@intel.com
Mon Nov 16 08:19:37 GMT 2026
ACEOPFP16/32/64 are three discrete bits under ACE umbrella.
In assembler, TOP1PD from ACEOPFP64 uses a zmm register pair, it also
has three registers just like Xeon Phi ISAs with RegSIMD last operand
usage. Thus, the previous condition based on operand amount could not
be used. Here we change it to check last operand type to distinguish
Xeon Phi and AMX/ACE pair register usage. Also, the register pair
usage added from now on will raise error instead of warning since
HW will raise #UD for invalid usage for them.
In disassebler, by using the currently existing %XB/%XH/%XS/%XD
macro, we could skip W table.
gas/ChangeLog:
* NEWS: Mention ACEOPFP16/32/64 support.
* config/tc-i386.c: Support ACEOPFP16/32/64.
(process_operands): Handle TOP1PD pair register.
* doc/c-i386.texi: Document ACEOPFP16/32/64.
* testsuite/gas/i386/x86-64.exp: Add ACEOPFP16/32/64 tests.
* testsuite/gas/i386/x86-64-ace_op_fp16-intel.d: New test.
* testsuite/gas/i386/x86-64-ace_op_fp16.d: Ditto.
* testsuite/gas/i386/x86-64-ace_op_fp16.s: Ditto.
* testsuite/gas/i386/x86-64-ace_op_fp32-intel.d: Ditto.
* testsuite/gas/i386/x86-64-ace_op_fp32.d: Ditto.
* testsuite/gas/i386/x86-64-ace_op_fp32.s: Ditto.
* testsuite/gas/i386/x86-64-ace_op_fp64-bad.d: Ditto.
* testsuite/gas/i386/x86-64-ace_op_fp64-bad.s: Ditto.
* testsuite/gas/i386/x86-64-ace_op_fp64-intel.d: Ditto.
* testsuite/gas/i386/x86-64-ace_op_fp64-inval.l: Ditto.
* testsuite/gas/i386/x86-64-ace_op_fp64-inval.s: Ditto.
* testsuite/gas/i386/x86-64-ace_op_fp64.d: Ditto.
* testsuite/gas/i386/x86-64-ace_op_fp64.s: Ditto.
opcodes/ChangeLog:
* i386-dis-evex-len.h: Add EVEX_LEN_0F3848_X86_64.
Revise EVEX_LEN_0F385C_X86_64_W_0 to EVEX_LEN_0F385C_X86_64.
* i386-dis-evex-prefix.h: Add PREFIX_EVEX_0F3848_X86_64_L_2.
Revise PREFIX_EVEX_0F385C_X86_64_W_0_L_2 to
PREFIX_EVEX_0F385C_X86_64_L_2.
* i386-dis-evex-w.h: Remove EVEX_W_0F385C_X86_64.
* i386-dis-evex-x86-64.h: Add X86_64_EVEX_0F3848.
Revise X86_64_EVEX_0F385C.
* i386-dis-evex.h: Add X86_64_EVEX_0F3848.
* i386-dis.c: Add new table entries.
(UxEven): New.
(x_even_mode): Ditto.
(print_vector_reg); Print {bad} for odd register number
under x_even_mode.
* i386-gen.c: Add ACEOPFP16/32/64.
* i386-opc.h: Ditto.
* i386-opc.tbl: Add new instructions.
* i386-init.h: Regenerated.
* i386-mnem.h: Ditto.
* i386-tbl.h: Ditto.
---
gas/NEWS | 3 +
gas/config/tc-i386.c | 43 +-
gas/doc/c-i386.texi | 4 +
.../gas/i386/x86-64-ace_op_fp16-intel.d | 13 +
gas/testsuite/gas/i386/x86-64-ace_op_fp16.d | 11 +
gas/testsuite/gas/i386/x86-64-ace_op_fp16.s | 11 +
.../gas/i386/x86-64-ace_op_fp32-intel.d | 13 +
gas/testsuite/gas/i386/x86-64-ace_op_fp32.d | 11 +
gas/testsuite/gas/i386/x86-64-ace_op_fp32.s | 11 +
.../gas/i386/x86-64-ace_op_fp64-bad.d | 10 +
.../gas/i386/x86-64-ace_op_fp64-bad.s | 3 +
.../gas/i386/x86-64-ace_op_fp64-intel.d | 13 +
.../gas/i386/x86-64-ace_op_fp64-inval.l | 2 +
.../gas/i386/x86-64-ace_op_fp64-inval.s | 5 +
gas/testsuite/gas/i386/x86-64-ace_op_fp64.d | 11 +
gas/testsuite/gas/i386/x86-64-ace_op_fp64.s | 11 +
gas/testsuite/gas/i386/x86-64.exp | 8 +
opcodes/i386-dis-evex-len.h | 11 +-
opcodes/i386-dis-evex-prefix.h | 13 +-
opcodes/i386-dis-evex-w.h | 4 -
opcodes/i386-dis-evex-x86-64.h | 7 +-
opcodes/i386-dis-evex.h | 2 +-
opcodes/i386-dis.c | 17 +-
opcodes/i386-gen.c | 9 +
opcodes/i386-init.h | 914 ++--
opcodes/i386-mnem.h | 3741 +++++++++--------
opcodes/i386-opc.h | 9 +
opcodes/i386-opc.tbl | 4 +
opcodes/i386-tbl.h | 1258 +++---
29 files changed, 3237 insertions(+), 2935 deletions(-)
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp16-intel.d
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp16.d
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp16.s
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp32-intel.d
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp32.d
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp32.s
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp64-bad.d
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp64-bad.s
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp64-intel.d
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp64-inval.l
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp64-inval.s
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp64.d
create mode 100644 gas/testsuite/gas/i386/x86-64-ace_op_fp64.s
diff --git a/gas/NEWS b/gas/NEWS
index 244273bf340..886c871a4d8 100644
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -1,5 +1,8 @@
-*- text -*-
+* Add support for the x86 ACE_OP_FP16, ACE_OP_FP32 and ACE_OP_FP64
+ instructions.
+
* Add support for the x86 ACE V2 instructions.
* Add support for the x86 AVX10.3 instructions.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index de89a937ce7..0175db9e001 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1209,6 +1209,9 @@ static const arch_entry cpu_arch[] =
SUBARCH (cldemote, CLDEMOTE, CLDEMOTE, false),
SUBARCH (ace_v1, ACE_V1, ANY_ACE_V1, false),
SUBARCH (ace_v2, ACE_V2, ANY_ACE_V2, false),
+ SUBARCH (ace_op_fp16, ACE_OP_FP16, ANY_ACE_OP_FP16, false),
+ SUBARCH (ace_op_fp32, ACE_OP_FP32, ANY_ACE_OP_FP32, false),
+ SUBARCH (ace_op_fp64, ACE_OP_FP64, ANY_ACE_OP_FP64, false),
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),
@@ -11493,15 +11496,16 @@ process_operands (void)
{
case RegSIMD:
op = 1;
- if (i.operands == 2)
+ if (!i.types[i.operands - 1].bitfield.tmmword)
{
- /* AMX-TRANSPOSE operand 2: N must be a multiple of 2. */
- extra = 1;
+ /* AVX512-{4FMAPS,4VNNIW} operand 2: N must be a multiple of 4. */
+ extra = 3;
}
else
{
- /* AVX512-{4FMAPS,4VNNIW} operand 2: N must be a multiple of 4. */
- extra = 3;
+ /* AMX-TRANSPOSE/ACE_OP_FP64 operand 2:
+ N must be a multiple of 2. */
+ extra = 1;
}
break;
@@ -11517,13 +11521,28 @@ process_operands (void)
first = i.op[op].regs - (register_number (i.op[op].regs) & extra);
if (i.op[op].regs != first)
- as_warn (_("operand %u `%s%s' implicitly denotes"
- " `%s%s' to `%s%s' group in `%s'"),
- intel_syntax ? i.operands - op : op + 1,
- register_prefix, i.op[op].regs->reg_name,
- register_prefix, first[0].reg_name,
- register_prefix, first[extra].reg_name,
- insn_name (&i.tm));
+ /* For register pairs under AVX512-{4FMAPS, 4VNNIW},
+ AVX512-VP2INTERSECT, AMX_TRANSPOSE, improper register
+ number will be implicitly handled by hardware to its
+ valid register number. For all the other register
+ pairs, hardward will raise #UD. */
+ if (is_cpu (&i.tm, CpuAVX512_4FMAPS)
+ || is_cpu (&i.tm, CpuAVX512_4VNNIW)
+ || is_cpu (&i.tm, CpuAVX512_VP2INTERSECT)
+ || is_cpu (&i.tm, CpuAMX_TRANSPOSE))
+ as_warn (_("operand %u `%s%s' implicitly denotes"
+ " `%s%s' to `%s%s' group in `%s'"),
+ intel_syntax ? i.operands - op : op + 1,
+ register_prefix, i.op[op].regs->reg_name,
+ register_prefix, first[0].reg_name,
+ register_prefix, first[extra].reg_name,
+ insn_name (&i.tm));
+ else
+ as_bad (_("operand %u `%s%s' is invalid in `%s',"
+ " use `%s%s' instead"),
+ intel_syntax ? i.operands - op : op + 1,
+ register_prefix, i.op[op].regs->reg_name,
+ insn_name (&i.tm), register_prefix, first[0].reg_name);
}
else if (i.tm.opcode_modifier.operandconstraint == REG_KLUDGE)
{
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index d46169c420a..a10183d9825 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -250,6 +250,9 @@ accept various extension mnemonics. For example,
@code{amx_tile},
@code{ace_v1},
@code{ace_v2},
+@code{ace_op_fp16},
+@code{ace_op_fp32},
+@code{ace_op_fp64},
@code{vmx},
@code{vmfunc},
@code{smx},
@@ -1747,6 +1750,7 @@ supported on the CPU specified. The choices for @var{cpu_type} are:
@item @samp{.amx_complex} @tab @samp{.amx_transpose} @tab @samp{.amx_tf32}
@item @samp{.amx_fp8} @tab @samp{.amx_movrs} @tab @samp{.amx_avx512}
@item @samp{.amx_tile} @tab @samp{.ace_v1} @tab @samp{.ace_v2}
+@item @samp{.ace_op_fp16} @tab @samp{.ace_op_fp32} @tab @samp{.ace_op_fp64}
@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}
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp16-intel.d b/gas/testsuite/gas/i386/x86-64-ace_op_fp16-intel.d
new file mode 100644
index 00000000000..464baa36730
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp16-intel.d
@@ -0,0 +1,13 @@
+#objdump: -dw -Mintel
+#name: x86_64 ACE_OP_FP16 insns (Intel disassembly)
+#source: x86-64-ace_op_fp16.s
+
+.*: +file format .*
+
+Disassembly of section \.text:
+
+#...
+[a-f0-9]+ <_intel>:
+[ ]*[a-f0-9]+:[ ]*62 92 1f 40 5c f5[ ]*top2phps tmm6,zmm29,zmm28
+[ ]*[a-f0-9]+:[ ]*62 92 1f 40 5c dd[ ]*top2phps tmm3,zmm29,zmm28
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp16.d b/gas/testsuite/gas/i386/x86-64-ace_op_fp16.d
new file mode 100644
index 00000000000..be60ca28305
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp16.d
@@ -0,0 +1,11 @@
+#objdump: -dw
+#name: x86_64 ACE_OP_FP16 insns
+
+.*: +file format .*
+
+Disassembly of section \.text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+:[ ]*62 92 1f 40 5c f5[ ]*top2phps %zmm28,%zmm29,%tmm6
+[ ]*[a-f0-9]+:[ ]*62 92 1f 40 5c dd[ ]*top2phps %zmm28,%zmm29,%tmm3
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp16.s b/gas/testsuite/gas/i386/x86-64-ace_op_fp16.s
new file mode 100644
index 00000000000..c30162f6326
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp16.s
@@ -0,0 +1,11 @@
+# Check 64bit ACE_OP_FP16 instructions
+
+ .text
+_start:
+ top2phps %zmm28, %zmm29, %tmm6
+ top2phps %zmm28, %zmm29, %tmm3
+
+_intel:
+ .intel_syntax noprefix
+ top2phps tmm6, zmm29, zmm28
+ top2phps tmm3, zmm29, zmm28
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp32-intel.d b/gas/testsuite/gas/i386/x86-64-ace_op_fp32-intel.d
new file mode 100644
index 00000000000..be6859299fe
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp32-intel.d
@@ -0,0 +1,13 @@
+#objdump: -dw -Mintel
+#name: x86_64 ACE_OP_FP32 insns (Intel disassembly)
+#source: x86-64-ace_op_fp32.s
+
+.*: +file format .*
+
+Disassembly of section \.text:
+
+#...
+[a-f0-9]+ <_intel>:
+[ ]*[a-f0-9]+:[ ]*62 92 1c 40 48 f5[ ]*top1ps tmm6,zmm29,zmm28
+[ ]*[a-f0-9]+:[ ]*62 92 1c 10 48 dd[ ]*top1ps tmm3,zmm29,zmm28\{rn-sae\}
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp32.d b/gas/testsuite/gas/i386/x86-64-ace_op_fp32.d
new file mode 100644
index 00000000000..9944f679cc0
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp32.d
@@ -0,0 +1,11 @@
+#objdump: -dw
+#name: x86_64 ACE_OP_FP32 insns
+
+.*: +file format .*
+
+Disassembly of section \.text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+:[ ]*62 92 1c 40 48 f5[ ]*top1ps %zmm28,%zmm29,%tmm6
+[ ]*[a-f0-9]+:[ ]*62 92 1c 10 48 dd[ ]*top1ps \{rn-sae\},%zmm28,%zmm29,%tmm3
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp32.s b/gas/testsuite/gas/i386/x86-64-ace_op_fp32.s
new file mode 100644
index 00000000000..0247a49b088
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp32.s
@@ -0,0 +1,11 @@
+# Check 64bit ACE_OP_FP32 instructions
+
+ .text
+_start:
+ top1ps %zmm28, %zmm29, %tmm6
+ top1ps {rn-sae}, %zmm28, %zmm29, %tmm3
+
+_intel:
+ .intel_syntax noprefix
+ top1ps tmm6, zmm29, zmm28
+ top1ps tmm3, zmm29, zmm28{rn-sae}
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp64-bad.d b/gas/testsuite/gas/i386/x86-64-ace_op_fp64-bad.d
new file mode 100644
index 00000000000..bfc5da2c030
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp64-bad.d
@@ -0,0 +1,10 @@
+#objdump: -drw
+#name: x86_64 Illegal ACE_OP_FP64 insns
+
+.*: +file format .*
+
+
+Disassembly of section \.text:
+
+0+ <\.text>:
+[ ]*[a-f0-9]+:[ ]*62 f2 ef 48 48 c9[ ]*top1pd %zmm2,\(bad\),%tmm1
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp64-bad.s b/gas/testsuite/gas/i386/x86-64-ace_op_fp64-bad.s
new file mode 100644
index 00000000000..a335bb59ce7
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp64-bad.s
@@ -0,0 +1,3 @@
+.text
+ #top1pd %tmm1,%zmm1,%zmm2 (illegal register number)
+ .insn EVEX.512.F2.0F38.W1 0x48, %zmm1, %zmm2, %tmm1
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp64-intel.d b/gas/testsuite/gas/i386/x86-64-ace_op_fp64-intel.d
new file mode 100644
index 00000000000..5bb11f888de
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp64-intel.d
@@ -0,0 +1,13 @@
+#objdump: -dw -Mintel
+#name: x86_64 ACE_OP_FP64 insns (Intel disassembly)
+#source: x86-64-ace_op_fp64.s
+
+.*: +file format .*
+
+Disassembly of section \.text:
+
+#...
+[a-f0-9]+ <_intel>:
+[ ]*[a-f0-9]+:[ ]*62 92 9f 40 48 f2[ ]*top1pd tmm6,zmm26,zmm28
+[ ]*[a-f0-9]+:[ ]*62 92 9f 10 48 da[ ]*top1pd tmm3,zmm26,zmm28\{rn-sae\}
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp64-inval.l b/gas/testsuite/gas/i386/x86-64-ace_op_fp64-inval.l
new file mode 100644
index 00000000000..0f620bd5840
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp64-inval.l
@@ -0,0 +1,2 @@
+.* Assembler messages:
+.*:5: Error: operand 2 `%zmm1' is invalid in `top1pd', use `%zmm0' instead
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp64-inval.s b/gas/testsuite/gas/i386/x86-64-ace_op_fp64-inval.s
new file mode 100644
index 00000000000..54c9420d94d
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp64-inval.s
@@ -0,0 +1,5 @@
+# Check 64bit ACE_OP_FP64 invalid instructions
+
+ .text
+_start:
+ top1pd %zmm3, %zmm1, %tmm6
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp64.d b/gas/testsuite/gas/i386/x86-64-ace_op_fp64.d
new file mode 100644
index 00000000000..681ea0c115a
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp64.d
@@ -0,0 +1,11 @@
+#objdump: -dw
+#name: x86_64 ACE_OP_FP64 insns
+
+.*: +file format .*
+
+Disassembly of section \.text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+:[ ]*62 92 9f 40 48 f2[ ]*top1pd %zmm28,%zmm26,%tmm6
+[ ]*[a-f0-9]+:[ ]*62 92 9f 10 48 da[ ]*top1pd \{rn-sae\},%zmm28,%zmm26,%tmm3
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-ace_op_fp64.s b/gas/testsuite/gas/i386/x86-64-ace_op_fp64.s
new file mode 100644
index 00000000000..9fd3735a812
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-ace_op_fp64.s
@@ -0,0 +1,11 @@
+# Check 64bit ACE_OP_FP64 instructions
+
+ .text
+_start:
+ top1pd %zmm28, %zmm26, %tmm6
+ top1pd {rn-sae}, %zmm28, %zmm26, %tmm3
+
+_intel:
+ .intel_syntax noprefix
+ top1pd tmm6, zmm26, zmm28
+ top1pd tmm3, zmm26, zmm28{rn-sae}
diff --git a/gas/testsuite/gas/i386/x86-64.exp b/gas/testsuite/gas/i386/x86-64.exp
index ce9056a1940..262afcc0790 100644
--- a/gas/testsuite/gas/i386/x86-64.exp
+++ b/gas/testsuite/gas/i386/x86-64.exp
@@ -706,6 +706,14 @@ run_dump_test "x86-64-ace_v1"
run_dump_test "x86-64-ace_v1-intel"
run_dump_test "x86-64-ace_v2"
run_dump_test "x86-64-ace_v2-intel"
+run_dump_test "x86-64-ace_op_fp16"
+run_dump_test "x86-64-ace_op_fp16-intel"
+run_dump_test "x86-64-ace_op_fp32"
+run_dump_test "x86-64-ace_op_fp32-intel"
+run_dump_test "x86-64-ace_op_fp64"
+run_dump_test "x86-64-ace_op_fp64-intel"
+run_list_test "x86-64-ace_op_fp64-inval"
+run_dump_test "x86-64-ace_op_fp64-bad"
if { ![istarget "*-*-aix*"]
&& ![istarget "*-*-*bsd*"]
diff --git a/opcodes/i386-dis-evex-len.h b/opcodes/i386-dis-evex-len.h
index 8ca113c02be..f9ad9eb0979 100644
--- a/opcodes/i386-dis-evex-len.h
+++ b/opcodes/i386-dis-evex-len.h
@@ -44,6 +44,13 @@ static const struct dis386 evex_len_table[][3] = {
{ "vperm%DQ", { XM, Vex, EXx }, PREFIX_DATA },
},
+ /* EVEX_LEN_0F3848_X86_64 */
+ {
+ { Bad_Opcode },
+ { Bad_Opcode },
+ { PREFIX_TABLE (PREFIX_EVEX_0F3848_X86_64_L_2) },
+ },
+
/* EVEX_LEN_0F384A_X86_64_W_0 */
{
{ X86_64_EVEX_PFX_TABLE (PREFIX_VEX_0F384A_X86_64_W_0_L_0) },
@@ -79,11 +86,11 @@ static const struct dis386 evex_len_table[][3] = {
{ VEX_W_TABLE (EVEX_W_0F385B_L_2) },
},
- /* EVEX_LEN_0F385C_X86_64_W_0 */
+ /* EVEX_LEN_0F385C_X86_64 */
{
{ Bad_Opcode },
{ Bad_Opcode },
- { PREFIX_TABLE (PREFIX_EVEX_0F385C_X86_64_W_0_L_2) },
+ { PREFIX_TABLE (PREFIX_EVEX_0F385C_X86_64_L_2) },
},
/* EVEX_LEN_0F385E_X86_64_W_0 */
diff --git a/opcodes/i386-dis-evex-prefix.h b/opcodes/i386-dis-evex-prefix.h
index deeb50f7dab..e5c26c6e7e6 100644
--- a/opcodes/i386-dis-evex-prefix.h
+++ b/opcodes/i386-dis-evex-prefix.h
@@ -248,6 +248,13 @@
{ Bad_Opcode },
{ "vpmovssdb", { EXxmmqd, XM }, 0 },
},
+ /* PREFIX_EVEX_0F3848_X86_64_L_2 */
+ {
+ { "top1p%XS", { TMM, Ux, Vex, EXxEVexR }, 0 },
+ { Bad_Opcode },
+ { Bad_Opcode },
+ { "top1p%XD", { TMM, UxEven, Vex, EXxEVexR }, 0 },
+ },
/* PREFIX_EVEX_0F384A_X86_64_W_0_L_2 */
{
{ Bad_Opcode },
@@ -280,10 +287,12 @@
{ VEX_W_TABLE (VEX_W_0F3853) },
{ "vp4dpws%XSds", { XM, Vex, Mxmm }, 0 },
},
- /* PREFIX_EVEX_0F385C_X86_64_W_0_L_2 */
+ /* PREFIX_EVEX_0F385C_X86_64_L_2 */
{
{ Bad_Opcode },
- { "top2bf16ps", { TMM, Ux, Vex }, 0 },
+ { "top2%XBps", { TMM, Ux, Vex }, 0 },
+ { Bad_Opcode },
+ { "top2p%XHps", { TMM, Ux, Vex }, 0 },
},
/* PREFIX_EVEX_0F385E_X86_64_W_0_L_2 */
{
diff --git a/opcodes/i386-dis-evex-w.h b/opcodes/i386-dis-evex-w.h
index b974dfcefc7..374e6ac4d94 100644
--- a/opcodes/i386-dis-evex-w.h
+++ b/opcodes/i386-dis-evex-w.h
@@ -375,10 +375,6 @@
{ "vbroadcasti32x8", { XM, Mymm }, PREFIX_DATA },
{ "vbroadcasti64x4", { XM, Mymm }, PREFIX_DATA },
},
- /* EVEX_W_0F385C_X86_64 */
- {
- { EVEX_LEN_TABLE (EVEX_LEN_0F385C_X86_64_W_0) },
- },
/* EVEX_W_0F385E_X86_64 */
{
{ EVEX_LEN_TABLE (EVEX_LEN_0F385E_X86_64_W_0) },
diff --git a/opcodes/i386-dis-evex-x86-64.h b/opcodes/i386-dis-evex-x86-64.h
index 4c6ed924ef5..bbd3c22b3c3 100644
--- a/opcodes/i386-dis-evex-x86-64.h
+++ b/opcodes/i386-dis-evex-x86-64.h
@@ -1,3 +1,8 @@
+ /* X86_64_EVEX_0F3848 */
+ {
+ { Bad_Opcode },
+ { EVEX_LEN_TABLE (EVEX_LEN_0F3848_X86_64) },
+ },
/* X86_64_EVEX_0F384A */
{
{ Bad_Opcode },
@@ -11,7 +16,7 @@
/* X86_64_EVEX_0F385C */
{
{ Bad_Opcode },
- { VEX_W_TABLE (EVEX_W_0F385C_X86_64) },
+ { EVEX_LEN_TABLE (EVEX_LEN_0F385C_X86_64) },
},
/* X86_64_EVEX_0F385E */
{
diff --git a/opcodes/i386-dis-evex.h b/opcodes/i386-dis-evex.h
index 09a21e62f2b..6f396c20046 100644
--- a/opcodes/i386-dis-evex.h
+++ b/opcodes/i386-dis-evex.h
@@ -374,7 +374,7 @@ static const struct dis386 evex_table[][256] = {
{ "vpsrav%DQ", { XM, Vex, EXx }, PREFIX_DATA },
{ "vpsllv%DQ", { XM, Vex, EXx }, PREFIX_DATA },
/* 48 */
- { Bad_Opcode },
+ { X86_64_TABLE (X86_64_EVEX_0F3848) },
{ X86_64_EVEX_MEM_W_TABLE (VEX_W_0F3849_X86_64_L_0) },
{ X86_64_TABLE (X86_64_EVEX_0F384A) },
{ X86_64_TABLE (X86_64_EVEX_0F384B) },
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index aa339d07473..91e37f974c1 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -581,6 +581,7 @@ fetch_error (const instr_info *ins)
#define Rq { OP_R, q_mode }
#define Nq { OP_R, q_mm_mode }
#define Ux { OP_R, x_mode }
+#define UxEven { OP_R, x_even_mode }
#define Uxmm { OP_R, xmm_mode }
#define Rxmmq { OP_R, xmmq_mode }
#define Rymm { OP_R, ymm_mode }
@@ -697,6 +698,8 @@ enum
/* Similar to x_mode, but with operands swapped and disabled broadcast
in EVEX. */
x_swap_mode,
+ /* Similar to x_mode, but accept even register number only. */
+ x_even_mode,
/* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
broadcast of 16bit enabled. */
xh_mode,
@@ -1222,12 +1225,13 @@ enum
PREFIX_EVEX_0F3839,
PREFIX_EVEX_0F383A,
PREFIX_EVEX_0F3841_W_0,
+ PREFIX_EVEX_0F3848_X86_64_L_2,
PREFIX_EVEX_0F384A_X86_64_W_0_L_2,
PREFIX_EVEX_0F384A_X86_64_W_1_L_2,
PREFIX_EVEX_0F384B_X86_64_W_1_L_2,
PREFIX_EVEX_0F3852,
PREFIX_EVEX_0F3853,
- PREFIX_EVEX_0F385C_X86_64_W_0_L_2,
+ PREFIX_EVEX_0F385C_X86_64_L_2,
PREFIX_EVEX_0F385E_X86_64_W_0_L_2,
PREFIX_EVEX_0F3868,
PREFIX_EVEX_0F386D_X86_64_W_0_L_2,
@@ -1430,6 +1434,7 @@ enum
X86_64_VEX_MAP7_F6_L_0_W_0_R_0,
X86_64_VEX_MAP7_F8_L_0_W_0_R_0,
+ X86_64_EVEX_0F3848,
X86_64_EVEX_0F384A,
X86_64_EVEX_0F384B,
X86_64_EVEX_0F385C,
@@ -1639,12 +1644,13 @@ enum
EVEX_LEN_0F381A,
EVEX_LEN_0F381B,
EVEX_LEN_0F3836,
+ EVEX_LEN_0F3848_X86_64,
EVEX_LEN_0F384A_X86_64_W_0,
EVEX_LEN_0F384A_X86_64_W_1,
EVEX_LEN_0F384B_X86_64,
EVEX_LEN_0F385A,
EVEX_LEN_0F385B,
- EVEX_LEN_0F385C_X86_64_W_0,
+ EVEX_LEN_0F385C_X86_64,
EVEX_LEN_0F385E_X86_64_W_0,
EVEX_LEN_0F386D_X86_64_W_0,
EVEX_LEN_0F38C6,
@@ -1892,7 +1898,6 @@ enum
EVEX_W_0F3859,
EVEX_W_0F385A_L_n,
EVEX_W_0F385B_L_2,
- EVEX_W_0F385C_X86_64,
EVEX_W_0F385E_X86_64,
EVEX_W_0F386D_X86_64,
EVEX_W_0F3870,
@@ -13604,6 +13609,12 @@ print_vector_reg (instr_info *ins, unsigned int reg, int bytemode)
&& bytemode != q_mode)
{
ins->evex_used |= EVEX_len_used;
+ if (bytemode == x_even_mode
+ && reg % 2 != 0)
+ {
+ oappend (ins, "(bad)");
+ return;
+ }
switch (ins->vex.length)
{
case 128:
diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c
index ab19b4b7696..cff893e7ad3 100644
--- a/opcodes/i386-gen.c
+++ b/opcodes/i386-gen.c
@@ -279,6 +279,12 @@ static const dependency isa_dependencies[] =
"TILE|AVX10_V2_AUX|AVX10_1_AUX" },
{ "ACE_V2",
"ACE_V1" },
+ { "ACE_OP_FP16",
+ "ACE_V1" },
+ { "ACE_OP_FP32",
+ "ACE_V1" },
+ { "ACE_OP_FP64",
+ "ACE_V1" },
{ "AMX_TILE",
"TILE" },
{ "AMX_INT8",
@@ -493,6 +499,9 @@ static bitfield cpu_flags[] =
BITFIELD (CLDEMOTE),
BITFIELD (ACE_V1),
BITFIELD (ACE_V2),
+ BITFIELD (ACE_OP_FP16),
+ BITFIELD (ACE_OP_FP32),
+ BITFIELD (ACE_OP_FP64),
BITFIELD (AMX_INT8),
BITFIELD (AMX_BF16),
BITFIELD (AMX_FP16),
diff --git a/opcodes/i386-opc.h b/opcodes/i386-opc.h
index eb4f034d5dd..664da4c3478 100644
--- a/opcodes/i386-opc.h
+++ b/opcodes/i386-opc.h
@@ -268,6 +268,12 @@ enum i386_cpu
CpuSHSTK,
/* ACE V2 instructions support required. */
CpuACE_V2,
+ /* ACE_OP_FP16 instructions support required. */
+ CpuACE_OP_FP16,
+ /* ACE_OP_FP32 instructions support required. */
+ CpuACE_OP_FP32,
+ /* ACE_OP_FP64 instructions support required. */
+ CpuACE_OP_FP64,
/* AMX-INT8 instructions required */
CpuAMX_INT8,
/* AMX-BF16 instructions required */
@@ -560,6 +566,9 @@ typedef union i386_cpu_flags
unsigned int cpuibt:1;
unsigned int cpushstk:1;
unsigned int cpuace_v2:1;
+ unsigned int cpuace_op_fp16:1;
+ unsigned int cpuace_op_fp32:1;
+ unsigned int cpuace_op_fp64:1;
unsigned int cpuamx_int8:1;
unsigned int cpuamx_bf16:1;
unsigned int cpuamx_fp16:1;
diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl
index 145a31791d9..5967df9c2dc 100644
--- a/opcodes/i386-opc.tbl
+++ b/opcodes/i386-opc.tbl
@@ -3345,6 +3345,10 @@ top8fmxn<tdpb>ps, 0x<tdpb:pfx>8e, ACE_V2, Modrm|EVex512|Space0F3A|Src2VVVV|VexW0
top8fmxbf4ps, 0xf38c, ACE_V2, Modrm|EVex512|Space0F3A|Src2VVVV|VexW0|NoSuf, { Imm8, RegZMM, RegZMM, RegTMM }
+top2phps, 0xf25c, ACE_OP_FP16, Modrm|EVex512|Space0F38|Src2VVVV|VexW0|NoSuf, { RegZMM, RegZMM, RegTMM }
+top1ps, 0x48, ACE_OP_FP32, Modrm|EVex512|Space0F38|Src2VVVV|VexW0|NoSuf|StaticRounding|SAE, { RegZMM, RegZMM, RegTMM }
+top1pd, 0xf248, ACE_OP_FP64, Modrm|EVex512|Space0F38|Src2VVVV|VexW1|NoSuf|ImplicitGroup|StaticRounding|SAE, { RegZMM, RegZMM, RegTMM }
+
// ACE instructions end.
// KEYLOCKER instructions.
--
2.31.1
More information about the Binutils
mailing list