Commit Graph

703 Commits

Author SHA1 Message Date
Haochen Jiang
fdb44fced2 x86: Remove AVX10.2 256 bit rounding support
Since we will support 512 bit on both P-core and E-core for AVX10, 256 bit
rounding is not that useful because we currently have rounding feature
directly on E-core now and no need to use 256-bit rounding as somehow
a workaround. This patch will remove all the support and backport to
Binutils 2.44.

gas/ChangeLog:

	* NEWS: Mention support removal.
	* config/tc-i386.c (build_evex_prefix): Remove U bit encode.
	(check_VecOperands): Remove ymm check for rounding.
	(s_insn): Revise .insn comment.
	* testsuite/gas/i386/avx10_2-256-cvt-intel.d: Remove ymm
	rounding related test.
	* testsuite/gas/i386/avx10_2-256-cvt.d: Ditto.
	* testsuite/gas/i386/avx10_2-256-cvt.s: Ditto.
	* testsuite/gas/i386/avx10_2-256-miscs-intel.d: Ditto.
	* testsuite/gas/i386/avx10_2-256-miscs.d: Ditto.
	* testsuite/gas/i386/avx10_2-256-miscs.s: Ditto.
	* testsuite/gas/i386/avx10_2-256-satcvt-intel.d: Ditto.
	* testsuite/gas/i386/avx10_2-256-satcvt.d: Ditto.
	* testsuite/gas/i386/avx10_2-256-satcvt.s: Ditto.
	* testsuite/gas/i386/evex.d: Ditto.
	* testsuite/gas/i386/evex.s: Ditto.
	* testsuite/gas/i386/i386.exp: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-cvt-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-cvt.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-cvt.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-miscs-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-miscs.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-miscs.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-satcvt-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-satcvt.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-satcvt.s: Ditto.
	* testsuite/gas/i386/x86-64-evex.d: Ditto.
	* testsuite/gas/i386/x86-64.exp: Ditto.
	* testsuite/gas/i386/avx10_2-rounding-intel.d: Removed.
	* testsuite/gas/i386/avx10_2-rounding-inval.l: Removed.
	* testsuite/gas/i386/avx10_2-rounding-inval.s: Removed.
	* testsuite/gas/i386/avx10_2-rounding.d: Removed.
	* testsuite/gas/i386/avx10_2-rounding.s: Removed.
	* testsuite/gas/i386/x86-64-avx10_2-rounding-intel.d: Removed.
	* testsuite/gas/i386/x86-64-avx10_2-rounding.d: Removed.
	* testsuite/gas/i386/x86-64-avx10_2-rounding.s: Removed.

opcodes/ChangeLog:

	* i386-dis.c (struct instr_info): Remove U bit.
	(get_valid_dis386): Roll back to APX condition.
	* i386-opc.tbl: Remove ymm rounding support.
	* i386-tbl.h: Regenerated.
2025-03-27 10:10:47 +08:00
MayShao-oc
a5626289a6 x86: Support x86 Zhaoxin PadLock XMODX instructions
The CPUID EDX bit[28] indicates its enablement, and it includes REP
XMODEXP and REP MONTMUL2. XMODX stands for modular exponentiation, it indicates
the support of modular exponentiation feature, both REP XMODEXP and
REP MONTMUL2 use it.

gas/ChangeLog:

	* NEWS: Support Zhaoxin PadLock XMODX instructions.
	* config/tc-i386.c (add_branch_prefix_frag_p): Don't add prefix to
	PadLockXMODX instructions.
	(output_insn): Handle PadLockXMODX instructions.
	* doc/c-i386.texi: Document PadLockXMODX.
	* testsuite/gas/i386/i386.exp: Add PadLockXMODX test.
	* testsuite/gas/i386/padlockxmodx.d: Ditto.
	* testsuite/gas/i386/padlockxmodx.s: Ditto.

opcodes/ChangeLog:

	* i386-dis.c: Add PadLockXMODX.
	* i386-gen.c: Ditto
	* i386-opc.h (CpuPadLockXMODX): New.
	* i386-opc.tbl: Add Zhaoxin PadLock XMODX instructions.
	* i386-tbl.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-init.h: Ditto.
2025-02-07 10:31:42 +01:00
Jan Beulich
b2d844097b x86/APX: GETSEC cannot be used with REX2
It lives in a "forbidden" row, yet its disassembler table entry was
lacking a respective marker.
2025-01-31 10:07:32 +01:00
Jan Beulich
d188bb12f7 x86: support RMPREAD insn
Like for RMPUPDATE documentation is about to change as far as operands
are concerned. They're merely the other way around here.

While adjustind gas documentation, also add the missing RMPQUERY
counterparts there.
2025-01-31 10:06:02 +01:00
Jan Beulich
4612bba098 x86: RMPUPDATE wants operands in different form
AMD are about to update their doc, to help clarify that what we
currently do isn't quite right: In particular it is not %rax but %rcx
which is affected by address size. In fact, that's a normal memory
operand, just not expressed via ModR/M byte, but fixed to (%rcx) (or
(%ecx) with 32-bit addressing).

To support this in the assembler, generalize memory operand handling so
far specific to XLAT (which isn't really a string insn, but requires its
memory operand to be (%bx) / (%ebx) / (%rbx)).

In the disassembler mimic handling after XLAT's, too.
2025-01-31 10:05:36 +01:00
Jan Beulich
36fa5275c1 x86-64: omit "default" segment prefixes from string insn disassembly
Printing implicit %ds: and %es: prefixes is pretty meaningless in 64-bit
mode. The SDM explicitly omits them for the 64-bit forms, and it
obviously has them for the other ones only to cover non-64-bit modes
(oddly enough the AMD PM has them present).
2025-01-31 10:04:45 +01:00
Haochen Jiang
18575d2ca8 x86: Ignore rounding for vcvt[,u]si2sd under r32 and vcvt[,u]dq2pd instead of reporting bad for disassembler
According to SDM, vcvt[,u]si2sd under r32 and vcvt[,u]dq2pd treat
Rounding as Ignored when trying to using them. Thus, disassembler
should accept bytecode with rounding instead of reporting bad.

For assembler, it needs some more time to decide how to deal
with that.

gas/ChangeLog:

	* testsuite/gas/i386/evex.d: Add new testcase for vcvt[,u]dq2pd.
	Change the output for vcvt[,u]si2sd.
	* testsuite/gas/i386/evex.s: Ditto.
	* testsuite/gas/i386/x86-64-evex.d: Ditto.

opcodes/ChangeLog:

	* i386-dis-evex-w.h: Add EXxEVexR64 for vcvt[,u]dq2pd.
	* i386-dis.c (OP_Rounding): Mark EVEX_b as used to change the handle
	for ignored rounding.
2025-01-17 10:17:12 +08:00
MayShao-oc
72187c317d x86: Support x86 Zhaoxin PadLock PHE2 instructions
The CPUID EDX bit[26] indicates its enablement, and it includes REP
XSHA384 and REP XSHA512.

gas/ChangeLog:

	* NEWS: Support Zhaoxin PadLock PHE2 instructions.
	* config/tc-i386.c (add_branch_prefix_frag_p): Don't add prefix to
	PadLockPHE2 instructions.
	(output_insn): Handle PadLockPHE2 instructions.
	* doc/c-i386.texi: Document PadLockPHE2.
	* testsuite/gas/i386/i386.exp: Add PadLockPHE2 test.
	* testsuite/gas/i386/padlock_phe2.d: Ditto.
	* testsuite/gas/i386/padlock_phe2.s: Ditto.

opcodes/ChangeLog:

	* i386-dis.c: Add PadLockPHE2.
	* i386-gen.c: Ditto
	* i386-opc.h (CpuPadLockPHE2): New.
	* i386-opc.tbl: Add Zhaoxin PadLock PHE2 instructions.
	* i386-tbl.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-init.h: Ditto.
2025-01-16 10:31:14 +01:00
Haochen Jiang
7473229fa8 Support Intel AMX-AVX512
This patch will support AMX-AVX512. In disassmbler, we pull out all
GPR mode out of the vex length switch to make it more general.

gas/ChangeLog:

	* NEWS: Mention the full support on DMR AMX ISAs.
	* config/tc-i386.c: Add amx_avx512.
	* doc/c-i386.texi: Document .amx_avx512.
	* testsuite/gas/i386/x86-64.exp: Run AMX-AVX512 tests.
	* testsuite/gas/i386/x86-64-amx-avx512-intel.d: New test.
	* testsuite/gas/i386/x86-64-amx-avx512.d: Ditto.
	* testsuite/gas/i386/x86-64-amx-avx512.s: Ditto.

