#include "../../MCInst.h"
#include "../../LEB128.h"
#define FieldFromInstruction(fname, InsnType) \
static InsnType fname(InsnType insn, unsigned startBit, unsigned numBits) \
{ \
InsnType fieldMask; \
if (numBits == sizeof(InsnType)*8) \
fieldMask = (InsnType)(-1LL); \
else \
fieldMask = (((InsnType)1 << numBits) - 1) << startBit; \
return (insn & fieldMask) >> startBit; \
}
static const uint8_t DecoderTable16[] = {
MCD_OPC_ExtractField, 11, 5, MCD_OPC_FilterValue, 0, 108, 0, MCD_OPC_ExtractField, 0, 11, MCD_OPC_FilterValue, 236, 15, 4, 0, MCD_OPC_Decode, 243, 1, 0, MCD_OPC_FilterValue, 237, 15, 3, 0, MCD_OPC_Decode, 59, 0, MCD_OPC_FilterValue, 238, 15, 4, 0, MCD_OPC_Decode, 218, 1, 0, MCD_OPC_FilterValue, 239, 15, 3, 0, MCD_OPC_Decode, 93, 0, MCD_OPC_FilterValue, 252, 15, 3, 0, MCD_OPC_Decode, 68, 0, MCD_OPC_FilterValue, 253, 15, 3, 0, MCD_OPC_Decode, 125, 0, MCD_OPC_FilterValue, 254, 15, 3, 0, MCD_OPC_Decode, 74, 0, MCD_OPC_FilterValue, 255, 15, 4, 0, MCD_OPC_Decode, 199, 1, 0, MCD_OPC_ExtractField, 4, 7, MCD_OPC_FilterValue, 126, 3, 0, MCD_OPC_Decode, 77, 1, MCD_OPC_FilterValue, 127, 3, 0, MCD_OPC_Decode, 80, 1, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 111, 2, MCD_OPC_FilterValue, 1, 3, 0, MCD_OPC_Decode, 105, 2, MCD_OPC_Decode, 230, 1, 3, MCD_OPC_FilterValue, 1, 114, 0, MCD_OPC_ExtractField, 0, 11, MCD_OPC_FilterValue, 236, 15, 4, 0, MCD_OPC_Decode, 152, 1, 0, MCD_OPC_FilterValue, 237, 15, 4, 0, MCD_OPC_Decode, 223, 1, 0, MCD_OPC_FilterValue, 238, 15, 4, 0, MCD_OPC_Decode, 153, 1, 0, MCD_OPC_FilterValue, 239, 15, 4, 0, MCD_OPC_Decode, 224, 1, 0, MCD_OPC_FilterValue, 252, 15, 4, 0, MCD_OPC_Decode, 222, 1, 0, MCD_OPC_FilterValue, 253, 15, 4, 0, MCD_OPC_Decode, 221, 1, 0, MCD_OPC_FilterValue, 254, 15, 3, 0, MCD_OPC_Decode, 95, 0, MCD_OPC_FilterValue, 255, 15, 3, 0, MCD_OPC_Decode, 96, 0, MCD_OPC_ExtractField, 4, 7, MCD_OPC_FilterValue, 126, 4, 0, MCD_OPC_Decode, 242, 1, 1, MCD_OPC_FilterValue, 127, 4, 0, MCD_OPC_Decode, 241, 1, 1, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 109, 2, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 183, 1, 4, MCD_OPC_Decode, 163, 1, 3, MCD_OPC_FilterValue, 2, 100, 0, MCD_OPC_ExtractField, 0, 11, MCD_OPC_FilterValue, 236, 15, 3, 0, MCD_OPC_Decode, 69, 0, MCD_OPC_FilterValue, 237, 15, 3, 0, MCD_OPC_Decode, 73, 0, MCD_OPC_FilterValue, 238, 15, 3, 0, MCD_OPC_Decode, 97, 0, MCD_OPC_FilterValue, 239, 15, 3, 0, MCD_OPC_Decode, 98, 0, MCD_OPC_FilterValue, 252, 15, 3, 0, MCD_OPC_Decode, 99, 0, MCD_OPC_FilterValue, 253, 15, 4, 0, MCD_OPC_Decode, 151, 1, 0, MCD_OPC_FilterValue, 254, 15, 4, 0, MCD_OPC_Decode, 149, 1, 0, MCD_OPC_ExtractField, 4, 7, MCD_OPC_FilterValue, 126, 3, 0, MCD_OPC_Decode, 92, 1, MCD_OPC_FilterValue, 127, 4, 0, MCD_OPC_Decode, 171, 1, 1, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 112, 2, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 197, 1, 4, MCD_OPC_Decode, 23, 5, MCD_OPC_FilterValue, 3, 41, 0, MCD_OPC_ExtractField, 4, 7, MCD_OPC_FilterValue, 126, 4, 0, MCD_OPC_Decode, 240, 1, 1, MCD_OPC_FilterValue, 127, 4, 0, MCD_OPC_Decode, 174, 1, 1, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 108, 2, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 238, 1, 6, MCD_OPC_Decode, 233, 1, 5, MCD_OPC_FilterValue, 4, 30, 0, MCD_OPC_ExtractField, 4, 7, MCD_OPC_FilterValue, 126, 3, 0, MCD_OPC_Decode, 36, 1, MCD_OPC_FilterValue, 127, 3, 0, MCD_OPC_Decode, 30, 1, MCD_OPC_CheckField, 4, 1, 1, 3, 0, MCD_OPC_Decode, 79, 2, MCD_OPC_Decode, 215, 1, 5, MCD_OPC_FilterValue, 5, 39, 0, MCD_OPC_ExtractField, 4, 7, MCD_OPC_FilterValue, 126, 3, 0, MCD_OPC_Decode, 53, 1, MCD_OPC_FilterValue, 127, 4, 0, MCD_OPC_Decode, 205, 1, 1, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 26, 7, MCD_OPC_FilterValue, 1, 3, 0, MCD_OPC_Decode, 78, 2, MCD_OPC_Decode, 217, 1, 5, MCD_OPC_FilterValue, 6, 41, 0, MCD_OPC_ExtractField, 4, 7, MCD_OPC_FilterValue, 126, 4, 0, MCD_OPC_Decode, 196, 1, 1, MCD_OPC_FilterValue, 127, 4, 0, MCD_OPC_Decode, 192, 1, 1, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 212, 1, 7, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 213, 1, 8, MCD_OPC_Decode, 86, 5, MCD_OPC_FilterValue, 7, 39, 0, MCD_OPC_ExtractField, 4, 7, MCD_OPC_FilterValue, 126, 3, 0, MCD_OPC_Decode, 70, 1, MCD_OPC_FilterValue, 127, 4, 0, MCD_OPC_Decode, 198, 1, 1, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 106, 2, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 203, 1, 4, MCD_OPC_Decode, 27, 5, MCD_OPC_FilterValue, 8, 41, 0, MCD_OPC_ExtractField, 4, 7, MCD_OPC_FilterValue, 126, 3, 0, MCD_OPC_Decode, 118, 1, MCD_OPC_FilterValue, 127, 4, 0, MCD_OPC_Decode, 211, 1, 1, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 245, 1, 7, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 246, 1, 8, MCD_OPC_Decode, 178, 1, 5, MCD_OPC_FilterValue, 9, 40, 0, MCD_OPC_ExtractField, 4, 7, MCD_OPC_FilterValue, 126, 3, 0, MCD_OPC_Decode, 75, 1, MCD_OPC_FilterValue, 127, 3, 0, MCD_OPC_Decode, 76, 1, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 179, 1, 2, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 180, 1, 9, MCD_OPC_Decode, 164, 1, 5, MCD_OPC_FilterValue, 10, 19, 0, MCD_OPC_ExtractField, 10, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 226, 1, 10, MCD_OPC_FilterValue, 1, 54, 2, MCD_OPC_Decode, 229, 1, 10, MCD_OPC_FilterValue, 11, 19, 0, MCD_OPC_ExtractField, 10, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 159, 1, 10, MCD_OPC_FilterValue, 1, 31, 2, MCD_OPC_Decode, 162, 1, 10, MCD_OPC_FilterValue, 12, 19, 0, MCD_OPC_ExtractField, 10, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 141, 1, 10, MCD_OPC_FilterValue, 1, 8, 2, MCD_OPC_Decode, 146, 1, 10, MCD_OPC_FilterValue, 13, 19, 0, MCD_OPC_ExtractField, 10, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 148, 1, 10, MCD_OPC_FilterValue, 1, 241, 1, MCD_OPC_Decode, 156, 1, 10, MCD_OPC_FilterValue, 14, 80, 0, MCD_OPC_ExtractField, 10, 1, MCD_OPC_FilterValue, 0, 34, 0, MCD_OPC_ExtractField, 6, 4, MCD_OPC_FilterValue, 12, 3, 0, MCD_OPC_Decode, 52, 11, MCD_OPC_FilterValue, 13, 3, 0, MCD_OPC_Decode, 35, 11, MCD_OPC_FilterValue, 14, 3, 0, MCD_OPC_Decode, 88, 11, MCD_OPC_FilterValue, 15, 3, 0, MCD_OPC_Decode, 120, 11, MCD_OPC_Decode, 50, 12, MCD_OPC_FilterValue, 1, 188, 1, MCD_OPC_ExtractField, 6, 4, MCD_OPC_FilterValue, 12, 3, 0, MCD_OPC_Decode, 46, 13, MCD_OPC_FilterValue, 13, 3, 0, MCD_OPC_Decode, 84, 11, MCD_OPC_FilterValue, 14, 3, 0, MCD_OPC_Decode, 90, 11, MCD_OPC_FilterValue, 15, 4, 0, MCD_OPC_Decode, 189, 1, 11, MCD_OPC_Decode, 44, 14, MCD_OPC_FilterValue, 15, 67, 0, MCD_OPC_ExtractField, 10, 1, MCD_OPC_FilterValue, 0, 35, 0, MCD_OPC_ExtractField, 6, 4, MCD_OPC_FilterValue, 12, 3, 0, MCD_OPC_Decode, 64, 11, MCD_OPC_FilterValue, 13, 4, 0, MCD_OPC_Decode, 209, 1, 11, MCD_OPC_FilterValue, 14, 3, 0, MCD_OPC_Decode, 122, 11, MCD_OPC_FilterValue, 15, 3, 0, MCD_OPC_Decode, 124, 11, MCD_OPC_Decode, 48, 12, MCD_OPC_FilterValue, 1, 103, 1, MCD_OPC_ExtractField, 6, 4, MCD_OPC_FilterValue, 12, 3, 0, MCD_OPC_Decode, 104, 11, MCD_OPC_FilterValue, 13, 4, 0, MCD_OPC_Decode, 139, 1, 11, MCD_OPC_Decode, 42, 14, MCD_OPC_FilterValue, 16, 38, 0, MCD_OPC_ExtractField, 4, 7, MCD_OPC_FilterValue, 126, 3, 0, MCD_OPC_Decode, 60, 1, MCD_OPC_FilterValue, 127, 4, 0, MCD_OPC_Decode, 234, 1, 1, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 102, 9, MCD_OPC_FilterValue, 1, 3, 0, MCD_OPC_Decode, 107, 2, MCD_OPC_Decode, 127, 5, MCD_OPC_FilterValue, 17, 22, 0, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 177, 1, 2, MCD_OPC_FilterValue, 1, 3, 0, MCD_OPC_Decode, 115, 2, MCD_OPC_Decode, 128, 1, 5, MCD_OPC_FilterValue, 18, 21, 0, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 176, 1, 2, MCD_OPC_FilterValue, 1, 3, 0, MCD_OPC_Decode, 82, 2, MCD_OPC_Decode, 22, 3, MCD_OPC_FilterValue, 19, 4, 0, MCD_OPC_Decode, 232, 1, 3, MCD_OPC_FilterValue, 20, 23, 0, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 172, 1, 2, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 173, 1, 15, MCD_OPC_Decode, 214, 1, 16, MCD_OPC_FilterValue, 21, 23, 0, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 184, 1, 4, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 182, 1, 7, MCD_OPC_Decode, 216, 1, 16, MCD_OPC_FilterValue, 22, 20, 0, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 116, 2, MCD_OPC_FilterValue, 1, 3, 0, MCD_OPC_Decode, 114, 7, MCD_OPC_Decode, 85, 3, MCD_OPC_FilterValue, 23, 23, 0, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 185, 1, 2, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 235, 1, 2, MCD_OPC_Decode, 239, 1, 17, MCD_OPC_FilterValue, 24, 23, 0, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 201, 1, 4, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 237, 1, 2, MCD_OPC_Decode, 166, 1, 5, MCD_OPC_FilterValue, 25, 21, 0, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 57, 2, MCD_OPC_FilterValue, 1, 3, 0, MCD_OPC_Decode, 58, 15, MCD_OPC_Decode, 168, 1, 5, MCD_OPC_FilterValue, 26, 17, 0, MCD_OPC_ExtractField, 10, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 40, 18, MCD_OPC_FilterValue, 1, 62, 0, MCD_OPC_Decode, 38, 19, MCD_OPC_FilterValue, 27, 19, 0, MCD_OPC_ExtractField, 10, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 135, 1, 18, MCD_OPC_FilterValue, 1, 40, 0, MCD_OPC_Decode, 132, 1, 19, MCD_OPC_FilterValue, 28, 18, 0, MCD_OPC_ExtractField, 10, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 33, 18, MCD_OPC_FilterValue, 1, 18, 0, MCD_OPC_Decode, 157, 1, 18, MCD_OPC_FilterValue, 29, 10, 0, MCD_OPC_CheckField, 10, 1, 0, 4, 0, MCD_OPC_Decode, 195, 1, 12, MCD_OPC_Fail,
0
};
static const uint8_t DecoderTable32[] = {
MCD_OPC_ExtractField, 27, 5, MCD_OPC_FilterValue, 0, 89, 0, MCD_OPC_ExtractField, 11, 5, MCD_OPC_FilterValue, 31, 216, 3, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 10, 0, MCD_OPC_CheckField, 16, 11, 236, 15, 17, 0, MCD_OPC_Decode, 31, 20, MCD_OPC_FilterValue, 1, 10, 0, MCD_OPC_CheckField, 16, 11, 236, 15, 3, 0, MCD_OPC_Decode, 56, 20, MCD_OPC_CheckField, 16, 11, 236, 15, 4, 0, MCD_OPC_Decode, 231, 1, 21, MCD_OPC_ExtractField, 20, 7, MCD_OPC_FilterValue, 126, 3, 0, MCD_OPC_Decode, 66, 22, MCD_OPC_FilterValue, 127, 4, 0, MCD_OPC_Decode, 170, 1, 23, MCD_OPC_ExtractField, 20, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 150, 1, 24, MCD_OPC_FilterValue, 1, 3, 0, MCD_OPC_Decode, 126, 24, MCD_OPC_Decode, 165, 1, 25, MCD_OPC_FilterValue, 1, 86, 0, MCD_OPC_ExtractField, 11, 5, MCD_OPC_FilterValue, 31, 123, 3, MCD_OPC_ExtractField, 20, 1, MCD_OPC_FilterValue, 0, 116, 3, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 15, 0, MCD_OPC_CheckField, 21, 6, 63, 29, 0, MCD_OPC_CheckField, 16, 4, 12, 23, 0, MCD_OPC_Decode, 65, 20, MCD_OPC_FilterValue, 1, 16, 0, MCD_OPC_CheckField, 21, 6, 63, 10, 0, MCD_OPC_CheckField, 16, 4, 12, 4, 0, MCD_OPC_Decode, 191, 1, 26, MCD_OPC_CheckField, 21, 6, 63, 10, 0, MCD_OPC_CheckField, 16, 4, 12, 4, 0, MCD_OPC_Decode, 244, 1, 21, MCD_OPC_CheckField, 21, 6, 63, 4, 0, MCD_OPC_Decode, 169, 1, 23, MCD_OPC_Decode, 167, 1, 24, MCD_OPC_FilterValue, 2, 29, 0, MCD_OPC_ExtractField, 11, 16, MCD_OPC_FilterValue, 159, 251, 3, 31, 3, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 3, 0, MCD_OPC_Decode, 110, 20, MCD_OPC_FilterValue, 1, 3, 0, MCD_OPC_Decode, 101, 20, MCD_OPC_Decode, 29, 21, MCD_OPC_FilterValue, 3, 31, 0, MCD_OPC_ExtractField, 11, 16, MCD_OPC_FilterValue, 159, 251, 3, 254, 2, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 202, 1, 26, MCD_OPC_FilterValue, 1, 3, 0, MCD_OPC_Decode, 94, 20, MCD_OPC_Decode, 144, 1, 21, MCD_OPC_FilterValue, 4, 32, 0, MCD_OPC_ExtractField, 11, 16, MCD_OPC_FilterValue, 159, 251, 3, 219, 2, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 236, 1, 20, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 210, 1, 26, MCD_OPC_Decode, 137, 1, 21, MCD_OPC_FilterValue, 5, 32, 0, MCD_OPC_ExtractField, 11, 16, MCD_OPC_FilterValue, 159, 251, 3, 183, 2, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 204, 1, 26, MCD_OPC_FilterValue, 1, 4, 0, MCD_OPC_Decode, 193, 1, 20, MCD_OPC_Decode, 130, 1, 21, MCD_OPC_FilterValue, 6, 31, 0, MCD_OPC_ExtractField, 11, 16, MCD_OPC_FilterValue, 159, 251, 3, 147, 2, MCD_OPC_ExtractField, 4, 1, MCD_OPC_FilterValue, 0, 4, 0, MCD_OPC_Decode, 200, 1, 26, MCD_OPC_FilterValue, 1, 3, 0, MCD_OPC_Decode, 100, 20, MCD_OPC_Decode, 129, 1, 21, MCD_OPC_FilterValue, 7, 12, 0, MCD_OPC_CheckField, 11, 16, 159, 251, 3, 113, 2, MCD_OPC_Decode, 175, 1, 21, MCD_OPC_FilterValue, 8, 11, 0, MCD_OPC_CheckField, 11, 16, 159, 251, 3, 97, 2, MCD_OPC_Decode, 71, 21, MCD_OPC_FilterValue, 9, 11, 0, MCD_OPC_CheckField, 11, 16, 159, 251, 3, 82, 2, MCD_OPC_Decode, 72, 21, MCD_OPC_FilterValue, 10, 31, 0, MCD_OPC_ExtractField, 26, 1, MCD_OPC_FilterValue, 0, 10, 0, MCD_OPC_CheckField, 10, 6, 60, 62, 2, MCD_OPC_Decode, 225, 1, 27, MCD_OPC_FilterValue, 1, 54, 2, MCD_OPC_CheckField, 10, 6, 60, 48, 2, MCD_OPC_Decode, 228, 1, 27, MCD_OPC_FilterValue, 11, 31, 0, MCD_OPC_ExtractField, 26, 1, MCD_OPC_FilterValue, 0, 10, 0, MCD_OPC_CheckField, 10, 6, 60, 27, 2, MCD_OPC_Decode, 158, 1, 27, MCD_OPC_FilterValue, 1, 19, 2, MCD_OPC_CheckField, 10, 6, 60, 13, 2, MCD_OPC_Decode, 161, 1, 27, MCD_OPC_FilterValue, 12, 31, 0, MCD_OPC_ExtractField, 26, 1, MCD_OPC_FilterValue, 0, 10, 0, MCD_OPC_CheckField, 10, 6, 60, 248, 1, MCD_OPC_Decode, 140, 1, 27, MCD_OPC_FilterValue, 1, 240, 1, MCD_OPC_CheckField, 10, 6, 60, 234, 1, MCD_OPC_Decode, 145, 1, 27, MCD_OPC_FilterValue, 13, 31, 0, MCD_OPC_ExtractField, 26, 1, MCD_OPC_FilterValue, 0, 10, 0, MCD_OPC_CheckField, 10, 6, 60, 213, 1, MCD_OPC_Decode, 147, 1, 27, MCD_OPC_FilterValue, 1, 205, 1, MCD_OPC_CheckField, 10, 6, 60, 199, 1, MCD_OPC_Decode, 154, 1, 27, MCD_OPC_FilterValue, 14, 94, 0, MCD_OPC_ExtractField, 26, 1, MCD_OPC_FilterValue, 0, 41, 0, MCD_OPC_ExtractField, 10, 6, MCD_OPC_FilterValue, 60, 177, 1, MCD_OPC_ExtractField, 22, 4, MCD_OPC_FilterValue, 12, 3, 0, MCD_OPC_Decode, 51, 28, MCD_OPC_FilterValue, 13, 3, 0, MCD_OPC_Decode, 34, 28, MCD_OPC_FilterValue, 14, 3, 0, MCD_OPC_Decode, 87, 28, MCD_OPC_FilterValue, 15, 3, 0, MCD_OPC_Decode, 119, 28, MCD_OPC_Decode, 49, 29, MCD_OPC_FilterValue, 1, 139, 1, MCD_OPC_ExtractField, 10, 6, MCD_OPC_FilterValue, 60, 132, 1, MCD_OPC_ExtractField, 22, 4, MCD_OPC_FilterValue, 12, 3, 0, MCD_OPC_Decode, 45, 30, MCD_OPC_FilterValue, 13, 3, 0, MCD_OPC_Decode, 83, 28, MCD_OPC_FilterValue, 14, 3, 0, MCD_OPC_Decode, 89, 28, MCD_OPC_FilterValue, 15, 4, 0, MCD_OPC_Decode, 188, 1, 28, MCD_OPC_Decode, 43, 31, MCD_OPC_FilterValue, 15, 81, 0, MCD_OPC_ExtractField, 26, 1, MCD_OPC_FilterValue, 0, 42, 0, MCD_OPC_ExtractField, 10, 6, MCD_OPC_FilterValue, 60, 79, 1, MCD_OPC_ExtractField, 22, 4, MCD_OPC_FilterValue, 12, 3, 0, MCD_OPC_Decode, 63, 28, MCD_OPC_FilterValue, 13, 4, 0, MCD_OPC_Decode, 208, 1, 28, MCD_OPC_FilterValue, 14, 3, 0, MCD_OPC_Decode, 121, 28, MCD_OPC_FilterValue, 15, 3, 0, MCD_OPC_Decode, 123, 28, MCD_OPC_Decode, 47, 29, MCD_OPC_FilterValue, 1, 40, 1, MCD_OPC_ExtractField, 10, 6, MCD_OPC_FilterValue, 60, 33, 1, MCD_OPC_ExtractField, 22, 4, MCD_OPC_FilterValue, 12, 3, 0, MCD_OPC_Decode, 103, 28, MCD_OPC_FilterValue, 13, 4, 0, MCD_OPC_Decode, 138, 1, 28, MCD_OPC_Decode, 41, 31, MCD_OPC_FilterValue, 16, 12, 0, MCD_OPC_CheckField, 11, 16, 159, 251, 3, 0, 1, MCD_OPC_Decode, 219, 1, 21, MCD_OPC_FilterValue, 17, 12, 0, MCD_OPC_CheckField, 11, 16, 159, 251, 3, 240, 0, MCD_OPC_Decode, 220, 1, 21, MCD_OPC_FilterValue, 18, 31, 0, MCD_OPC_ExtractField, 11, 16, MCD_OPC_FilterValue, 159, 251, 3, 3, 0, MCD_OPC_Decode, 28, 32, MCD_OPC_FilterValue, 191, 251, 3, 4, 0, MCD_OPC_Decode, 181, 1, 32, MCD_OPC_FilterValue, 223, 251, 3, 204, 0, MCD_OPC_Decode, 113, 32, MCD_OPC_FilterValue, 19, 12, 0, MCD_OPC_CheckField, 11, 16, 159, 251, 3, 189, 0, MCD_OPC_Decode, 143, 1, 33, MCD_OPC_FilterValue, 20, 12, 0, MCD_OPC_CheckField, 11, 16, 159, 251, 3, 173, 0, MCD_OPC_Decode, 136, 1, 33, MCD_OPC_FilterValue, 21, 11, 0, MCD_OPC_CheckField, 11, 16, 159, 251, 3, 157, 0, MCD_OPC_Decode, 67, 34, MCD_OPC_FilterValue, 24, 12, 0, MCD_OPC_CheckField, 11, 16, 159, 251, 3, 142, 0, MCD_OPC_Decode, 186, 1, 21, MCD_OPC_FilterValue, 25, 12, 0, MCD_OPC_CheckField, 11, 16, 159, 251, 3, 126, 0, MCD_OPC_Decode, 187, 1, 21, MCD_OPC_FilterValue, 26, 29, 0, MCD_OPC_ExtractField, 26, 1, MCD_OPC_FilterValue, 0, 9, 0, MCD_OPC_CheckField, 10, 6, 60, 105, 0, MCD_OPC_Decode, 39, 35, MCD_OPC_FilterValue, 1, 98, 0, MCD_OPC_CheckField, 10, 6, 60, 92, 0, MCD_OPC_Decode, 37, 36, MCD_OPC_FilterValue, 27, 31, 0, MCD_OPC_ExtractField, 26, 1, MCD_OPC_FilterValue, 0, 10, 0, MCD_OPC_CheckField, 10, 6, 60, 72, 0, MCD_OPC_Decode, 133, 1, 35, MCD_OPC_FilterValue, 1, 64, 0, MCD_OPC_CheckField, 10, 6, 60, 58, 0, MCD_OPC_Decode, 131, 1, 36, MCD_OPC_FilterValue, 28, 30, 0, MCD_OPC_ExtractField, 26, 1, MCD_OPC_FilterValue, 0, 9, 0, MCD_OPC_CheckField, 10, 6, 60, 37, 0, MCD_OPC_Decode, 32, 35, MCD_OPC_FilterValue, 1, 30, 0, MCD_OPC_CheckField, 10, 6, 60, 24, 0, MCD_OPC_Decode, 155, 1, 35, MCD_OPC_FilterValue, 29, 16, 0, MCD_OPC_CheckField, 26, 1, 0, 10, 0, MCD_OPC_CheckField, 10, 6, 60, 4, 0, MCD_OPC_Decode, 194, 1, 29, MCD_OPC_Fail,
0
};
static bool checkDecoderPredicate(unsigned Idx, uint64_t Bits)
{
return true; }
#define DecodeToMCInst(fname,fieldname, InsnType) \
static DecodeStatus fname(DecodeStatus S, unsigned Idx, InsnType insn, MCInst *MI, \
uint64_t Address, const void *Decoder) \
{ \
InsnType tmp; \
switch (Idx) { \
default: \
case 0: \
return S; \
case 1: \
tmp = fieldname(insn, 0, 4); \
if (DecodeGRRegsRegisterClass(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 2: \
if (Decode2RInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 3: \
if (Decode2RUSInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 4: \
if (DecodeR2RInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 5: \
if (Decode3RInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 6: \
if (Decode2RImmInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 7: \
if (Decode2RSrcDstInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 8: \
if (DecodeRUSSrcDstBitpInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 9: \
if (DecodeRUSInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 10: \
tmp = fieldname(insn, 6, 4); \
if (DecodeRRegsRegisterClass(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
tmp = fieldname(insn, 0, 6); \
MCOperand_CreateImm0(MI, tmp); \
return S; \
case 11: \
tmp = fieldname(insn, 0, 6); \
MCOperand_CreateImm0(MI, tmp); \
return S; \
case 12: \
tmp = fieldname(insn, 6, 4); \
if (DecodeGRRegsRegisterClass(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
tmp = fieldname(insn, 0, 6); \
MCOperand_CreateImm0(MI, tmp); \
return S; \
case 13: \
tmp = fieldname(insn, 0, 6); \
if (DecodeNegImmOperand(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 14: \
tmp = fieldname(insn, 6, 4); \
if (DecodeGRRegsRegisterClass(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
tmp = fieldname(insn, 0, 6); \
if (DecodeNegImmOperand(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 15: \
if (DecodeRUSBitpInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 16: \
if (Decode2RUSBitpInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 17: \
if (Decode3RImmInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 18: \
tmp = fieldname(insn, 0, 10); \
MCOperand_CreateImm0(MI, tmp); \
return S; \
case 19: \
tmp = fieldname(insn, 0, 10); \
if (DecodeNegImmOperand(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 20: \
if (DecodeL2RInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 21: \
if (DecodeL3RInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 22: \
if (DecodeL4RSrcDstInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 23: \
if (DecodeL4RSrcDstSrcDstInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 24: \
if (DecodeL5RInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 25: \
if (DecodeL6RInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 26: \
if (DecodeLR2RInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 27: \
tmp = fieldname(insn, 22, 4); \
if (DecodeRRegsRegisterClass(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
tmp = 0; \
tmp |= (fieldname(insn, 0, 10) << 6); \
tmp |= (fieldname(insn, 16, 6) << 0); \
MCOperand_CreateImm0(MI, tmp); \
return S; \
case 28: \
tmp = 0; \
tmp |= (fieldname(insn, 0, 10) << 6); \
tmp |= (fieldname(insn, 16, 6) << 0); \
MCOperand_CreateImm0(MI, tmp); \
return S; \
case 29: \
tmp = fieldname(insn, 22, 4); \
if (DecodeGRRegsRegisterClass(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
tmp = 0; \
tmp |= (fieldname(insn, 0, 10) << 6); \
tmp |= (fieldname(insn, 16, 6) << 0); \
MCOperand_CreateImm0(MI, tmp); \
return S; \
case 30: \
tmp = 0; \
tmp |= (fieldname(insn, 0, 10) << 6); \
tmp |= (fieldname(insn, 16, 6) << 0); \
if (DecodeNegImmOperand(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 31: \
tmp = fieldname(insn, 22, 4); \
if (DecodeGRRegsRegisterClass(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
tmp = 0; \
tmp |= (fieldname(insn, 0, 10) << 6); \
tmp |= (fieldname(insn, 16, 6) << 0); \
if (DecodeNegImmOperand(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 32: \
if (DecodeL2RUSBitpInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 33: \
if (DecodeL2RUSInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 34: \
if (DecodeL3RSrcDstInstruction(MI, insn, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
case 35: \
tmp = 0; \
tmp |= (fieldname(insn, 0, 10) << 10); \
tmp |= (fieldname(insn, 16, 10) << 0); \
MCOperand_CreateImm0(MI, tmp); \
return S; \
case 36: \
tmp = 0; \
tmp |= (fieldname(insn, 0, 10) << 10); \
tmp |= (fieldname(insn, 16, 10) << 0); \
if (DecodeNegImmOperand(MI, tmp, Address, Decoder) == MCDisassembler_Fail) return MCDisassembler_Fail; \
return S; \
} \
}
#define DecodeInstruction(fname, fieldname, decoder, InsnType) \
static DecodeStatus fname(const uint8_t DecodeTable[], MCInst *MI, \
InsnType insn, uint64_t Address, const MCRegisterInfo *MRI, int feature) \
{ \
uint64_t Bits = getFeatureBits(feature); \
const uint8_t *Ptr = DecodeTable; \
uint32_t CurFieldValue = 0, ExpectedValue; \
DecodeStatus S = MCDisassembler_Success; \
unsigned Start, Len, NumToSkip, PIdx, Opc, DecodeIdx; \
InsnType Val, FieldValue, PositiveMask, NegativeMask; \
bool Pred, Fail; \
for (;;) { \
switch (*Ptr) { \
default: \
return MCDisassembler_Fail; \
case MCD_OPC_ExtractField: { \
Start = *++Ptr; \
Len = *++Ptr; \
++Ptr; \
CurFieldValue = (uint32_t)fieldname(insn, Start, Len); \
break; \
} \
case MCD_OPC_FilterValue: { \
Val = (InsnType)decodeULEB128(++Ptr, &Len); \
Ptr += Len; \
NumToSkip = *Ptr++; \
NumToSkip |= (*Ptr++) << 8; \
if (Val != CurFieldValue) \
Ptr += NumToSkip; \
break; \
} \
case MCD_OPC_CheckField: { \
Start = *++Ptr; \
Len = *++Ptr; \
FieldValue = fieldname(insn, Start, Len); \
ExpectedValue = (uint32_t)decodeULEB128(++Ptr, &Len); \
Ptr += Len; \
NumToSkip = *Ptr++; \
NumToSkip |= (*Ptr++) << 8; \
if (ExpectedValue != FieldValue) \
Ptr += NumToSkip; \
break; \
} \
case MCD_OPC_CheckPredicate: { \
PIdx = (uint32_t)decodeULEB128(++Ptr, &Len); \
Ptr += Len; \
NumToSkip = *Ptr++; \
NumToSkip |= (*Ptr++) << 8; \
Pred = checkDecoderPredicate(PIdx, Bits); \
if (!Pred) \
Ptr += NumToSkip; \
(void)Pred; \
break; \
} \
case MCD_OPC_Decode: { \
Opc = (unsigned)decodeULEB128(++Ptr, &Len); \
Ptr += Len; \
DecodeIdx = (unsigned)decodeULEB128(Ptr, &Len); \
Ptr += Len; \
MCInst_setOpcode(MI, Opc); \
return decoder(S, DecodeIdx, insn, MI, Address, MRI); \
} \
case MCD_OPC_SoftFail: { \
PositiveMask = (InsnType)decodeULEB128(++Ptr, &Len); \
Ptr += Len; \
NegativeMask = (InsnType)decodeULEB128(Ptr, &Len); \
Ptr += Len; \
Fail = (insn & PositiveMask) || (~insn & NegativeMask); \
if (Fail) \
S = MCDisassembler_SoftFail; \
break; \
} \
case MCD_OPC_Fail: { \
return MCDisassembler_Fail; \
} \
} \
} \
}
FieldFromInstruction(fieldFromInstruction_2, uint16_t)
DecodeToMCInst(decodeToMCInst_2, fieldFromInstruction_2, uint16_t)
DecodeInstruction(decodeInstruction_2, fieldFromInstruction_2, decodeToMCInst_2, uint16_t)
FieldFromInstruction(fieldFromInstruction_4, uint32_t)
DecodeToMCInst(decodeToMCInst_4, fieldFromInstruction_4, uint32_t)
DecodeInstruction(decodeInstruction_4, fieldFromInstruction_4, decodeToMCInst_4, uint32_t)