Skip to content

Commit 2519003

Browse files
authored
Add APX ISA extension (#450)
1 parent 48e7506 commit 2519003

File tree

153 files changed

+38960
-26057
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+38960
-26057
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
*.c eof=lf encoding=utf-8
44
*.py eof=lf encoding=utf-8
55
*.md eof=lf encoding=utf-8
6-
6+
*.json eof=lf encoding=utf-8

examples/ZydisPerfTest.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,8 @@ static void GenerateTestData(FILE* file, ZyanU8 encoding)
417417
switch (encoding)
418418
{
419419
case 0:
420-
b = (instruction.encoding == ZYDIS_INSTRUCTION_ENCODING_LEGACY);
420+
b = (instruction.encoding == ZYDIS_INSTRUCTION_ENCODING_LEGACY) ||
421+
(instruction.encoding == ZYDIS_INSTRUCTION_ENCODING_REX2);
421422
break;
422423
case 1:
423424
b = (instruction.encoding == ZYDIS_INSTRUCTION_ENCODING_3DNOW);

include/Zydis/Decoder.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ typedef enum ZydisDecoderMode_
8282
* Enables `KNC` compatibility-mode.
8383
*
8484
* `KNC` and `KNL+` chips are sharing opcodes and encodings for some mask-related instructions.
85-
* Enable this mode to use the old `KNC` specifications (different mnemonics, operands, ..).
85+
* With the EVEX extensions introduced with APX, it's impossible to distinguish between EVEX
86+
* and MVEX at runtime.
87+
*
88+
* Enable this mode to enable KNC support.
89+
*
90+
* WARNING: This will disable decoding of all AVX-512 (EVEX) instructions.
8691
*
8792
* This mode is NOT enabled by default.
8893
*/
@@ -153,11 +158,19 @@ typedef enum ZydisDecoderMode_
153158
* This mode is disabled by default.
154159
*/
155160
ZYDIS_DECODER_MODE_UD0_COMPAT,
161+
/**
162+
* Enables the `APX` mode.
163+
*
164+
* APX introduces the `REX2` prefix, new EVEX spaces and access to additional GPRs.
165+
*
166+
* This mode is enabled by default.
167+
*/
168+
ZYDIS_DECODER_MODE_APX,
156169

157170
/**
158171
* Maximum value of this enum.
159172
*/
160-
ZYDIS_DECODER_MODE_MAX_VALUE = ZYDIS_DECODER_MODE_UD0_COMPAT,
173+
ZYDIS_DECODER_MODE_MAX_VALUE = ZYDIS_DECODER_MODE_APX,
161174
/**
162175
* The minimum number of bits required to represent all values of this enum.
163176
*/

0 commit comments

Comments
 (0)