opcodes/ChangeLog:

	* i386-dis-evex-len.h: Add EVEX_LEN_0F384A_X86_64_W_0,
	EVEX_LEN_0F386D_X86_64_W_0, EVEX_LEN_0F3A07_X86_64_W_0,
	EVEX_LEN_0F3A77_X86_64_W_0.
	* i386-dis-evex-prefix.h: Add PREFIX_EVEX_0F384A_W_0_L_2,
	PREFIX_EVEX_0F386D_W_0_L_2, PREFIX_EVEX_0F3A07_W_0_L_2,
	PREFIX_EVEX_0F3A77_W_0_L_2.
	* i386-dis-evex-w.h: Add EVEX_W_0F384A_X86_64, EVEX_W_0F386D_X86_64,
	EVEX_W_0F3A07_X86_64, EVEX_W_0F3A77_X86_64.
	* i386-dis-evex-x86-64.h: Add X86_64_EVEX_0F384A, X86_64_EVEX_0F386D,
	X86_64_EVEX_0F3A07, X86_64_EVEX_0F3A77.
	* i386-dis-evex.h: Ditto.
	* i386-dis.c (EVEX_LEN_0F384A_X86_64_W_0): New.
	(EVEX_LEN_0F386D_X86_64_W_0): Ditto.
	(EVEX_LEN_0F3A07_X86_64_W_0): Ditto.
	(EVEX_LEN_0F3A77_X86_64_W_0): Ditto.
	(MOD_EVEX_0F384A_X86_64_W_0): Ditto.
	(MOD_EVEX_0F386D_X86_64_W_0): Ditto.
	(MOD_EVEX_0F3A07_X86_64_W_0): Ditto.
	(MOD_EVEX_0F3A77_X86_64_W_0): Ditto.
	(PREFIX_EVEX_0F384A_W_0_L_2): Ditto.
	(PREFIX_EVEX_0F386D_W_0_L_2): Ditto.
	(PREFIX_EVEX_0F3A07_W_0_L_2): Ditto.
	(PREFIX_EVEX_0F3A77_W_0_L_2): Ditto.
	(EVEX_W_0F384A_X86_64): Ditto.
	(EVEX_W_0F386D_X86_64): Ditto.
	(EVEX_W_0F3A07_X86_64): Ditto.
	(EVEX_W_0F3A77_X86_64): Ditto.
	(X86_64_EVEX_0F384A): Ditto.
	(X86_64_EVEX_0F386D): Ditto.
	(X86_64_EVEX_0F3A07): Ditto.
	(X86_64_EVEX_0F3A77): Ditto.
	(OP_VEX): Pull out all GPR mode out of the vector length switch.
	* i386-gen.c (isa_dependencies): Add AMX-AVX512.
	(cpu_flags): Ditto.
	* i386-init.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-opc.h (CpuAMX_AVX512): New.
	(i386_cpu_flags): Add cpuamx_avx512.
	* i386-opc.tbl: Add AMX-AVX512 instructions.
	* i386-tbl.h: Regenerated.
2025-01-14 10:30:40 +08:00
Hu, Lin1
b7267244a3 Support Intel AMX-MOVRS
This patch will support AMX-MOVRS feature. Unlike all the other
AMX insns in vector space where we pass vex_len_table before
vex_w_table, we first pass vex_w_table for tileloaddrs[,t1] to
align with the order in EVEX space. The reason why we first pass
vex_w_table in EVEX space is due to AMX-AVX512, where tcvtrowd2ps
and tilemovrow with r32 shares the same opcode with tileloaddrs[,t1].
All of them have evex.w = 0 but with different evex.length. Re-doing
that shortly is not ideal.

APX_F extension is also implemented in this patch. The encoding will
be:
  - EVEX.128.NP/66.MAP5.W0 F8/F9 !(11):rrr:100 for
    T2RPNTLVW[Z0,Z1]RS[,T1] with NF=0.
  - EVEX.128.F2/66.0F38.W0 4A !(11):rrr:100 FOR TILELOADDRS[,T1] with
    NF=0.

For APX_F extension, we could not use APX_F(AMX_TRANSPOSE&AMX_MOVRS)
since the transformation could not be done. Instead, we will use
AMX_TRANSPOSE & APX_F(AMX_MOVRS). Thus, we should set AMX_TRANSPOSE
for "any" for cpu_flags in assembler. Since it will only affect the
cpu_flags_match, handle that there.

gas/ChangeLog:

	* config/tc-i386.c (cpu_arch): Add amx_movrs.
	(cpu_flags_match): Set any bitfield for multiple cpuid
	enabled insns.
	* doc/c-i386.texi: Document .amx_movrs.
	* testsuite/gas/i386/x86-64.exp: Run AMX-MOVRS tests.
	* testsuite/gas/i386/x86-64-amx-movrs-intel.d: New test.
	* testsuite/gas/i386/x86-64-amx-movrs-inval.l: Ditto.
	* testsuite/gas/i386/x86-64-amx-movrs-inval.s: Ditto.
	* testsuite/gas/i386/x86-64-amx-movrs.d: Ditto.
	* testsuite/gas/i386/x86-64-amx-movrs.s: Ditto.

opcodes/ChangeLog:

	* i386-dis-evex-len.h (EVEX_LEN_0F384A_X86_64_W_0): New.
	* i386-dis-evex-w.h (EVEX_W_0F384A_X86_64): Ditto.
	* i386-dis-evex-x86-64.h (X86_64_EVEX_0F384A): Ditto.
	* i386-dis-evex.h: New entry for AMX-MOVRS.
	* i386-dis.c:
	(PREFIX_VEX_0F384A_X86_64_L_0_W_0): New.
	(PREFIX_VEX_MAP5_F8_X86_64_L_0_W_0): Ditto.
	(PREFIX_VEX_MAP5_F9_X86_64_L_0_W_0): Ditto.
	(X86_64_VEX_0F384A): Ditto.
	(X86_64_VEX_MAP5_F8): Ditto.
	(X86_64_VEX_MAP5_F9): Ditto.
	(X86_64_EVEX_0F384A): Ditto.
	(VEX_LEN_0F384A_X86_64_W_0): Ditto.
	(VEX_LEN_MAP5_F8_X86_64): Ditto.
	(VEX_LEN_MAP5_F9_X86_64): Ditto.
	(EVEX_LEN_0F384A_X86_64_W_0): Ditto.
	(VEX_W_0F384A_X86_64): Ditto.
	(VEX_W_MAP5_F8_X86_64): Ditto.
	(VEX_W_MAP5_F9_X86_64): Ditto.
	(EVEX_W_0F384A_X86_64): Ditto.
	(prefix_table): New entry for AMX-MOVRS.
	(x86_64_table): Ditto.
	(vex_len_table): Ditto.
	(vex_w_table): Ditto.
	(map5_f8_opcode): New.
	(map5_f9_opcode): Ditto.
	(get_valid_dis386): Handle VEX_MAP5 opcode for AMX-MOVRS.
	* i386-gen.c (isa_dependencies): Add AMX_MOVRS.
	(cpu_flags): Ditto.
	* i386-init.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-opc.h (CpuAMX_MOVRS): New.
	(i386_cpu_flags): Add cpuamx_movrs.
	* i386-opc.tbl: Add AMX-MOVRS instructions.
	* i386-tbl.h: Regenerated.

Co-authored-by: Haochen Jiang <haochen.jiang@intel.com>
2025-01-14 10:30:38 +08:00
Hu, Lin1
b41ab42df1 Support Intel MOVRS
This patch focus on supporting MOVRS ISA. We could take this full ISA
as four part: PREFETCHRST2, MOVRS, MOVRS APX_F extension and MOVRS AVX10.2
extension.

The APX_F extension for MOVRS will be:
  - EVEX.LLZ.NP.MAP4.WIG 8A !(11):rrr:bbb for r8/m8 with NF=0 and
    ND=0
  - EVEX.LLZ.NP/66.MAP4.SCALABLE 8B !(11):rrr:bbb for rv/mv with NF=0
    and ND=0

We did not merge the table together for APX_F since there is an explicit
x64 for movrs insn. The current APX_F() did not support the combination
between CPUIDs. Also, the space is different for legacy and apx_f forms.

