aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2013-10-03 05:17:48 +0000
committerCraig Topper <craig.topper@gmail.com>2013-10-03 05:17:48 +0000
commit9e3e38ae3f002191ac171d41b15ca0c7608c646c (patch)
tree9b677a371d8b5c81d4d86be7a494a76753b1f8c4 /llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
parentaf4b2eec9e1d93242df7caadbe33c27b8336a8c9 (diff)
downloadllvm-9e3e38ae3f002191ac171d41b15ca0c7608c646c.zip
llvm-9e3e38ae3f002191ac171d41b15ca0c7608c646c.tar.gz
llvm-9e3e38ae3f002191ac171d41b15ca0c7608c646c.tar.bz2
Add XOP disassembler support. Fixes PR13933.
llvm-svn: 191874
Diffstat (limited to 'llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h')
-rw-r--r--llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
index 4fd8fb7..bd9a651 100644
--- a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
+++ b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
@@ -59,6 +59,15 @@ extern "C" {
#define lFromVEX2of2(vex) (((vex) & 0x4) >> 2)
#define ppFromVEX2of2(vex) ((vex) & 0x3)
+#define rFromXOP2of3(xop) (((~(xop)) & 0x80) >> 7)
+#define xFromXOP2of3(xop) (((~(xop)) & 0x40) >> 6)
+#define bFromXOP2of3(xop) (((~(xop)) & 0x20) >> 5)
+#define mmmmmFromXOP2of3(xop) ((xop) & 0x1f)
+#define wFromXOP3of3(xop) (((xop) & 0x80) >> 7)
+#define vvvvFromXOP3of3(vex) (((~(vex)) & 0x78) >> 3)
+#define lFromXOP3of3(xop) (((xop) & 0x4) >> 2)
+#define ppFromXOP3of3(xop) ((xop) & 0x3)
+
/*
* These enums represent Intel registers for use by the decoder.
*/
@@ -444,9 +453,15 @@ typedef enum {
typedef enum {
VEX_LOB_0F = 0x1,
VEX_LOB_0F38 = 0x2,
- VEX_LOB_0F3A = 0x3
+ VEX_LOB_0F3A = 0x3,
} VEXLeadingOpcodeByte;
+typedef enum {
+ XOP_MAP_SELECT_8 = 0x8,
+ XOP_MAP_SELECT_9 = 0x9,
+ XOP_MAP_SELECT_A = 0xA
+} XOPMapSelect;
+
/*
* VEXPrefixCode - Possible values for the VEX.pp field
*/
@@ -458,6 +473,13 @@ typedef enum {
VEX_PREFIX_F2 = 0x3
} VEXPrefixCode;
+typedef enum {
+ TYPE_NO_VEX_XOP = 0x0,
+ TYPE_VEX_2B = 0x1,
+ TYPE_VEX_3B = 0x2,
+ TYPE_XOP = 0x3
+} VEXXOPType;
+
typedef uint8_t BOOL;
/*
@@ -514,10 +536,10 @@ struct InternalInstruction {
uint8_t prefixPresent[0x100];
/* contains the location (for use with the reader) of the prefix byte */
uint64_t prefixLocations[0x100];
- /* The value of the VEX prefix, if present */
- uint8_t vexPrefix[3];
+ /* The value of the VEX/XOP prefix, if present */
+ uint8_t vexXopPrefix[3];
/* The length of the VEX prefix (0 if not present) */
- uint8_t vexSize;
+ VEXXOPType vexXopType;
/* The value of the REX prefix, if present */
uint8_t rexPrefix;
/* The location where a mandatory prefix would have to be (i.e., right before