@@ -234,88 +234,94 @@ namespace X86II {
234
234
// / their one register operand added to their opcode.
235
235
AddRegFrm = 2 ,
236
236
237
- // / MRMDestReg - This form is used for instructions that use the Mod/RM byte
238
- // / to specify a destination, which in this case is a register.
239
- // /
240
- MRMDestReg = 3 ,
241
-
242
- // / MRMDestMem - This form is used for instructions that use the Mod/RM byte
243
- // / to specify a destination, which in this case is memory.
244
- // /
245
- MRMDestMem = 4 ,
246
-
247
- // / MRMSrcReg - This form is used for instructions that use the Mod/RM byte
248
- // / to specify a source, which in this case is a register.
249
- // /
250
- MRMSrcReg = 5 ,
251
-
252
- // / MRMSrcMem - This form is used for instructions that use the Mod/RM byte
253
- // / to specify a source, which in this case is memory.
254
- // /
255
- MRMSrcMem = 6 ,
256
-
257
237
// / RawFrmMemOffs - This form is for instructions that store an absolute
258
238
// / memory offset as an immediate with a possible segment override.
259
- RawFrmMemOffs = 7 ,
239
+ RawFrmMemOffs = 3 ,
260
240
261
241
// / RawFrmSrc - This form is for instructions that use the source index
262
242
// / register SI/ESI/RSI with a possible segment override.
263
- RawFrmSrc = 8 ,
243
+ RawFrmSrc = 4 ,
264
244
265
245
// / RawFrmDst - This form is for instructions that use the destination index
266
246
// / register DI/EDI/ESI.
267
- RawFrmDst = 9 ,
247
+ RawFrmDst = 5 ,
268
248
269
249
// / RawFrmSrc - This form is for instructions that use the source index
270
250
// / register SI/ESI/ERI with a possible segment override, and also the
271
251
// / destination index register DI/ESI/RDI.
272
- RawFrmDstSrc = 10 ,
252
+ RawFrmDstSrc = 6 ,
273
253
274
254
// / RawFrmImm8 - This is used for the ENTER instruction, which has two
275
255
// / immediates, the first of which is a 16-bit immediate (specified by
276
256
// / the imm encoding) and the second is a 8-bit fixed value.
277
- RawFrmImm8 = 11 ,
257
+ RawFrmImm8 = 7 ,
278
258
279
259
// / RawFrmImm16 - This is used for CALL FAR instructions, which have two
280
260
// / immediates, the first of which is a 16 or 32-bit immediate (specified by
281
261
// / the imm encoding) and the second is a 16-bit fixed value. In the AMD
282
262
// / manual, this operand is described as pntr16:32 and pntr16:16
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 ,
263
+ RawFrmImm16 = 8 ,
288
264
289
265
// / MRM[0-7][rm] - These forms are used to represent instructions that use
290
266
// / a Mod/RM byte, and use the middle field to hold extended opcode
291
267
// / information. In the intel manual these are represented as /0, /1, ...
292
268
// /
293
269
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
270
+ // / MRMDestMem - This form is used for instructions that use the Mod/RM byte
271
+ // / to specify a destination, which in this case is memory.
272
+ // /
273
+ MRMDestMem = 32 ,
274
+
275
+ // / MRMSrcMem - This form is used for instructions that use the Mod/RM byte
276
+ // / to specify a source, which in this case is memory.
277
+ // /
278
+ MRMSrcMem = 33 ,
279
+
280
+ // / MRMXm - This form is used for instructions that use the Mod/RM byte
281
+ // / to specify a memory source, but doesn't use the middle field.
282
+ // /
283
+ MRMXm = 39 , // Instruction that uses Mod/RM but not the middle field.
297
284
298
285
// 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_C5 = 37 , MRM_C6 = 38 , MRM_C7 = 39 ,
305
- MRM_C8 = 40 , MRM_C9 = 41 , MRM_CA = 42 , MRM_CB = 43 ,
306
- MRM_CC = 44 , MRM_CD = 45 , MRM_CE = 46 , MRM_CF = 47 ,
307
- MRM_D0 = 48 , MRM_D1 = 49 , MRM_D2 = 50 , MRM_D3 = 51 ,
308
- MRM_D4 = 52 , MRM_D5 = 53 , MRM_D6 = 54 , MRM_D7 = 55 ,
309
- MRM_D8 = 56 , MRM_D9 = 57 , MRM_DA = 58 , MRM_DB = 59 ,
310
- MRM_DC = 60 , MRM_DD = 61 , MRM_DE = 62 , MRM_DF = 63 ,
311
- MRM_E0 = 64 , MRM_E1 = 65 , MRM_E2 = 66 , MRM_E3 = 67 ,
312
- MRM_E4 = 68 , MRM_E5 = 69 , MRM_E6 = 70 , MRM_E7 = 71 ,
313
- MRM_E8 = 72 , MRM_E9 = 73 , MRM_EA = 74 , MRM_EB = 75 ,
314
- MRM_EC = 76 , MRM_ED = 77 , MRM_EE = 78 , MRM_EF = 79 ,
315
- MRM_F0 = 80 , MRM_F1 = 81 , MRM_F2 = 82 , MRM_F3 = 83 ,
316
- MRM_F4 = 84 , MRM_F5 = 85 , MRM_F6 = 86 , MRM_F7 = 87 ,
317
- MRM_F8 = 88 , MRM_F9 = 89 , MRM_FA = 90 , MRM_FB = 91 ,
318
- MRM_FC = 92 , MRM_FD = 93 , MRM_FE = 94 , MRM_FF = 95 ,
286
+ MRM0m = 40 , MRM1m = 41 , MRM2m = 42 , MRM3m = 43 , // Format /0 /1 /2 /3
287
+ MRM4m = 44 , MRM5m = 45 , MRM6m = 46 , MRM7m = 47 , // Format /4 /5 /6 /7
288
+
289
+ // / MRMDestReg - This form is used for instructions that use the Mod/RM byte
290
+ // / to specify a destination, which in this case is a register.
291
+ // /
292
+ MRMDestReg = 48 ,
293
+
294
+ // / MRMSrcReg - This form is used for instructions that use the Mod/RM byte
295
+ // / to specify a source, which in this case is a register.
296
+ // /
297
+ MRMSrcReg = 49 ,
298
+
299
+ // / MRMXr - This form is used for instructions that use the Mod/RM byte
300
+ // / to specify a register source, but doesn't use the middle field.
301
+ // /
302
+ MRMXr = 55 , // Instruction that uses Mod/RM but not the middle field.
303
+
304
+ // Instructions that operate on a register r/m operand...
305
+ MRM0r = 56 , MRM1r = 57 , MRM2r = 58 , MRM3r = 59 , // Format /0 /1 /2 /3
306
+ MRM4r = 60 , MRM5r = 61 , MRM6r = 62 , MRM7r = 63 , // Format /4 /5 /6 /7
307
+
308
+ // / MRM_XX - A mod/rm byte of exactly 0xXX.
309
+ MRM_C0 = 64 , MRM_C1 = 65 , MRM_C2 = 66 , MRM_C3 = 67 ,
310
+ MRM_C4 = 68 , MRM_C5 = 69 , MRM_C6 = 70 , MRM_C7 = 71 ,
311
+ MRM_C8 = 72 , MRM_C9 = 73 , MRM_CA = 74 , MRM_CB = 75 ,
312
+ MRM_CC = 76 , MRM_CD = 77 , MRM_CE = 78 , MRM_CF = 79 ,
313
+ MRM_D0 = 80 , MRM_D1 = 81 , MRM_D2 = 82 , MRM_D3 = 83 ,
314
+ MRM_D4 = 84 , MRM_D5 = 85 , MRM_D6 = 86 , MRM_D7 = 87 ,
315
+ MRM_D8 = 88 , MRM_D9 = 89 , MRM_DA = 90 , MRM_DB = 91 ,
316
+ MRM_DC = 92 , MRM_DD = 93 , MRM_DE = 94 , MRM_DF = 95 ,
317
+ MRM_E0 = 96 , MRM_E1 = 97 , MRM_E2 = 98 , MRM_E3 = 99 ,
318
+ MRM_E4 = 100 , MRM_E5 = 101 , MRM_E6 = 102 , MRM_E7 = 103 ,
319
+ MRM_E8 = 104 , MRM_E9 = 105 , MRM_EA = 106 , MRM_EB = 107 ,
320
+ MRM_EC = 108 , MRM_ED = 109 , MRM_EE = 110 , MRM_EF = 111 ,
321
+ MRM_F0 = 112 , MRM_F1 = 113 , MRM_F2 = 114 , MRM_F3 = 115 ,
322
+ MRM_F4 = 116 , MRM_F5 = 117 , MRM_F6 = 118 , MRM_F7 = 119 ,
323
+ MRM_F8 = 120 , MRM_F9 = 121 , MRM_FA = 122 , MRM_FB = 123 ,
324
+ MRM_FC = 124 , MRM_FD = 125 , MRM_FE = 126 , MRM_FF = 127 ,
319
325
320
326
FormMask = 127 ,
321
327
@@ -651,8 +657,6 @@ namespace X86II {
651
657
case X86II::Pseudo:
652
658
case X86II::RawFrm:
653
659
case X86II::AddRegFrm:
654
- case X86II::MRMDestReg:
655
- case X86II::MRMSrcReg:
656
660
case X86II::RawFrmImm8:
657
661
case X86II::RawFrmImm16:
658
662
case X86II::RawFrmMemOffs:
@@ -666,6 +670,8 @@ namespace X86II {
666
670
// Start from 1, skip any registers encoded in VEX_VVVV or I8IMM, or a
667
671
// mask register.
668
672
return 1 + HasVEX_4V + HasMemOp4 + HasEVEX_K;
673
+ case X86II::MRMDestReg:
674
+ case X86II::MRMSrcReg:
669
675
case X86II::MRMXr:
670
676
case X86II::MRM0r: case X86II::MRM1r:
671
677
case X86II::MRM2r: case X86II::MRM3r:
0 commit comments