gas/ChangeLog:

	* NEWS: Support Intel MOVRS.
	* config/tc-i386.c: Add MOVRS.
	* doc/c-i386.texi: Document .movrs.
	* testsuite/gas/i386/i386.exp: Run MOVRS tests.
	* testsuite/gas/i386/x86-64.exp: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d: Add MOVRS
	tests.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-wig.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted.s: Ditto.
	* testsuite/gas/i386/lfence-load.d: Add prefetchrst2.
	* testsuite/gas/i386/lfence-load.s: Ditto.
	* testsuite/gas/i386/nops-8.d: Ditto.
	* testsuite/gas/i386/prefetch-intel.d: Ditto.
	* testsuite/gas/i386/prefetch.d: Ditto.
	* testsuite/gas/i386/x86-64-lfence-load.d: Ditto.
	* testsuite/gas/i386/x86-64-lfence-load.s: Ditto.
	* testsuite/gas/i386/x86-64-prefetch-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-prefetch.d: Ditto.
	* testsuite/gas/i386/movrs-intel.d: New test.
	* testsuite/gas/i386/movrs-inval.l: Ditto.
	* testsuite/gas/i386/movrs-inval.s: Ditto.
	* testsuite/gas/i386/movrs.d: Ditto.
	* testsuite/gas/i386/movrs.s: Ditto.
	* testsuite/gas/i386/x86-64-movrs-avx10_2-256-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-movrs-avx10_2-256.d: Ditto.
	* testsuite/gas/i386/x86-64-movrs-avx10_2-256.s: Ditto.
	* testsuite/gas/i386/x86-64-movrs-avx10_2-512-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-movrs-avx10_2-512.d: Ditto.
	* testsuite/gas/i386/x86-64-movrs-avx10_2-512.s: Ditto.
	* testsuite/gas/i386/x86-64-movrs-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-movrs.d: Ditto.
	* testsuite/gas/i386/x86-64-movrs.s: Ditto.
	* testsuite/gas/i386/x86-64-movrs-intel-suffix.d: Ditto.
	* testsuite/gas/i386/x86-64-movrs-suffix.d: Ditto.
	* testsuite/gas/i386/x86-64-movrs-suffix.s: Ditto.

opcodes/ChangeLog:

	* i386-dis-evex-prefix.h: Add PREFIX_EVEX_MAP5_6F_X86_64.
	* i386-dis-evex-x86.h: Add X86_64_EVEX_MAP5_6F.
	* i386-dis-evex.h (evex_table): New entry for movrs.
	* i386-dis.c (MOD_0F18_REG_4): New.
	(PREFIX_EVEX_MAP5_6F_X86_64): Ditto.
	(X86_64_0F388A): Ditto.
	(X86_64_0F388B): Ditto.
	(X86_64_EVEX_MAP5_6F): Ditto.
	(three_byte_table): New entry for MOVRS.
	(reg_table): Ditto.
	(mod_table): Ditto.
	(x86_64_table): Ditto. Also include i386-dis-evex-x86.h.
	* i386-gen.c (cpu_flags): Add MOVRS.
	* i386-init.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-opc.h (i386_cpu_flags): Add cpumovrs.
	* i386-opc.tbl: Add MOVRS instrctions.
	* i386-tbl.h: Regenerated.

Co-authored-by: Haochen Jiang <haochen.jiang@intel.com>
Co-authored-by: Lili Cui <lili.cui@intel.com>
2025-01-14 10:30:36 +08:00
Haochen Jiang
9421775ba4 x86: Remove mod_table pass for MVexSIBMEM
When using MVexSIBMEM, OP_M will help check modrm. Thus, no need
to pass mod_table.

Since we have OP_M do the work, from now on, mod_table[] should
not gain any new entries, unless both slots of them are populated,
e.g., different modrm leading to different insns could not be
combined (Bad_Opcode is not the case since OP_M could handle that).

opcodes/ChangeLog:

	* i386-dis.c: Remove mod_table pass for MVexSIBMEM.
2025-01-14 10:30:32 +08:00
MayShao-oc
69007bf141 x86: Support x86 Zhaoxin PadLockRNG2 instruction
This patch adds support for Zhaoxin PadLock RNG2 instruction, the
CPUID EDX bit[23] indicates its enablement, it includes REP XRNG2
instruction.

gas/ChangeLog:

	* NEWS: Support Zhaoxin PadLock RNG2 instruction.
	* config/tc-i386.c (add_branch_prefix_frag_p): Don't add prefix to
	PadLock RNG2 instruction.
	(output_insn): Handle PadLock RNG2 instruction.
	* doc/c-i386.texi: Document PadLock RNG2.
	* testsuite/gas/i386/i386.exp: Add PadLock RNG2 test.
	* testsuite/gas/i386/padlock_rng2.d: Ditto.
	* testsuite/gas/i386/padlock_rng2.s: Ditto.

opcodes/ChangeLog:

	* i386-dis.c: Add PadLockRNG2.
	* i386-gen.c: Ditto
	* i386-opc.h (CpuPadLockRNG2): New.
	* i386-opc.tbl: Add Zhaoxin PadLock RNG2 instruction.
	* i386-tbl.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-init.h: Ditto.
2025-01-10 08:44:22 +01:00
Liwei Xu
8791ea5e49 Support Intel AMX-FP8
In this patch, we will support AMX-FP8 feature. Since in the
foreseeable future, only AMX-MOVRS will also use VEX_MAP5, we
currently will not add a table of 256 entries and handle just
like MAP7.

gas/ChangeLog:

	* config/tc-i386.c: Add amx_fp8.
	* doc/c-i386.texi: Document .amx_fp8.
	* testsuite/gas/i386/x86-64.exp: Run AMX-FP8 tests.
	* testsuite/gas/i386/x86-64-amx-fp8-bad.d: New test.
	* testsuite/gas/i386/x86-64-amx-fp8-bad.s: Ditto.
	* testsuite/gas/i386/x86-64-amx-fp8-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-amx-fp8-inval.l: Ditto.
	* testsuite/gas/i386/x86-64-amx-fp8-inval.s: Ditto.
	* testsuite/gas/i386/x86-64-amx-fp8.d: Ditto.
	* testsuite/gas/i386/x86-64-amx-fp8.s: Ditto.

opcodes/ChangeLog:

	* i386-dis.c (PREFIX_VEX_MAP5_FD_X86_64_L_0_W_0): New.
	(X86_64_VEX_MAP5_FD): Ditto.
	(VEX_LEN_MAP5_FD_X86_64): Ditto.
	(VEX_W_MAP5_FD_X86_64_L_0):Ditto.
	(prefix_table): Add PREFIX_VEX_MAP5_FD_X86_64_L_0_W_0.
	(x86_64_table): Add X86_64_VEX_MAP5_FD.
	(vex_len_table): Add VEX_LEN_MAP5_FD_X86_64.
	(vex_w_table): Add VEX_W_MAP5_FD_X86_64_L_0.
	* i386-gen.c: Add CPU_AMX_FP8_FLAGS and
	CPU_ANY_AMX_FP8_FLAGS.
	* i386-init.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-opc.h: Add cpuamx_fp8.
	* i386-opc.tbl: Add AMX_FP8 instructions.
	* i386-tbl.h: Regenerated.

Co-authored-by: Haochen Jiang <haochen.jiang@intel.com>
2025-01-08 11:39:59 +08:00
Haochen Jiang
434deed44d Support Intel AMX-TF32
In this patch, we will support AMX-TF32. It is a simple ISA
comparing to the previous ones, so there is no special handling.

gas/ChangeLog:

	* config/tc-i386.c: Add amx_tf32.
	* doc/c-i386.texi: Document .amx_tf32.
	* testsuite/gas/i386/x86-64.exp: Run AMX-TF32 tests.
	* testsuite/gas/i386/x86-64-amx-tf32-bad.d: New test.
	* testsuite/gas/i386/x86-64-amx-tf32-bad.s: Ditto.
	* testsuite/gas/i386/x86-64-amx-tf32-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-amx-tf32-inval.l: Ditto.
	* testsuite/gas/i386/x86-64-amx-tf32-inval.s: Ditto.
	* testsuite/gas/i386/x86-64-amx-tf32.d: Ditto.
	* testsuite/gas/i386/x86-64-amx-tf32.s: Ditto.

opcodes/ChangeLog:

	* i386-dis.c (PREFIX_VEX_0F3848_X86_64_W_0_L_0): New.
	(X86_64_VEX_0F3848): Ditto.
	(VEX_LEN_0F3848_X86_64_W_0): Ditto.
	(VEX_W_0F3848_X86_64): Ditto.
	(prefix_table): Add PREFIX_VEX_0F3848_X86_64_W_0_L_0.
	(x86_64_table): Add X86_64_VEX_0F3848.
	(vex_len_table): Add VEX_LEN_0F3848_X86_64_W_0.
	(vex_w_table): Add VEX_W_0F3848_X86_64.
	* i386-gen.c (isa_dependencies): Add AMX_TF32.
	(cpu_flags): Ditto.
	* i386-init.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-opc.h (CpuAMX_TF32): New.
	(i386_cpu_flags): Add cpuamx_tf32.
	* i386-opc.tbl: Add AMX-TF32 instructions.
	* i386-tbl.h: Regenerated.
2025-01-02 10:17:39 +08:00
Haochen Jiang
1fa0873f1d Support Intel AMX-TRANSPOSE
In this patch, we will support AMX-TRANSPOSE. Since AMX-TRANSPOSE
will be used with other CPUIDs very often, we put it into
CPU_FLAGS_COMMON.

To implement TMM pair, we reused ImplicitGroup and adjust the condition
in process_operands for the instructions.

APX_F extension is also handled in this patch, where it extends
T2RPNTLVW[Z0,Z1][,T1] to EVEX.128.NP/66.0F38.W0 6E/6F !(11):rrr:100
with NF=0.

