diff --git a/lib/Target/X86/MCTargetDesc/X86BaseInfo.h b/lib/Target/X86/MCTargetDesc/X86BaseInfo.h index e41e9a37392..d50c47d3506 100644 --- a/lib/Target/X86/MCTargetDesc/X86BaseInfo.h +++ b/lib/Target/X86/MCTargetDesc/X86BaseInfo.h @@ -272,6 +272,17 @@ namespace X86II { /// destination index register DI/ESI/RDI. RawFrmDstSrc = 10, + /// RawFrmImm8 - This is used for the ENTER instruction, which has two + /// immediates, the first of which is a 16-bit immediate (specified by + /// the imm encoding) and the second is a 8-bit fixed value. + RawFrmImm8 = 11, + + /// RawFrmImm16 - This is used for CALL FAR instructions, which have two + /// immediates, the first of which is a 16 or 32-bit immediate (specified by + /// the imm encoding) and the second is a 16-bit fixed value. In the AMD + /// manual, this operand is described as pntr16:32 and pntr16:16 + RawFrmImm16 = 12, + /// MRMX[rm] - The forms are used to represent instructions that use a /// Mod/RM byte, and don't use the middle field for anything. MRMXr = 14, MRMXm = 15, @@ -292,22 +303,11 @@ namespace X86II { //// MRM_XX - A mod/rm byte of exactly 0xXX. MRM_C0 = 32, MRM_C1 = 33, MRM_C2 = 34, MRM_C3 = 35, MRM_C4 = 36, MRM_C8 = 37, MRM_C9 = 38, MRM_CA = 39, - MRM_CB = 40, MRM_E8 = 41, MRM_F0 = 42, MRM_F8 = 45, - MRM_F9 = 46, MRM_D0 = 47, MRM_D1 = 48, MRM_D4 = 49, - MRM_D5 = 50, MRM_D6 = 51, MRM_D8 = 52, MRM_D9 = 53, - MRM_DA = 54, MRM_DB = 55, MRM_DC = 56, MRM_DD = 57, - MRM_DE = 58, MRM_DF = 59, MRM_E0 = 60, - - /// RawFrmImm8 - This is used for the ENTER instruction, which has two - /// immediates, the first of which is a 16-bit immediate (specified by - /// the imm encoding) and the second is a 8-bit fixed value. - RawFrmImm8 = 43, - - /// RawFrmImm16 - This is used for CALL FAR instructions, which have two - /// immediates, the first of which is a 16 or 32-bit immediate (specified by - /// the imm encoding) and the second is a 16-bit fixed value. In the AMD - /// manual, this operand is described as pntr16:32 and pntr16:16 - RawFrmImm16 = 44, + MRM_CB = 40, MRM_D0 = 41, MRM_D1 = 42, MRM_D4 = 43, + MRM_D5 = 44, MRM_D6 = 45, MRM_D8 = 46, MRM_D9 = 47, + MRM_DA = 48, MRM_DB = 49, MRM_DC = 50, MRM_DD = 51, + MRM_DE = 52, MRM_DF = 53, MRM_E0 = 54, MRM_E8 = 55, + MRM_F0 = 56, MRM_F8 = 57, MRM_F9 = 58, FormMask = 63, diff --git a/lib/Target/X86/X86InstrFormats.td b/lib/Target/X86/X86InstrFormats.td index f1cea2eaeda..328083d4ef4 100644 --- a/lib/Target/X86/X86InstrFormats.td +++ b/lib/Target/X86/X86InstrFormats.td @@ -24,6 +24,8 @@ def MRMDestMem : Format<4>; def MRMSrcReg : Format<5>; def MRMSrcMem : Format<6>; def RawFrmMemOffs : Format<7>; def RawFrmSrc : Format<8>; def RawFrmDst : Format<9>; def RawFrmDstSrc: Format<10>; +def RawFrmImm8 : Format<11>; +def RawFrmImm16 : Format<12>; def MRMXr : Format<14>; def MRMXm : Format<15>; def MRM0r : Format<16>; def MRM1r : Format<17>; def MRM2r : Format<18>; def MRM3r : Format<19>; def MRM4r : Format<20>; def MRM5r : Format<21>; @@ -40,26 +42,24 @@ def MRM_C8 : Format<37>; def MRM_C9 : Format<38>; def MRM_CA : Format<39>; def MRM_CB : Format<40>; -def MRM_E8 : Format<41>; -def MRM_F0 : Format<42>; -def RawFrmImm8 : Format<43>; -def RawFrmImm16 : Format<44>; -def MRM_F8 : Format<45>; -def MRM_F9 : Format<46>; -def MRM_D0 : Format<47>; -def MRM_D1 : Format<48>; -def MRM_D4 : Format<49>; -def MRM_D5 : Format<50>; -def MRM_D6 : Format<51>; -def MRM_D8 : Format<52>; -def MRM_D9 : Format<53>; -def MRM_DA : Format<54>; -def MRM_DB : Format<55>; -def MRM_DC : Format<56>; -def MRM_DD : Format<57>; -def MRM_DE : Format<58>; -def MRM_DF : Format<59>; -def MRM_E0 : Format<60>; +def MRM_D0 : Format<41>; +def MRM_D1 : Format<42>; +def MRM_D4 : Format<43>; +def MRM_D5 : Format<44>; +def MRM_D6 : Format<45>; +def MRM_D8 : Format<46>; +def MRM_D9 : Format<47>; +def MRM_DA : Format<48>; +def MRM_DB : Format<49>; +def MRM_DC : Format<50>; +def MRM_DD : Format<51>; +def MRM_DE : Format<52>; +def MRM_DF : Format<53>; +def MRM_E0 : Format<54>; +def MRM_E8 : Format<55>; +def MRM_F0 : Format<56>; +def MRM_F8 : Format<57>; +def MRM_F9 : Format<58>; // ImmType - This specifies the immediate type used by an instruction. This is // part of the ad-hoc solution used to emit machine instruction encodings by our diff --git a/utils/TableGen/X86RecognizableInstr.cpp b/utils/TableGen/X86RecognizableInstr.cpp index 1b5b9658922..1a6af715f62 100644 --- a/utils/TableGen/X86RecognizableInstr.cpp +++ b/utils/TableGen/X86RecognizableInstr.cpp @@ -32,24 +32,24 @@ using namespace llvm; MAP(C9, 38) \ MAP(CA, 39) \ MAP(CB, 40) \ - MAP(E8, 41) \ - MAP(F0, 42) \ - MAP(F8, 45) \ - MAP(F9, 46) \ - MAP(D0, 47) \ - MAP(D1, 48) \ - MAP(D4, 49) \ - MAP(D5, 50) \ - MAP(D6, 51) \ - MAP(D8, 52) \ - MAP(D9, 53) \ - MAP(DA, 54) \ - MAP(DB, 55) \ - MAP(DC, 56) \ - MAP(DD, 57) \ - MAP(DE, 58) \ - MAP(DF, 59) \ - MAP(E0, 60) + MAP(D0, 41) \ + MAP(D1, 42) \ + MAP(D4, 43) \ + MAP(D5, 44) \ + MAP(D6, 45) \ + MAP(D8, 46) \ + MAP(D9, 47) \ + MAP(DA, 48) \ + MAP(DB, 49) \ + MAP(DC, 50) \ + MAP(DD, 51) \ + MAP(DE, 52) \ + MAP(DF, 53) \ + MAP(E0, 54) \ + MAP(E8, 55) \ + MAP(F0, 56) \ + MAP(F8, 57) \ + MAP(F9, 58) // A clone of X86 since we can't depend on something that is generated. namespace X86Local { @@ -65,13 +65,13 @@ namespace X86Local { RawFrmSrc = 8, RawFrmDst = 9, RawFrmDstSrc = 10, + RawFrmImm8 = 11, + RawFrmImm16 = 12, MRMXr = 14, MRMXm = 15, MRM0r = 16, MRM1r = 17, MRM2r = 18, MRM3r = 19, MRM4r = 20, MRM5r = 21, MRM6r = 22, MRM7r = 23, MRM0m = 24, MRM1m = 25, MRM2m = 26, MRM3m = 27, MRM4m = 28, MRM5m = 29, MRM6m = 30, MRM7m = 31, - RawFrmImm8 = 43, - RawFrmImm16 = 44, #define MAP(from, to) MRM_##from = to, MRM_MAPPING #undef MAP