x86/insn: Add support for APX EVEX to the instruction decoder logic
authorAdrian Hunter <adrian.hunter@intel.com>
Thu, 2 May 2024 10:58:50 +0000 (13:58 +0300)
committerIngo Molnar <mingo@kernel.org>
Thu, 2 May 2024 11:13:45 +0000 (13:13 +0200)
commit87bbaf1a4be4904fcf04a024e7c1d9f9d1fa945b
treecaefeb3858545b5ea88eacc72b98f6e812e0d531
parent159039af8c074a14545fd695c38d2772b3c98b12
x86/insn: Add support for APX EVEX to the instruction decoder logic

Intel Advanced Performance Extensions (APX) extends the EVEX prefix to
support:

 - extended general purpose registers (EGPRs) i.e. r16 to r31
 - Push-Pop Acceleration (PPX) hints
 - new data destination (NDD) register
 - suppress status flags writes (NF) of common instructions
 - new instructions

Refer to the Intel Advanced Performance Extensions (Intel APX) Architecture
Specification for details.

The extended EVEX prefix does not need amended instruction decoder logic,
except in one area. Some instructions are defined as SCALABLE which means
the EVEX.W bit and EVEX.pp bits are used to determine operand size.
Specifically, if an instruction is SCALABLE and EVEX.W is zero, then
EVEX.pp value 0 (representing no prefix NP) means default operand size,
whereas EVEX.pp value 1 (representing 66 prefix) means operand size
override i.e. 16 bits

Add an attribute (INAT_EVEX_SCALABLE) to identify such instructions, and
amend the logic appropriately.

Amend the awk script that generates the attribute tables from the opcode
map, to recognise "(es)" as attribute INAT_EVEX_SCALABLE.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20240502105853.5338-8-adrian.hunter@intel.com
arch/x86/include/asm/inat.h
arch/x86/include/asm/insn.h
arch/x86/lib/insn.c
arch/x86/tools/gen-insn-attr-x86.awk
tools/arch/x86/include/asm/inat.h
tools/arch/x86/include/asm/insn.h
tools/arch/x86/lib/insn.c
tools/arch/x86/tools/gen-insn-attr-x86.awk