Also, TTDPFP16PS should base on AMX_FP16, not AMX_BF16 in ISE055.
It would be fixed in ISE056.

gas/ChangeLog:

	* config/tc-i386.c (cpu_arch): Add amx_transpose.
	(_is_cpu): Ditto.
	(process_operands): Adjust the condition for AMX-TRANSPOSE.
	* doc/c-i386.texi: Document .amx_transpose.
	* testsuite/gas/i386/x86-64.exp: Run AMX-TRANSPOSE tests.
	* testsuite/gas/i386/x86-64-amx-transpose-bad.d: New test.
	* testsuite/gas/i386/x86-64-amx-transpose-bad.s: Ditto.
	* testsuite/gas/i386/x86-64-amx-transpose-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-amx-transpose-inval.l: Ditto.
	* testsuite/gas/i386/x86-64-amx-transpose-inval.s: Ditto.
	* testsuite/gas/i386/x86-64-amx-transpose.d: Ditto.
	* testsuite/gas/i386/x86-64-amx-transpose.s: Ditto.

opcodes/ChangeLog:

	* i386-dis.c (MOD_VEX_0F386E_X86_64_W_0): New.
	(MOD_VEX_0F386F_X86_64_W_0): Ditto.
	(PREFIX_VEX_0F385F_X86_64_W_0_L_0): Ditto.
	(PREFIX_VEX_0F386B_X86_64_W_0_L_0): Ditto.
	(PREFIX_VEX_0F386E_X86_64_W_0_M_0_L_0): Ditto.
	(PREFIX_VEX_0F386F_X86_64_W_0_M_0_L_0): Ditto.
	(X86_64_VEX_0F385F): Ditto.
	(X86_64_VEX_0F386B): Ditto.
	(X86_64_VEX_0F386E): Ditto.
	(X86_64_VEX_0F386F): Ditto.
	(VEX_LEN_0F385F_X86_64_W_0): Ditto.
	(VEX_LEN_0F386B_X86_64_W_0): Ditto.
	(VEX_LEN_0F386E_X86_64_W_0_M_0): Ditto.
	(VEX_LEN_0F386F_X86_64_W_0_M_0): Ditto.
	(VEX_W_0F385F_X86_64): Ditto.
	(VEX_W_0F386B_X86_64): Ditto.
	(VEX_W_0F386E_X86_64): Ditto.
	(VEX_W_0F386F_X86_64): Ditto.
	(mod_table): Add MOD_VEX_0F386E_X86_64_W_0,
	MOD_VEX_0F386F_X86_64_W_0.
	(prefix_table): Add PREFIX_VEX_0F386E_X86_64_W_0_M_0_L_0,
	PREFIX_VEX_0F386F_X86_64_W_0_M_0_L_0.
	Add new instructions for PREFIX_VEX_0F386C_X86_64_W_0_L_0.
	(x86_64_table): Add X86_64_VEX_0F385F, X86_64_VEX_0F386B,
	X86_64_VEX_0F386E, X86_64_VEX_0F386F.
	(vex_len_table): Add VEX_LEN_0F385F_X86_64_W_0,
	VEX_LEN_0F386B_X86_64_W_0, VEX_LEN_0F386E_X86_64_W_0_M_0,
	VEX_LEN_0F386F_X86_64_W_0_M_0.
	(vex_w_table): Add VEX_W_0F385F_X86_64, VEX_W_0F386B_X86_64,
	VEX_W_0F386E_X86_64, VEX_W_0F386F_X86_64.
	* i386-gen.c (cpu_flag_init): Add AMX_TRANSPOSE.
	(cpu_flags): Add CpuAMX_TRANSPOSE.
	* i386-init.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-opc.h (CpuAMX_TRANSPOSE): New.
	(i386_cpu): Add cpuamx_transpose.
	* i386-opc.tbl: Add AMX-TRANSPOSE instructions.
	* i386-tbl.h: Regenerated.

Co-authored-by: Hu, Lin1 <lin1.hu@intel.com>
2025-01-02 10:14:37 +08:00
Alan Modra
e8e7cf2abe Update year range in copyright notice of binutils files 2025-01-01 18:29:57 +10:30
Haochen Jiang
b6324bbd83 Support Intel AVX10.2 minmax, vector copy and compare instructions
In this patch, we will support AVX10.2 minmax, vector copy and compare
instructions. This will finish the new instruction form support for
AVX10.2. Most of them are new instructions forms except for vmovd
and vmovw, which are extended usage from the old ones.

gas/ChangeLog:

	* NEWS: Mention AVX10.2.
	* testsuite/gas/i386/i386.exp: Add AVX10.2 tests.
	* testsuite/gas/i386/x86-64.exp: Ditto.
	* testsuite/gas/i386/avx10_2-256-5-intel.d: New test.
	* testsuite/gas/i386/avx10_2-256-miscs.d: Ditto.
	* testsuite/gas/i386/avx10_2-256-miscs.s: Ditto.
	* testsuite/gas/i386/avx10_2-512-miscs-intel.d: Ditto.
	* testsuite/gas/i386/avx10_2-512-miscs.d: Ditto.
	* testsuite/gas/i386/avx10_2-512-miscs.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-miscs-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-miscs.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-miscs.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-miscs-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-miscs.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-miscs.s: Ditto.

opcodes/ChangeLog:

	* i386-dis-evex-len.h: Add EVEX_LEN_0F7E_P_1_W_1,
	EVEX_LEN_0FD6_P_2_W_0, EVEX_LEN_MAP5_6E and EVEX_LEN_MAP5_7E.
	* i386-dis-evex-prefix.h: Add PREFIX_EVEX_0F2E, PREFIX_EVEX_0F2F,
	PREFIX_EVEX_0F3A52, PREFIX_EVEX_0F3A53, PREFIX_EVEX_MAP5_2E,
	PREFIX_EVEX_MAP5_2F, PREFIX_EVEX_MAP5_6E and PREFIX_EVEX_MAP5_7E.
	* i386-dis-evex-w.h: Adjust EVEX_W_0F3A42, EVEX_W_0F7E_P_1
	and EVEX_W_0FD6. Add EVEX_W_MAP5_6E_P_1 and EVEX_W_MAP5_7E_P_1.
	* i386-dis-evex.h: Add and adjust table entries for AVX10.2.
	* i386-dis.c (PREFIX_EVEX_0F2E): New.
	(PREFIX_EVEX_0F2F): Ditto.
	(PREFIX_EVEX_0F3A52): Ditto.
	(PREFIX_EVEX_0F3A53): Ditto.
	(PREFIX_EVEX_MAP5_2E): Ditto.
	(PREFIX_EVEX_MAP5_2F): Ditto.
	(PREFIX_EVEX_MAP5_6E_L_0): Ditto.
	(PREFIX_EVEX_MAP5_7E_L_0): Ditto.
	(EVEX_LEN_0F7E_P_1_W_1): Ditto.
	(EVEX_LEN_0FD6_P_2_W_0): Ditto.
	(EVEX_LEN_MAP5_6E): Ditto.
	(EVEX_LEN_MAP5_7E): Ditto.
	(EVEX_W_MAP5_6E_P_1): Ditto.
	(EVEX_W_MAP5_7E_P_1): Ditto.
	* i386-opc.tbl: Add AVX10.2 instructions.
	* i386-mnem.h: Regenerated.
	* i386-tbl.h: Ditto.

Co-authored-by: Jun Zhang <jun.zhang@intel.com>
Co-authored-by: Zewei Mo <zewei.mo@intel.com>
2024-12-23 11:32:03 +08:00
Haochen Jiang
704452b488 Support Intel SM4 AVX10.2 extension
In this patch, we will support SM4 AVX10.2 extension part. It is
a promotion from VEX encoding to EVEX encoding. The EVEX encoding
is based on AVX10.2, which is the same as the upcoming MOVRS ISA.
Thus, we decide to pull AVX10.2 out to CPU_COMMON_FLAGS.

While I have also tried to merge the table like AVX/AVX512, I
choose to just templatize the table. I am okay to go either way,
but slightly prefer the templatizing one since probably SM4 would
be the only ISA with AVX10.2 needs such VEX to EVEX extension (MOVRS
does not need that). Also, it is a tendancy that we will directly
provide EVEX encodings and no VEX encodings for vector instructions
since AVX10. This will make the adding in gas/config/tc-i386.c not
that worthy.

gas/ChangeLog:

	* NEWS: Support Intel SM4 EVEX instructions.
	* config/tc-i386.c (_is_cpu): Handle AVX10.2.
	* testsuite/gas/i386/i386.exp: Run SM4 tests.
	* testsuite/gas/i386/x86-64.exp: Ditto.
	* testsuite/gas/i386/avx10_2-256-sm4-intel.d: Add SM4 tests.
	* testsuite/gas/i386/avx10_2-256-sm4.d: Ditto.
	* testsuite/gas/i386/avx10_2-256-sm4.s: Ditto.
	* testsuite/gas/i386/avx10_2-512-sm4-intel.d: Ditto.
	* testsuite/gas/i386/avx10_2-512-sm4.d: Ditto.
	* testsuite/gas/i386/avx10_2-512-sm4.s: Ditto.
	* testsuite/gas/i386/avx10_2-sm4-inval.l: Ditto.
	* testsuite/gas/i386/avx10_2-sm4-inval.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-sm4-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-sm4.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-sm4.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-sm4-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-sm4.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-sm4.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-sm4-inval.l: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-sm4-inval.s: Ditto.

