Files
jak-project/third-party/zydis/src/DecoderData.c
T
ManDude 5b44aece75 random fixes + support clang-cl on visual studio (#1129)
* delete unused shaders

* hide some options in debug menu

* change fullscreen logic a bit

* add "all actors" toggle

* borderless fix and fix alpha in direct renderer untextured (do we need a separate shader for that?)

* fix fuel cell orbit icons in widescreen

* fix `curve` types

* refs

* fix levitator task...

* fix some task stuff

* update font code a bit (temp)

* cmake, third-party and visual studio overhaul

* Update .gitmodules

* update modules

* clone repos

* fix encoding in zydis

* where did these come from

* try again

* add submodule

* Update 11zip

* Update 11zip

* Update 11zip

* delete

* try again

* clang

* update compiler flags

* delete 11zip. go away.

* Create memory-dump-p2s.py

* properly

* fix minimum architecture c++ compiler flags

* fix zydis

* oops

* Update all-types.gc

* fix clang-cl tests

* make "all actors" work better, entity debug qol

* update game-text conversion code to be more modularized

* Create vendor.txt

* fix typos and minor things

* update refs

* clang

* Attempt to add clang-cl support to vs2019 and CI

* vs2022 + clang-cl

* srsly? fix clang build

* Update launch.vs.json

* extend windows CI timer
2022-02-07 19:15:37 -05:00

175 lines
7.7 KiB
C
Vendored
Generated

/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Florian Bernd
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <Zydis/Internal/DecoderData.h>
/* ============================================================================================== */
/* Data tables */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Physical instruction encodings */
/* ---------------------------------------------------------------------------------------------- */
#include <Generated/InstructionEncodings.inc>
/* ---------------------------------------------------------------------------------------------- */
/* Decoder tree */
/* ---------------------------------------------------------------------------------------------- */
#define ZYDIS_INVALID \
{ ZYDIS_NODETYPE_INVALID, 0x00000000 }
#define ZYDIS_FILTER(type, id) \
{ type, id }
#define ZYDIS_DEFINITION(encoding_id, id) \
{ ZYDIS_NODETYPE_DEFINITION_MASK | encoding_id, id }
#include <Generated/DecoderTables.inc>
#undef ZYDIS_INVALID
#undef ZYDIS_FILTER
#undef ZYDIS_DEFINITION
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Functions */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Decoder tree */
/* ---------------------------------------------------------------------------------------------- */
const ZydisDecoderTreeNode zydis_decoder_tree_root = { ZYDIS_NODETYPE_FILTER_OPCODE, 0x0000 };
const ZydisDecoderTreeNode* ZydisDecoderTreeGetChildNode(const ZydisDecoderTreeNode* parent,
ZyanU16 index)
{
switch (parent->type)
{
case ZYDIS_NODETYPE_FILTER_XOP:
ZYAN_ASSERT(index < 13);
return &FILTERS_XOP[parent->value][index];
case ZYDIS_NODETYPE_FILTER_VEX:
ZYAN_ASSERT(index < 17);
return &FILTERS_VEX[parent->value][index];
case ZYDIS_NODETYPE_FILTER_EMVEX:
ZYAN_ASSERT(index < 49);
return &FILTERS_EMVEX[parent->value][index];
case ZYDIS_NODETYPE_FILTER_OPCODE:
ZYAN_ASSERT(index < 256);
return &FILTERS_OPCODE[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE:
ZYAN_ASSERT(index < 4);
return &FILTERS_MODE[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_COMPACT:
ZYAN_ASSERT(index < 3);
return &FILTERS_MODE_COMPACT[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODRM_MOD:
ZYAN_ASSERT(index < 4);
return &FILTERS_MODRM_MOD[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODRM_MOD_COMPACT:
ZYAN_ASSERT(index < 2);
return &FILTERS_MODRM_MOD_COMPACT[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODRM_REG:
ZYAN_ASSERT(index < 8);
return &FILTERS_MODRM_REG[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODRM_RM:
ZYAN_ASSERT(index < 8);
return &FILTERS_MODRM_RM[parent->value][index];
case ZYDIS_NODETYPE_FILTER_PREFIX_GROUP1:
ZYAN_ASSERT(index < 2);
return &FILTERS_PREFIX_GROUP1[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MANDATORY_PREFIX:
ZYAN_ASSERT(index < 5);
return &FILTERS_MANDATORY_PREFIX[parent->value][index];
case ZYDIS_NODETYPE_FILTER_OPERAND_SIZE:
ZYAN_ASSERT(index < 3);
return &FILTERS_OPERAND_SIZE[parent->value][index];
case ZYDIS_NODETYPE_FILTER_ADDRESS_SIZE:
ZYAN_ASSERT(index < 3);
return &FILTERS_ADDRESS_SIZE[parent->value][index];
case ZYDIS_NODETYPE_FILTER_VECTOR_LENGTH:
ZYAN_ASSERT(index < 3);
return &FILTERS_VECTOR_LENGTH[parent->value][index];
case ZYDIS_NODETYPE_FILTER_REX_W:
ZYAN_ASSERT(index < 2);
return &FILTERS_REX_W[parent->value][index];
case ZYDIS_NODETYPE_FILTER_REX_B:
ZYAN_ASSERT(index < 2);
return &FILTERS_REX_B[parent->value][index];
#ifndef ZYDIS_DISABLE_AVX512
case ZYDIS_NODETYPE_FILTER_EVEX_B:
ZYAN_ASSERT(index < 2);
return &FILTERS_EVEX_B[parent->value][index];
#endif
#ifndef ZYDIS_DISABLE_KNC
case ZYDIS_NODETYPE_FILTER_MVEX_E:
ZYAN_ASSERT(index < 2);
return &FILTERS_MVEX_E[parent->value][index];
#endif
case ZYDIS_NODETYPE_FILTER_MODE_AMD:
ZYAN_ASSERT(index < 2);
return &FILTERS_MODE_AMD[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_KNC:
ZYAN_ASSERT(index < 2);
return &FILTERS_MODE_KNC[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_MPX:
ZYAN_ASSERT(index < 2);
return &FILTERS_MODE_MPX[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_CET:
ZYAN_ASSERT(index < 2);
return &FILTERS_MODE_CET[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_LZCNT:
ZYAN_ASSERT(index < 2);
return &FILTERS_MODE_LZCNT[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_TZCNT:
ZYAN_ASSERT(index < 2);
return &FILTERS_MODE_TZCNT[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_WBNOINVD:
ZYAN_ASSERT(index < 2);
return &FILTERS_MODE_WBNOINVD[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE_CLDEMOTE:
ZYAN_ASSERT(index < 2);
return &FILTERS_MODE_CLDEMOTE[parent->value][index];
default:
ZYAN_UNREACHABLE;
}
}
void ZydisGetInstructionEncodingInfo(const ZydisDecoderTreeNode* node,
const ZydisInstructionEncodingInfo** info)
{
ZYAN_ASSERT(node->type & ZYDIS_NODETYPE_DEFINITION_MASK);
const ZyanU8 class = (node->type) & 0x7F;
ZYAN_ASSERT(class < ZYAN_ARRAY_LENGTH(INSTR_ENCODINGS));
*info = &INSTR_ENCODINGS[class];
}
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */