From 6d690a4893c6ab4d298697446cf326a22ff6c236 Mon Sep 17 00:00:00 2001 From: flobernd Date: Mon, 27 Nov 2017 13:42:24 +0100 Subject: [PATCH] Improved file-size reduction for builds without `ZYDIS_FEATURE_EVEX`/`ZYDIS_FEATURE_MVEX` --- src/Generated/DecoderTables.inc | 4 ++++ src/Generated/InstructionDefinitions.inc | 4 ++++ src/SharedData.h | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/Generated/DecoderTables.inc b/src/Generated/DecoderTables.inc index 9a8f6cc..4c33067 100644 --- a/src/Generated/DecoderTables.inc +++ b/src/Generated/DecoderTables.inc @@ -5665,6 +5665,7 @@ const ZydisDecoderTreeNode filtersREXB[][2] = { ZYDIS_DEFINITION(0x0, 0x38A), ZYDIS_DEFINITION(0x0, 0x723) } }; +#ifndef ZYDIS_DISABLE_EVEX const ZydisDecoderTreeNode filtersEVEXB[][2] = { { ZYDIS_FILTER(ZYDIS_NODETYPE_FILTER_VECTOR_LENGTH, 0x0), ZYDIS_INVALID }, @@ -6573,7 +6574,9 @@ const ZydisDecoderTreeNode filtersEVEXB[][2] = { ZYDIS_FILTER(ZYDIS_NODETYPE_FILTER_VECTOR_LENGTH, 0x3AE), ZYDIS_INVALID }, { ZYDIS_DEFINITION(0x1, 0x3), ZYDIS_INVALID } }; +#endif +#ifndef ZYDIS_DISABLE_MVEX const ZydisDecoderTreeNode filtersMVEXE[][2] = { { ZYDIS_DEFINITION(0x1, 0xC7), ZYDIS_DEFINITION(0x1, 0xC8) }, @@ -6696,6 +6699,7 @@ const ZydisDecoderTreeNode filtersMVEXE[][2] = { ZYDIS_DEFINITION(0xB, 0x2E), ZYDIS_DEFINITION(0xB, 0x2F) }, { ZYDIS_DEFINITION(0xB, 0x2B), ZYDIS_DEFINITION(0xB, 0x2C) } }; +#endif const ZydisDecoderTreeNode filtersModeAMD[][2] = { diff --git a/src/Generated/InstructionDefinitions.inc b/src/Generated/InstructionDefinitions.inc index 17a9ee4..cc35e67 100644 --- a/src/Generated/InstructionDefinitions.inc +++ b/src/Generated/InstructionDefinitions.inc @@ -3711,6 +3711,7 @@ const ZydisInstructionDefinitionVEX instructionDefinitionsVEX[] = { ZYDIS_MNEMONIC_VZEROUPPER, 0, 0x0, 0, 0x4, ZYDIS_FALSE, ZYDIS_TRUE, ZYDIS_CATEGORY_AVX, ZYDIS_ISA_SET_AVX, ZYDIS_ISA_EXT_AVX, ZYDIS_EXCEPTION_CLASS_AVX8, ZYDIS_FALSE, ZYDIS_VEX_STATIC_BROADCAST_NONE } }; +#ifndef ZYDIS_DISABLE_EVEX const ZydisInstructionDefinitionEVEX instructionDefinitionsEVEX[] = { { ZYDIS_MNEMONIC_V4FMADDPS, 4, 0x715, 0, 0x4, ZYDIS_FALSE, ZYDIS_TRUE, ZYDIS_CATEGORY_AVX512_4FMAPS, ZYDIS_ISA_SET_AVX512EVEX, ZYDIS_ISA_EXT_AVX512_4FMAPS_512, ZYDIS_EXCEPTION_CLASS_E2, ZYDIS_TRUE, ZYDIS_FALSE, ZYDIS_IVECTOR_LENGTH_DEFAULT, ZYDIS_TUPLETYPE_T1_4X, ZYDIS_IELEMENT_SIZE_32, ZYDIS_EVEX_FUNC_INVALID, ZYDIS_MASK_POLICY_ALLOWED, ZYDIS_TRUE, ZYDIS_FALSE, ZYDIS_EVEX_STATIC_BROADCAST_NONE }, @@ -6683,7 +6684,9 @@ const ZydisInstructionDefinitionEVEX instructionDefinitionsEVEX[] = { ZYDIS_MNEMONIC_VXORPS, 4, 0x3FD, 0, 0x4, ZYDIS_FALSE, ZYDIS_TRUE, ZYDIS_CATEGORY_LOGICAL_FP, ZYDIS_ISA_SET_AVX512EVEX, ZYDIS_ISA_EXT_AVX512DQ_256, ZYDIS_EXCEPTION_CLASS_E4, ZYDIS_TRUE, ZYDIS_FALSE, ZYDIS_IVECTOR_LENGTH_DEFAULT, ZYDIS_TUPLETYPE_FV, ZYDIS_IELEMENT_SIZE_32, ZYDIS_EVEX_FUNC_BC, ZYDIS_MASK_POLICY_ALLOWED, ZYDIS_TRUE, ZYDIS_FALSE, ZYDIS_EVEX_STATIC_BROADCAST_NONE }, { ZYDIS_MNEMONIC_VXORPS, 4, 0x402, 0, 0x4, ZYDIS_FALSE, ZYDIS_TRUE, ZYDIS_CATEGORY_LOGICAL_FP, ZYDIS_ISA_SET_AVX512EVEX, ZYDIS_ISA_EXT_AVX512DQ_512, ZYDIS_EXCEPTION_CLASS_E4, ZYDIS_TRUE, ZYDIS_FALSE, ZYDIS_IVECTOR_LENGTH_DEFAULT, ZYDIS_TUPLETYPE_FV, ZYDIS_IELEMENT_SIZE_32, ZYDIS_EVEX_FUNC_BC, ZYDIS_MASK_POLICY_ALLOWED, ZYDIS_TRUE, ZYDIS_FALSE, ZYDIS_EVEX_STATIC_BROADCAST_NONE } }; +#endif +#ifndef ZYDIS_DISABLE_MVEX const ZydisInstructionDefinitionMVEX instructionDefinitionsMVEX[] = { { ZYDIS_MNEMONIC_CLEVICT0, 1, 0x1954, 0, 0x4, ZYDIS_FALSE, ZYDIS_TRUE, ZYDIS_CATEGORY_PREFETCH, ZYDIS_ISA_SET_KNCE, ZYDIS_ISA_EXT_KNCE, ZYDIS_EXCEPTION_CLASS_NONE, ZYDIS_FALSE, ZYDIS_FALSE, ZYDIS_MVEX_FUNC_F_64, ZYDIS_MASK_POLICY_INVALID, ZYDIS_FALSE, ZYDIS_MVEX_STATIC_BROADCAST_NONE }, @@ -7094,3 +7097,4 @@ const ZydisInstructionDefinitionMVEX instructionDefinitionsMVEX[] = { ZYDIS_MNEMONIC_VSUBRPS, 4, 0x407, 0, 0x4, ZYDIS_FALSE, ZYDIS_TRUE, ZYDIS_CATEGORY_KNC, ZYDIS_ISA_SET_KNCE, ZYDIS_ISA_EXT_KNCE, ZYDIS_EXCEPTION_CLASS_NONE, ZYDIS_TRUE, ZYDIS_FALSE, ZYDIS_MVEX_FUNC_RC, ZYDIS_MASK_POLICY_ALLOWED, ZYDIS_FALSE, ZYDIS_MVEX_STATIC_BROADCAST_NONE }, { ZYDIS_MNEMONIC_VSUBRPS, 4, 0xA3D, 0, 0x4, ZYDIS_FALSE, ZYDIS_TRUE, ZYDIS_CATEGORY_KNC, ZYDIS_ISA_SET_KNCE, ZYDIS_ISA_EXT_KNCE, ZYDIS_EXCEPTION_CLASS_NONE, ZYDIS_TRUE, ZYDIS_FALSE, ZYDIS_MVEX_FUNC_SF_32, ZYDIS_MASK_POLICY_ALLOWED, ZYDIS_FALSE, ZYDIS_MVEX_STATIC_BROADCAST_NONE } }; +#endif diff --git a/src/SharedData.h b/src/SharedData.h index 3874e1d..386cee3 100644 --- a/src/SharedData.h +++ b/src/SharedData.h @@ -604,6 +604,7 @@ typedef struct ZydisInstructionDefinitionVEX_ ZydisVEXStaticBroadcast broadcast ZYDIS_BITFIELD( 3); } ZydisInstructionDefinitionVEX; +#ifndef ZYDIS_DISABLE_EVEX typedef struct ZydisInstructionDefinitionEVEX_ { ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_EX; @@ -616,7 +617,9 @@ typedef struct ZydisInstructionDefinitionEVEX_ ZydisBool isControlMask ZYDIS_BITFIELD( 1); ZydisEVEXStaticBroadcast broadcast ZYDIS_BITFIELD( 4); } ZydisInstructionDefinitionEVEX; +#endif +#ifndef ZYDIS_DISABLE_MVEX typedef struct ZydisInstructionDefinitionMVEX_ { ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR_EX; @@ -625,6 +628,7 @@ typedef struct ZydisInstructionDefinitionMVEX_ ZydisBool hasElementGranularity ZYDIS_BITFIELD( 1); ZydisMVEXStaticBroadcast broadcast ZYDIS_BITFIELD( 3); } ZydisInstructionDefinitionMVEX; +#endif /* ---------------------------------------------------------------------------------------------- */ /* Accessed CPU flags */