opcodes/ChangeLog:

	* i386-dis-evex.h: Add evex table entry for SM4.
	* i386-dis.h: Ditto.
	* i386-opc.h: (i386_cpu): Move AVX10.2 to CPU_FLAGS_COMMON.
	* i386-opc.tbl: Add SM4 EVEX instructions.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Ditto.
2024-12-18 10:40:33 +08:00
Hu, Lin1
38b2f5b99b Support Intel AVX10.2 satcvt instructions
In this patch, we will support AVX10.2 satcvt instructions. All of them
are new instruction forms. In current documentation, it is still
VCVTTNEBF162I[,U]BS, but it will change to VCVTTBF162I[,U]BS eventually.

In table part, we used temporary <sign> iterator to reduce redundancy.
It definitely could be done for legacy cvt insns, but it is out of this
patch's scope.

gas/ChangeLog:

	* testsuite/gas/i386/i386.exp: Add AVX10.2 tests.
	* testsuite/gas/i386/x86-64.exp: Ditto.
	* testsuite/gas/i386/avx10_2-512-satcvt-intel.d: New test.
	* testsuite/gas/i386/avx10_2-512-satcvt.d: Ditto.
	* testsuite/gas/i386/avx10_2-512-satcvt.s: Ditto.
	* testsuite/gas/i386/avx10_2-256-satcvt-intel.d: Ditto.
	* testsuite/gas/i386/avx10_2-256-satcvt.d: Ditto.
	* testsuite/gas/i386/avx10_2-256-satcvt.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-satcvt-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-satcvt.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-satcvt.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-satcvt-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-satcvt.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-satcvt.s: Ditto.

opcodes/ChangeLog:

	* i386-dis-evex-prefix.h: Add PREFIX_EVEX_MAP5_68, PREFIX_EVEX_MAP5_69,
	PREFIX_EVEX_MAP5_6A, PREFIX_EVEX_MAP5_6B, PREFIX_EVEX_MAP5_6C,
	PREFIX_EVEX_MAP5_6D.
	* i386-dis-evex-w.h: Add EVEX_W_MAP5_6C_P_0, EVEX_W_MAP5_6C_P_2,
	EVEX_W_MAP5_6D_P_0, EVEX_W_MAP5_6D_P_2.
	* i386-dis-evex.h (prefix_table): Add PREFIX_EVEX_MAP5_68,
	* PREFIX_EVEX_MAP5_69, PREFIX_EVEX_MAP5_6A, PREFIX_EVEX_MAP5_6B.
	* i386-dis.c: (PREFIX_EVEX_MAP5_68): New.
	(PREFIX_EVEX_MAP5_69): Ditto.
	(PREFIX_EVEX_MAP5_6A): Ditto.
	(PREFIX_EVEX_MAP5_6B): Ditto.
	(PREFIX_EVEX_MAP5_6C): Ditto.
	(PREFIX_EVEX_MAP5_6D): Ditto.
	(EVEX_MAP5_6C_P_0): Ditto.
	(EVEX_MAP5_6C_P_2): Ditto.
	(EVEX_MAP5_6D_P_0): Ditto.
	(EVEX_MAP5_6D_P_2): Ditto.
	* i386-opc.tbl: Add AVX10.2 instructions.
	* i386-mnem.h: Regenerated.
	* i386-tbl.h: Ditto.

Co-authored-by: Zewei Mo <zewei.mo@intel.com>
Co-authored-by: Haochen Jiang <haochen.jiang@intel.com>
Co-authored-by: Levy Hsu <admin@levyhsu.com>
2024-12-05 14:49:27 +08:00
H.J. Lu
4c0a6e6037 x86: Eliminate unnecessary {evex} prefixes
For several instructions including vps{l,r}l{d,q,w,dq} and vpsra{d,w},
their VEX part do not have the following version:

	vpsrlw $0x1f,(%r15,%rcx,4),%xmm0

Thus, {evex} prefix should not be inserted when their second operand is
memory, while we still need them for register as second operand. Add a
new macro %ME to solve this problem.

For vpsraq, there is no VEX version, so the {evex} prefix should always
be eliminated.

gas/ChangeLog:

	PR binutils/32403
	* testsuite/gas/i386/i386.exp: Run new test.
	* testsuite/gas/i386/x86-64.exp: Ditto.
	* testsuite/gas/i386/evex-only.d: New test.
	* testsuite/gas/i386/evex-only.s: Ditto.
	* testsuite/gas/i386/x86-64-evex-only.d: Ditto.
	* testsuite/gas/i386/x86-64-evex-only.s: Ditto.

opcodes/ChangeLog:

	PR binutils/32403
	* i386-dis-evex-reg.h: Use %ME instead of %XE for vps{l,r}l{w,dq}
	and vpsraw. Split table for vpsra{d,q}.
	* i386-dis-evex-w.h: Use %ME instead of %XE for vps{l,r}l{d,q}
	and vpsrad. Eliminate vpsraq {evex} prefix.
	* i386-dis-evex.h: Split table for vpsra{d,q}.
	* i386-dis.c: (EVEX_W_0F72_R_4): New.
	(EVEX_W_0FE2): Ditto.
	(struct dis386): Add comment for %ME.
	(putop): Handle %ME.

Co-authored-by: Haochen Jiang <haochen.jiang@intel.com>
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-05 09:57:59 +08:00
Kong Lingling
98439a80cc Support Intel AVX10.2 BF16 instructions
In this patch, we will support AVX10.2 BF16 instructions. All of them
are new instructions forms. In current documentation, it is still
VSCALEFPBF16, but it will change to VSCALEFNEPBF16 eventually.

In disassembler part, we added %XB to reduce W table pass since all
of them get evex.w=0.

gas/Changelog:

	* testsuite/gas/i386/i386.exp: Add AVX10.2 tests.
	* testsuite/gas/i386/x86-64.exp: Ditto.
	* testsuite/gas/i386/avx10_2-256-bf16-intel.d: New.
	* testsuite/gas/i386/avx10_2-256-bf16.d: Ditto.
	* testsuite/gas/i386/avx10_2-256-bf16.s: Ditto.
	* testsuite/gas/i386/avx10_2-512-bf16-intel.d: Ditto.
	* testsuite/gas/i386/avx10_2-512-bf16.d: Ditto.
	* testsuite/gas/i386/avx10_2-512-bf16.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-bf16-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-bf16.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-bf16.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-bf16-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-bf16.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-bf16.s: Ditto.

opcodes/

	* i386-dis-evex-prefix.h: Update PREFIX_EVEX_0F3A08, PREFIX_EVEX_0F3A26,
	PREFIX_EVEX_0F3A56, PREFIX_EVEX_0F3A66, PREFIX_EVEX_0F3AC2,
	PREFIX_EVEX_MAP5_2F, PREFIX_EVEX_MAP5_51, PREFIX_EVEX_MAP5_58,
	PREFIX_EVEX_MAP5_59, PREFIX_EVEX_MAP5_5C, PREFIX_EVEX_MAP5_5D,
	PREFIX_EVEX_MAP5_5E, PREFIX_EVEX_MAP5_5F.
	Add PREFIX_EVEX_MAP6_2C, PREFIX_EVEX_MAP6_4C, PREFIX_EVEX_MAP6_4E,
	PREFIX_EVEX_MAP6_98, PREFIX_EVEX_MAP6_9A, PREFIX_EVEX_MAP6_9C,
	PREFIX_EVEX_MAP6_9E, PREFIX_EVEX_MAP6_A8, PREFIX_EVEX_MAP6_AA,
	PREFIX_EVEX_MAP6_AC, PREFIX_EVEX_MAP6_AE, PREFIX_EVEX_MAP6_B8,
	PREFIX_EVEX_MAP6_BA, PREFIX_EVEX_MAP6_BC, PREFIX_EVEX_MAP6_BE.
	* i386-dis-evex.h (evex_table): Update PREFIX_EVEX_MAP6_2C,
	PREFIX_EVEX_MAP6_42, PREFIX_EVEX_MAP6_4C, PREFIX_EVEX_MAP6_4E,
	PREFIX_EVEX_MAP6_98, PREFIX_EVEX_MAP6_9A, PREFIX_EVEX_MAP6_9C,
	PREFIX_EVEX_MAP6_9E, PREFIX_EVEX_MAP6_A8, PREFIX_EVEX_MAP6_AA,
	PREFIX_EVEX_MAP6_AC, PREFIX_EVEX_MAP6_AE, PREFIX_EVEX_MAP6_B8,
	PREFIX_EVEX_MAP6_BA, PREFIX_EVEX_MAP6_BC, PREFIX_EVEX_MAP6_BE.
	* i386-dis.c (PREFIX_EVEX_MAP6_2C): New enum.
	(PREFIX_EVEX_MAP6_42): Ditto.
	(PREFIX_EVEX_MAP6_4C): Ditto.
	(PREFIX_EVEX_MAP6_4E): Ditto.
	(PREFIX_EVEX_MAP6_98): Ditto.
	(PREFIX_EVEX_MAP6_9A): Ditto.
	(PREFIX_EVEX_MAP6_9C): Ditto.
	(PREFIX_EVEX_MAP6_9E): Ditto.
	(PREFIX_EVEX_MAP6_A8): Ditto.
	(PREFIX_EVEX_MAP6_AA): Ditto.
	(PREFIX_EVEX_MAP6_AC): Ditto.
	(PREFIX_EVEX_MAP6_AE): Ditto.
	(PREFIX_EVEX_MAP6_B8): Ditto.
	(PREFIX_EVEX_MAP6_BA): Ditto.
	(PREFIX_EVEX_MAP6_BC): Ditto.
	(PREFIX_EVEX_MAP6_BE): Ditto.
	(putop): Handle %XB.
	* i386-opc.tbl: Add AVX10.2 instructions.
	* i386-mnem.h: Regenerated.
	* i386-tbl.h: Ditto.

