llvm.org GIT mirror llvm / 75116bc
Put some of the X86 formats in a more logical order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201645 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 5 years ago
3 changed file(s) with 68 addition(s) and 68 deletion(s). Raw diff Collapse all Expand all
271271 /// destination index register DI/ESI/RDI.
272272 RawFrmDstSrc = 10,
273273
274 /// MRMX[rm] - The forms are used to represent instructions that use a
275 /// Mod/RM byte, and don't use the middle field for anything.
276 MRMXr = 14, MRMXm = 15,
277
278 /// MRM[0-7][rm] - These forms are used to represent instructions that use
279 /// a Mod/RM byte, and use the middle field to hold extended opcode
280 /// information. In the intel manual these are represented as /0, /1, ...
281 ///
282
283 // First, instructions that operate on a register r/m operand...
284 MRM0r = 16, MRM1r = 17, MRM2r = 18, MRM3r = 19, // Format /0 /1 /2 /3
285 MRM4r = 20, MRM5r = 21, MRM6r = 22, MRM7r = 23, // Format /4 /5 /6 /7
286
287 // Next, instructions that operate on a memory r/m operand...
288 MRM0m = 24, MRM1m = 25, MRM2m = 26, MRM3m = 27, // Format /0 /1 /2 /3
289 MRM4m = 28, MRM5m = 29, MRM6m = 30, MRM7m = 31, // Format /4 /5 /6 /7
290
291 //// MRM_XX - A mod/rm byte of exactly 0xXX.
292 MRM_C0 = 32, MRM_C1 = 33, MRM_C2 = 34, MRM_C3 = 35,
293 MRM_C4 = 36, MRM_C8 = 37, MRM_C9 = 38, MRM_CA = 39,
294 MRM_CB = 40, MRM_E8 = 41, MRM_F0 = 42, MRM_F8 = 45,
295 MRM_F9 = 46, MRM_D0 = 47, MRM_D1 = 48, MRM_D4 = 49,
296 MRM_D5 = 50, MRM_D6 = 51, MRM_D8 = 52, MRM_D9 = 53,
297 MRM_DA = 54, MRM_DB = 55, MRM_DC = 56, MRM_DD = 57,
298 MRM_DE = 58, MRM_DF = 59, MRM_E0 = 60,
299
300274 /// RawFrmImm8 - This is used for the ENTER instruction, which has two
301275 /// immediates, the first of which is a 16-bit immediate (specified by
302276 /// the imm encoding) and the second is a 8-bit fixed value.
303 RawFrmImm8 = 43,
277 RawFrmImm8 = 11,
304278
305279 /// RawFrmImm16 - This is used for CALL FAR instructions, which have two
306280 /// immediates, the first of which is a 16 or 32-bit immediate (specified by
307281 /// the imm encoding) and the second is a 16-bit fixed value. In the AMD
308282 /// manual, this operand is described as pntr16:32 and pntr16:16
309 RawFrmImm16 = 44,
283 RawFrmImm16 = 12,
284
285 /// MRMX[rm] - The forms are used to represent instructions that use a
286 /// Mod/RM byte, and don't use the middle field for anything.
287 MRMXr = 14, MRMXm = 15,
288
289 /// MRM[0-7][rm] - These forms are used to represent instructions that use
290 /// a Mod/RM byte, and use the middle field to hold extended opcode
291 /// information. In the intel manual these are represented as /0, /1, ...
292 ///
293
294 // First, instructions that operate on a register r/m operand...
295 MRM0r = 16, MRM1r = 17, MRM2r = 18, MRM3r = 19, // Format /0 /1 /2 /3
296 MRM4r = 20, MRM5r = 21, MRM6r = 22, MRM7r = 23, // Format /4 /5 /6 /7
297
298 // Next, instructions that operate on a memory r/m operand...
299 MRM0m = 24, MRM1m = 25, MRM2m = 26, MRM3m = 27, // Format /0 /1 /2 /3
300 MRM4m = 28, MRM5m = 29, MRM6m = 30, MRM7m = 31, // Format /4 /5 /6 /7
301
302 //// MRM_XX - A mod/rm byte of exactly 0xXX.
303 MRM_C0 = 32, MRM_C1 = 33, MRM_C2 = 34, MRM_C3 = 35,
304 MRM_C4 = 36, MRM_C8 = 37, MRM_C9 = 38, MRM_CA = 39,
305 MRM_CB = 40, MRM_D0 = 41, MRM_D1 = 42, MRM_D4 = 43,
306 MRM_D5 = 44, MRM_D6 = 45, MRM_D8 = 46, MRM_D9 = 47,
307 MRM_DA = 48, MRM_DB = 49, MRM_DC = 50, MRM_DD = 51,
308 MRM_DE = 52, MRM_DF = 53, MRM_E0 = 54, MRM_E8 = 55,
309 MRM_F0 = 56, MRM_F8 = 57, MRM_F9 = 58,
310310
311311 FormMask = 63,
312312
2323 def MRMSrcMem : Format<6>; def RawFrmMemOffs : Format<7>;
2424 def RawFrmSrc : Format<8>; def RawFrmDst : Format<9>;
2525 def RawFrmDstSrc: Format<10>;
26 def RawFrmImm8 : Format<11>;
27 def RawFrmImm16 : Format<12>;
2628 def MRMXr : Format<14>; def MRMXm : Format<15>;
2729 def MRM0r : Format<16>; def MRM1r : Format<17>; def MRM2r : Format<18>;
2830 def MRM3r : Format<19>; def MRM4r : Format<20>; def MRM5r : Format<21>;
3941 def MRM_C9 : Format<38>;
4042 def MRM_CA : Format<39>;
4143 def MRM_CB : Format<40>;
42 def MRM_E8 : Format<41>;
43 def MRM_F0 : Format<42>;
44 def RawFrmImm8 : Format<43>;
45 def RawFrmImm16 : Format<44>;
46 def MRM_F8 : Format<45>;
47 def MRM_F9 : Format<46>;
48 def MRM_D0 : Format<47>;
49 def MRM_D1 : Format<48>;
50 def MRM_D4 : Format<49>;
51 def MRM_D5 : Format<50>;
52 def MRM_D6 : Format<51>;
53 def MRM_D8 : Format<52>;
54 def MRM_D9 : Format<53>;
55 def MRM_DA : Format<54>;
56 def MRM_DB : Format<55>;
57 def MRM_DC : Format<56>;
58 def MRM_DD : Format<57>;
59 def MRM_DE : Format<58>;
60 def MRM_DF : Format<59>;
61 def MRM_E0 : Format<60>;
44 def MRM_D0 : Format<41>;
45 def MRM_D1 : Format<42>;
46 def MRM_D4 : Format<43>;
47 def MRM_D5 : Format<44>;
48 def MRM_D6 : Format<45>;
49 def MRM_D8 : Format<46>;
50 def MRM_D9 : Format<47>;
51 def MRM_DA : Format<48>;
52 def MRM_DB : Format<49>;
53 def MRM_DC : Format<50>;
54 def MRM_DD : Format<51>;
55 def MRM_DE : Format<52>;
56 def MRM_DF : Format<53>;
57 def MRM_E0 : Format<54>;
58 def MRM_E8 : Format<55>;
59 def MRM_F0 : Format<56>;
60 def MRM_F8 : Format<57>;
61 def MRM_F9 : Format<58>;
6262
6363 // ImmType - This specifies the immediate type used by an instruction. This is
6464 // part of the ad-hoc solution used to emit machine instruction encodings by our
3131 MAP(C9, 38) \
3232 MAP(CA, 39) \
3333 MAP(CB, 40) \
34 MAP(E8, 41) \
35 MAP(F0, 42) \
36 MAP(F8, 45) \
37 MAP(F9, 46) \
38 MAP(D0, 47) \
39 MAP(D1, 48) \
40 MAP(D4, 49) \
41 MAP(D5, 50) \
42 MAP(D6, 51) \
43 MAP(D8, 52) \
44 MAP(D9, 53) \
45 MAP(DA, 54) \
46 MAP(DB, 55) \
47 MAP(DC, 56) \
48 MAP(DD, 57) \
49 MAP(DE, 58) \
50 MAP(DF, 59) \
51 MAP(E0, 60)
34 MAP(D0, 41) \
35 MAP(D1, 42) \
36 MAP(D4, 43) \
37 MAP(D5, 44) \
38 MAP(D6, 45) \
39 MAP(D8, 46) \
40 MAP(D9, 47) \
41 MAP(DA, 48) \
42 MAP(DB, 49) \
43 MAP(DC, 50) \
44 MAP(DD, 51) \
45 MAP(DE, 52) \
46 MAP(DF, 53) \
47 MAP(E0, 54) \
48 MAP(E8, 55) \
49 MAP(F0, 56) \
50 MAP(F8, 57) \
51 MAP(F9, 58)
5252
5353 // A clone of X86 since we can't depend on something that is generated.
5454 namespace X86Local {
6464 RawFrmSrc = 8,
6565 RawFrmDst = 9,
6666 RawFrmDstSrc = 10,
67 RawFrmImm8 = 11,
68 RawFrmImm16 = 12,
6769 MRMXr = 14, MRMXm = 15,
6870 MRM0r = 16, MRM1r = 17, MRM2r = 18, MRM3r = 19,
6971 MRM4r = 20, MRM5r = 21, MRM6r = 22, MRM7r = 23,
7072 MRM0m = 24, MRM1m = 25, MRM2m = 26, MRM3m = 27,
7173 MRM4m = 28, MRM5m = 29, MRM6m = 30, MRM7m = 31,
72 RawFrmImm8 = 43,
73 RawFrmImm16 = 44,
7474 #define MAP(from, to) MRM_##from = to,
7575 MRM_MAPPING
7676 #undef MAP