Co-authored-by: Haochen Jiang <haochen.jiang@intel.com>
2024-12-03 15:34:05 +08:00
Hu, Lin1
d7d71afa6a Support x86 Intel MSR_IMM
gas/ChangeLog:

	* NEWS: Support x86 Intel MSR_IMM.
	* config/tc-i386.c (cpu_arch): Add MSR_IMM.
	(cpu_flags_match): Add MSR_IMM to APX_F related processing.
	(i386_assemble): WRMSRNS's first operand is imm32, so add
	MN_wrmsrns like MN_uwrmsr.
	* doc/c-i386.texi: Document .msr_imm.
	* testsuite/gas/i386/i386.exp: Run MSR_IMM tests.
	* testsuite/gas/i386/x86-64.exp: Ditto.
	* testsuite/gas/i386/msr_imm-inval.l: New test.
	* testsuite/gas/i386/msr_imm-inval.s: Ditto.
	* testsuite/gas/i386/x86-64-msr_imm-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-msr_imm.d: Ditto.
	* testsuite/gas/i386/x86-64-msr_imm.s: Ditto.

opcodes/ChangeLog:

	* i386-dis.c: Add REG_VEX_MAP7_F6_L_0_W_0,
	PREFIX_VEX_MAP7_F6_L_0_W_0_R_0_X86_64,
	X86_64_VEX_MAP7_F6_L_0_W_0_R_0,
	VEX_LEN_MAP7_F6,
	VEX_W_MAP7_F6_L_0.
	(reg_table): New entry for MSR_IMM.
	(prefix_table): Ditto.
	(x86_64_table): Ditto.
	(vex_len_table): Ditto.
	(vex_w_table): Ditto.
	(map7_f6_opcode): New variable for MAP7.
	(get_valid_dis386): Support MAP7.
	* i386-gen.c (cpu_flags): Add MSR_IMM.
	* i386-init.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-opc.h (i386_cpu_flags): Add cpumsr_imm.
	* i386-opc.tbl: Add MSR_IMM instructions.
	* i386-tbl.h: Regenerated.
2024-11-19 10:45:56 +08:00
MayShao-oc
8f0d880434 x86: Support x86 ZHAOXIN GMI instructions
gas/ChangeLog:

	* NEWS: Support ZHAOXIN GMI instructions.
	* config/tc-i386.c: Add gmi.
	* doc/c-i386.texi: Document gmi.
	* testsuite/gas/i386/i386.exp: Add gmi test.
	* testsuite/gas/i386/gmi.d: Ditto.
	* testsuite/gas/i386/gmi.s: Ditto.

opcodes/ChangeLog:

	* i386-dis.c: New comment.
	* i386-gen.c: Add gmi.
	* i386-opc.h (CpuGMI): New.
	* i386-opc.tbl: Add Zhaoxin GMI instructions.
	* i386-tbl.h: Regenerated.
	* i386-mnem.h: Ditto.
	* i386-init.h: Ditto.
2024-10-18 15:45:11 +08:00
Liwei Xu
3bac89e65f Support Intel AVX10.2 convert instructions
In this patch, we will support AVX10.2 convert instructions. All
of them are new instruction forms.

Among all the instructions, vcvtbiasph2[b,h]f8[,s] needs extra care.
Since Operand 2 could indicate memory size, we do not need suffix
under ATTmode. However, we could not fold all three templates but only
XMM/YMM since the dst operand size are the same for them. Also, a new
iterator <cvt8> is added to reduce redundancy.

gas/
	* testsuite/gas/i386/i386.exp: Add AVX10.2 tests.
	* testsuite/gas/i386/x86-64.exp: Ditto.
	* testsuite/gas/i386/avx10_2-256-cvt-intel.d: New.
	* testsuite/gas/i386/avx10_2-256-cvt.d: Ditto.
	* testsuite/gas/i386/avx10_2-256-cvt.s: Ditto.
	* testsuite/gas/i386/avx10_2-512-cvt-intel.d: Ditto.
	* testsuite/gas/i386/avx10_2-512-cvt.d: Ditto.
	* testsuite/gas/i386/avx10_2-512-cvt.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-cvt-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-cvt.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-256-cvt.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-cvt-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-cvt.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-512-cvt.s: Ditto.

opcodes/
	* i386-dis-evex-prefix.h: Add PREFIX_EVEX_0F3874,
	PREFIX_EVEX_MAP5_18, PREFIX_EVEX_MAP5_1B,
	PREFIX_EVEX_MAP5_1E and PREFIX_EVEX_MAP5_74.
	* i386-dis-evex.h: Add table pass for AVX10.2
	instructions.
	* i386-dis.c (MOD_EVEX_0F38B1): New.
	(PREFIX_EVEX_0F3874): Ditto.
	(PREFIX_EVEX_MAP5_18): Ditto.
	(PREFIX_EVEX_MAP5_1B): Ditto.
	(PREFIX_EVEX_MAP5_1E): Ditto.
	(PREFIX_EVEX_MAP5_74): Ditto.
	* i386-opc.tbl: Add AVX10.2 instructions.
	* i386-mnem.h: Regenerated.
	* i386-tbl.h: Ditto.

Co-authored-by: Kong Lingling <lingling.kong@intel.com>
Co-authored-by: Haochen Jiang <haochen.jiang@intel.com>
2024-10-16 10:25:35 +08:00
Haochen Jiang
873e7b6cf6 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 <vnni>, which prefers EVEX due to earlier introduction
for AVX512_VNNI than AVX_VNNI. This means a new <vnni>. 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 <lili.cui@intel.com>
2024-10-11 10:38:27 +08:00
Jan Beulich
6170a088a6 x86/APX: correct disassembly for EVEX.B4
EVEX.B4 is used only for GPR (or addressing of memory) operands. SIMD
registers encoded via ModR/M.rm (when ModR/M.mod == 3) have their top
bit in EVEX.X3. Supposedly (doc version 004) EVEX.B4 is ignored when
unused, hence also don't flag such encodings as invalid.
2024-09-11 13:52:42 +02:00
Haochen Jiang
85e370a3d6 Support ymm rounding control for Intel AVX10.2
In the patch, in order to support ymm rounding for AVX10.2, we derive
evex attribute for all cases instead of only for rc_none to encode U bit.
Also changed some bad_opcode return due to the share of U bit with APX_F.

gas/ChangeLog:

	* config/tc-i386.c
	(cpu_flags_match): Handle AVX10_2.
	(build_evex_prefix): Handle U bit. Derive evex attribute
	for all cases.
	(check_VecOperands): Handle AVX10.2 and ymm roundings.
	* doc/c-i386.texi: Document .avx10.2.
	* testsuite/gas/i386/i386.exp: Run AVX10.2 tests.
	* testsuite/gas/i386/x86-64.exp: Ditto.
	* testsuite/gas/i386/avx10_2-rounding-intel.d: New test.
	* testsuite/gas/i386/avx10_2-rounding-inval.l: Ditto.
	* testsuite/gas/i386/avx10_2-rounding-inval.s: Ditto.
	* testsuite/gas/i386/avx10_2-rounding.d: Ditto.
	* testsuite/gas/i386/avx10_2-rounding.s: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-rounding-intel.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-rounding.d: Ditto.
	* testsuite/gas/i386/x86-64-avx10_2-rounding.s: Ditto.

opcodes/ChangeLog:

	* i386-dis.c (struct instr_info): Add U bit.
	(get_valid_dis386): Handle U bit.
	* i386-gen.c (isa_dependencies): Add AVX10.2.
	(cpu_flags): Ditto.
	* i386-init.h: Regenerated.
	* i386-opc.h (CpuAVX10_2): New.
	(i386_cpu_flags): Add cpuavx10_2.
	* i386-opc.tbl: Add rounding to old entries which do not
	permit rounding previously. Also eliminate the redundant
	RegXMM for vcvtps2uqq.
	* i386-tbl.h: Regenerated.
2024-09-02 10:53:59 +08:00
Jan Beulich
5d67152772 x86/APX: drop %SW disassembler macro again
Not the least due to its extremely rare use I didn't really like that
macro's introduction. Adjust swap_operand() accordingly instead.
2024-08-30 11:23:51 +02:00
Andrew Burgess
28792287e8 opcodes/x86: fix minor missed styling case
I noticed that the x86 instruction:

  sar    $1,%rsi

would fail to style the '$0x1' as an immediate.  This commit fixes
that case.
2024-07-24 14:32:35 +01:00
Cui, Lili
fc111d56dd x86: Correct position of ".s" for CCMPcc in disassembler
Added new macro %SW to CCMPcc to print ".s" after the mnemonic.

Before:
ccmpbl {dfv=}.s %edx,%eax

After:
ccmpbl.s {dfv=} %edx,%eax

gas/ChangeLog:

        * testsuite/gas/i386/x86-64-pseudos-apx.d: Add tests for CCMPcc.
        * testsuite/gas/i386/x86-64-pseudos-apx.s: Ditto.

opcodes/ChangeLog:

        * i386-dis-evex.h: Added %SW for CCMPcc swap operands.
        * i386-dis.c (struct dis386): Added %SW.
        (putop): Handle %SW.
2024-07-05 09:55:41 +08:00
Cui, Lili
b0dd832fa4 Support APX CFCMOV
The CMOVcc instruction proposed by EVEX has four different forms,
corresponding to the four possible combinations of EVEX.ND and EVEX.NF
values.

In the encoder part, when the CFCMOV template supports EVEX_NF, it means that
it requires EVEX.NF to be 1.

In the decoder part, CFCMOV_Fixup is used to reverse source and destination
operands in the 2-operand case.

gas/ChangeLog:

        * config/tc-i386.c (build_apx_evex_prefix): Set NF bit for cfcmov
        when the insn template supports EVEX_NF.
        * testsuite/gas/i386/x86-64-apx-inval.l: Add invalid tests for cfcmov.
        * testsuite/gas/i386/x86-64-apx-inval.s: Ditto.
        * testsuite/gas/i386/x86-64.exp: Add tests for cfcmov and cmov.
        * testsuite/gas/i386/x86-64-apx-cfcmov-intel.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-cfcmov.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-cfcmov.s: Ditto.

opcodes/ChangeLog:

        * i386-dis-evex-prefix.h: Add cfcmov instructions.
        * i386-dis.c (CFCMOV_Fixup): Special handling of cfcmov.
        (putop): Print 'cf' for cfcmov instructions.
        * i386-opc.h (EVEX_NF): New.
        * i386-opc.tbl: Add cfcmov instructions.
        * i386-mnem.h: Regerated.
        * i386-tbl.h: Regerated.
2024-07-04 15:55:00 +08:00
Jan Beulich
87860ef6f4 x86/APX: fix disassembly of byte register operands
Like for REX/REX2, EVEX-prefixed insns access the low bytes of all
registers; %ah...%bh are inaccessible. Reflect this correctly in output,
by leveraging REX machinery we already have to this effect.
2024-06-21 08:36:03 +02:00
Cui, Lili
f7b1fe8dc4 Remove %ME and used %NE for movbe.
%ME is added specifically for movbe. Now with %NE, we can use
MOD table + %NE to indicate whether a {evex} prefix is needed.

opcodes/ChangeLog:

        * i386-dis-evex-mod.h: Added movbe.
        * i386-dis-evex.h: Let movbe go through the mod table.
        * i386-dis.c (struct dis386): Removed %ME.
        (putop): Removed case ME.
2024-06-18 10:52:41 +08:00
Cui, Lili
d8ba1c4037 Support APX CCMP and CTEST
CCMP and CTEST are two new sets of instructions for conditional CMP
and TEST, SCC and OSZC flags are given as suffixes of CCMP or CTEST
in the instruction mnemonic, e.g.:

ccmp<cc> { dfv=sf , cf , of } %eax, %ecx

also add

{evex} cmp/test %eax, %ecx

as an alias for ccmpt.

For the encoder part, add function check_Scc_OszcOperation to parse
'{ dfv=of , sf, sf, cf}', store scc in the lower 4 bits of base_opcode,
and adjust base_opcode to its normal meaning in install_template.

For the decoder part, add 'SC' and 'DF' macros to add scc and oszc flags
suffixes.

gas/ChangeLog:

        * config/tc-i386.c (OSZC_CF): New.
        (OSZC_ZF): Ditto.
        (OSZC_SF): Ditto.
        (OSZC_OF): Ditto.
        (set_oszc_flags): Set oszc flags and report error for using the same oszc flags twice.
        (check_Scc_OszcOperations): Handle SCC OSZC flags.
        (install_template): Add scc and oszc_flags.
        (build_apx_evex_prefix): Encode SCC and oszc flags bits.
        (parse_insn): Handle check_Scc_OszcOperations.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d: Add ivalid test case.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s: Ditto.
        * testsuite/gas/i386/x86-64.exp: Add test for ccmp and ctest.
        * testsuite/gas/i386/x86-64-apx-ccmp-ctest-intel.d: New test.
        * testsuite/gas/i386/x86-64-apx-ccmp-ctest-inval.l: Ditto.
        * testsuite/gas/i386/x86-64-apx-ccmp-ctest-inval.s: Ditto.
        * testsuite/gas/i386/x86-64-apx-ccmp-ctest.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-ccmp-ctest.s: Ditto.

opcodes/ChangeLog:

        * i386-dis-evex-reg.h: Add ccmp and ctest.
        * i386-dis-evex.h: Ditto.
        * i386-dis.c (struct instr_info): add scc.
        (struct dis386): Add new micro 'NE','SC' and'DF'.
        (get_valid_dis386): Get scc value and move MAP4 invalid check to print_insn.
        (putop): Handle %NE, %SC and %DF.
        * i386-opc.h (SCC): New.
        * i386-opc.tbl: Add ccmp/ctest and evex format for cmp/test.
        * i386-mnem.h: Regenerated.
        * i386-tbl.h: Ditto.
2024-06-18 10:52:40 +08:00
Jan Beulich
cf037c0de2 x86: disassembler macro for condition code
Both CMPccXADD and APX'es {,CF}CMOVcc have almost identical entries
replicated 16 times each. Fold those to just one each by introducing a
%CC macro. (Note that the recording of ->condition_code in print_insn()
is merely for completeness for now; it's not used as long as only
VEX/EVEX encodings would consume it.)

This then also renders condition codes printed consistent across all
respective insns; CMPxxXADD had a number of outliers so far.
2024-06-10 10:45:56 +02:00
Cui, Lili
bbe8d019ed Support APX zero-upper
This patch is to enable ZU for IMUL (opcodes 0x69 and 0x6B) and SETcc.
Since the spec only recommends one form of setzu, I won't be adding
set<cc>reg32/reg64 support in this patch.

gas/ChangeLog:

        * config/tc-i386.c (build_apx_evex_prefix): Handle ZU.
        * testsuite/gas/i386/x86-64.exp: Added new tests for ZU.
        * testsuite/gas/i386/x86-64.exp: Added new tests for ZU.
        * testsuite/gas/i386/x86-64-apx-zu-intel.d: New test.
        * testsuite/gas/i386/x86-64-apx-zu-inval.l: Ditto.
        * testsuite/gas/i386/x86-64-apx-zu-inval.s: Ditto.
        * testsuite/gas/i386/x86-64-apx-zu.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-zu.s: Ditto.

opcodes/ChangeLog:

        * i386-dis-evex-prefix.h: Handle PREFIX_EVEX_MAP4_40 ~
        PREFIX_EVEX_MAP4_4F.
        * i386-dis-evex.h: Ditto.
        * i386-dis.c (struct dis386): Add new micro 'ZU'.
        (putop): Handle %ZU.
        * i386-gen.c: Added ZU.
        * i386-opc.h: Ditto.
        * i386-opc.tbl: Added new templates to support ZU.
2024-05-22 16:15:47 +08:00
Cui, Lili
b5247082c4 x86/APX: Add invalid check for APX EVEX.X4.
gas/ChangeLog:

        * config/tc-i386.c (build_apx_evex_prefix): Added invalid check for APX
        X4.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d: Added invalid
        testcase.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s: Ditto.

opcodes/ChangeLog:

        * i386-dis.c (get_valid_dis386): Added invalid check for APX X4.
2024-04-22 09:25:56 +08:00
Hu, Lin1
e59144c6ed Add W table for USER_MSR under MAP4.
opcodes/ChangeLog:

	* i386-dis-evex-mod.h: Modify MOD_EVEX_MAP4_F8_P1,
	MOD_EVEX_MAP4_F8_P3.
	* i386-dis-evex-w.h (EVEX_W_MAP4_F8_P1_M_1): New.
	(EVEX_W_MAP4_F8_P3_M_1): Ditto.
	* i386-dis.c (vex_w_table): Add EVEX_W_MAP4_F8_P1_M_1,
	EVEX_W_MAP4_F8_P3_M_1.
	* i386-opc.tbl: Remove redundant '|'.
2024-04-17 13:57:50 +08:00
Hu, Lin1
edb30f5782 Support {evex} pseudo prefix for decode evex promoted insns without egpr32.
This patch is based on APX NF patch and also adds test cases for Checking 64-bit insns not sizeable through
register operands with evex.

gas/ChangeLog:

        * testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d: Added no-egpr testcases for movbe.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-wig.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted.s: Ditto.
        * testsuite/gas/i386/x86-64.exp: Added tests.
        * testsuite/gas/i386/noreg64-evex.d: New test.
        * testsuite/gas/i386/noreg64-evex.e: Ditto.
        * testsuite/gas/i386/noreg64-evex.s: Ditto.
        * testsuite/gas/i386/x86-64-apx_f-evex.d: Ditto.
        * testsuite/gas/i386/x86-64-apx_f-evex.s: Ditto.

opcodes/ChangeLog:

        * i386-dis-evex.h: Added %ME to movbe.
        * i386-dis.c : Added %XE to evex_from_vex instructions to output {evex}.
        (struct dis386): New %ME.
        (putop): Handle %ME and output {evex} for evex_from_legacy instructions.
        * Return early when the instruction name is (bad).
2024-04-09 11:18:23 +08:00
Cui, Lili
dd74a60337 Support APX NF
For the case when NDD and NF are both 0 in evex-promoted format,
we will fully support and test it in another patch.

gas/ChangeLog:

       * NEWS: Support Intel APX NF.
       * config/tc-i386.c (enum i386_error): Add unsupported_nf.
       (struct _i386_insn): Add has_nf.
       (is_apx_evex_encoding): Ditto.
       (build_apx_evex_prefix): Encode the NF bit.
       (md_assemble): Handle unsupported_nf.
       (parse_insn): Handle Prefix_NF and report bad for illegal combination.
       (can_convert_NDD_to_legacy): Replace i.tm.opcode_modifier.nf with i.has_nf.
       (match_template): Support D for APX_F insns and check NF support.
       * testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d: Add bad test for NF bit.
       * testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s: Ditto.
       * testsuite/gas/i386/x86-64-apx-inval.l: Ditto.
       * testsuite/gas/i386/x86-64-apx-inval.s: Ditto.
       * testsuite/gas/i386/x86-64.exp: Add apx nf tests.
       * testsuite/gas/i386/x86-64-apx-nf-intel.d: New test.
       * testsuite/gas/i386/x86-64-apx-nf.d: Ditto.
       * testsuite/gas/i386/x86-64-apx-nf.s: Ditto.

opcodes/ChangeLog:

       * i386-dis-evex.h: Add %NF to the instructions that support APX NF and
       add new instruction imul, popcnt, tzcnt and lzcnt to EVEX table.
       * i386-dis-evex-reg.h: Ditto.
       * i386-dis.c (struct instr_info): Add nf.
       (struct dis386): Add "NF" for EVEX.NF.
       (get_valid_dis386): Set ins->vex.nf and report bad-nf for illegal case.
       (print_insn): Handle ins.vex.nf.
       (putop): Handle "%NF".
       * i386-opc.h (Prefix_NF): New.
       * i386-opc.tbl: Added new entries to support full APX NF instructions.
       * i386-mnem.h: Regenerated.
       * i386-tbl.h: Regenerated.
2024-04-07 17:28:25 +08:00
Cui, Lili
8963a60d7b x86/APX: Remove KEYLOCKER and SHA promotions from EVEX MAP4
APX spec removed KEYLOCKER and SHA promotions from EVEX MAP4.
https://www.intel.com/content/www/us/en/developer/articles/technical/advanced-performance-extensions-apx.html

gas/ChangeLog:

        * NEWS: Mention that remove KEYLOCKER and SHA promotions from EVEX
	* MAP4.
        * config/tc-i386.c (process_operands): Removed special handling of
	* KEYLOCKER and SHA.
        * testsuite/gas/i386/x86-64-apx-egpr-promote-inval.l: Removed KEYLOCKER
        * and SHA instructions.
        * testsuite/gas/i386/x86-64-apx-egpr-promote-inval.s: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-bad.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-bad.s: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-intel.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted-wig.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted.d: Ditto.
        * testsuite/gas/i386/x86-64-apx-evex-promoted.s: Ditto.

opcodes/ChangeLog:

        * i386-dis-evex-prefix.h: Removed KEYLOCKER and SHA instructions.
        * i386-dis-evex.h: Ditto.
        * i386-opc.tbl: Ditto.
        * i386-dis.c (print_vector_reg): Removed special handling of KEYLOCKER
	*  and SHA.
2024-04-03 09:50:00 +08:00
Jan Beulich
9fe07b7f95 x86/APX: legacy promoted insns can't access %xmm16-%xmm31
Irrespective of the encoding being EVEX, the usable SIMD register range
continues to be limited to %xmm0-%xmm15. Enforce this in gas (but
continue to generate code, as in principle we know how to encode
things) and recognize/flag the case in the disassembler.

Oddly enough wrong forms were actually used in the testsuite (register-
only forms are then really meaningless to test here, and are hence
dropped instead of adjusted).

Convert the POP2 test that needs touching anyway (due to a bad ModR/M
byte having been chosen) to .insn.
2024-03-15 10:29:35 +01:00
Jan Beulich
41e115853e x86/APX: with REX2 map 1 doesn't "chain" to maps 2 or 3
Don't wander into three_byte_table[] when REX2 is present.

While there also eliminate related confusion when accessing
dis386_twobyte[]: There's nothing 3-byte-ish involved there. Dropping
the odd variable gets things better in sync with 1-byte handling as
well.
2024-02-09 08:39:48 +01:00
Jan Beulich
c179ace029 x86/APX: TILE{RELEASE,ZERO} have no EVEX encodings
Re-using the entire VEX decode hierarchy for the respective major opcode
has led to those two also being decoded as-if valid. Follow the earlier
USE_X86_64_EVEX_{PFX,W}_TABLE approach to avoid this happening.
2024-01-26 10:34:48 +01:00
Jan Beulich
836f6ceb83 x86/APX: no need to have decode go through x86_64_table[]
As suggested during review already, all such entries have their first
slot as Bad_Opcode, so by adding two more enumerators we can avoid doing
that decode step altogether.
2024-01-26 10:34:24 +01:00
Jan Beulich
2519809009 x86/APX: be consistent with insn suffixes
When there's a suitably disambiguating register operand, suffixes are
generally omitted (unless in suffix-always mode). All NDD insns have a
suitable register operand, so they shouldn't have suffixes by default.
2024-01-19 10:17:44 +01:00
Jan Beulich
5190fa3828 x86: support APX forms of U{RD,WR}MSR
This was missed in 6177c84d5e ("Support APX GPR32 with extend evex
prefix").
2024-01-19 10:16:00 +01:00
H.J. Lu
f322084c7c i386: Correct adcx suffix in disassembler
Since 0x66 is the opcode prefix for adcx, it is wrong to use the 'S'
prefix:

  'S' => print 'w', 'l' or 'q' if suffix_always is true

on adcx.  Add

  'L' => print 'l' or 'q' if suffix_always is true

replace S with L on adcx and adox.

gas/

	PR binutils/31219
	* testsuite/gas/i386/suffix.d: Updated.
	* testsuite/gas/i386/x86-64-suffix.d: Likewise.
	* testsuite/gas/i386/suffix.s: Add tests for adcx and adox.
	* testsuite/gas/i386/x86-64-suffix.s: Likewise.

opcodes/

	PR binutils/31219
	* i386-dis.c: Add the 'L' suffix.
	(prefix_table): Replace S with L on adcx and adox.
	(putop): Handle the 'L' suffix.
2024-01-07 11:58:53 -08:00
Alan Modra
fd67aa1129 Update year range in copyright notice of binutils files
Adds two new external authors to etc/update-copyright.py to cover
bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then
updates copyright messages as follows:

1) Update cgen/utils.scm emitted copyrights.
2) Run "etc/update-copyright.py --this-year" with an extra external
   author I haven't committed, 'Kalray SA.', to cover gas testsuite
   files (which should have their copyright message removed).
3) Build with --enable-maintainer-mode --enable-cgen-maint=yes.
4) Check out */po/*.pot which we don't update frequently.
2024-01-04 22:58:12 +10:30