diff options
Diffstat (limited to 'src/lj_target_x86.h')
-rw-r--r-- | src/lj_target_x86.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lj_target_x86.h b/src/lj_target_x86.h index e29f4748..d5429597 100644 --- a/src/lj_target_x86.h +++ b/src/lj_target_x86.h | |||
@@ -22,7 +22,7 @@ | |||
22 | _(XMM0) _(XMM1) _(XMM2) _(XMM3) _(XMM4) _(XMM5) _(XMM6) _(XMM7) | 22 | _(XMM0) _(XMM1) _(XMM2) _(XMM3) _(XMM4) _(XMM5) _(XMM6) _(XMM7) |
23 | #endif | 23 | #endif |
24 | #define VRIDDEF(_) \ | 24 | #define VRIDDEF(_) \ |
25 | _(MRM) | 25 | _(MRM) _(RIP) |
26 | 26 | ||
27 | #define RIDENUM(name) RID_##name, | 27 | #define RIDENUM(name) RID_##name, |
28 | 28 | ||
@@ -31,6 +31,7 @@ enum { | |||
31 | FPRDEF(RIDENUM) /* Floating-point registers (FPRs). */ | 31 | FPRDEF(RIDENUM) /* Floating-point registers (FPRs). */ |
32 | RID_MAX, | 32 | RID_MAX, |
33 | RID_MRM = RID_MAX, /* Pseudo-id for ModRM operand. */ | 33 | RID_MRM = RID_MAX, /* Pseudo-id for ModRM operand. */ |
34 | RID_RIP = RID_MAX+1, /* Pseudo-id for RIP (x64 only). */ | ||
34 | 35 | ||
35 | /* Calling conventions. */ | 36 | /* Calling conventions. */ |
36 | RID_SP = RID_ESP, | 37 | RID_SP = RID_ESP, |
@@ -63,8 +64,10 @@ enum { | |||
63 | 64 | ||
64 | /* -- Register sets ------------------------------------------------------- */ | 65 | /* -- Register sets ------------------------------------------------------- */ |
65 | 66 | ||
66 | /* Make use of all registers, except the stack pointer. */ | 67 | /* Make use of all registers, except the stack pointer (and maybe DISPATCH). */ |
67 | #define RSET_GPR (RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR)-RID2RSET(RID_ESP)) | 68 | #define RSET_GPR (RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR) \ |
69 | - RID2RSET(RID_ESP) \ | ||
70 | - LJ_GC64*RID2RSET(RID_DISPATCH)) | ||
68 | #define RSET_FPR (RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR)) | 71 | #define RSET_FPR (RSET_RANGE(RID_MIN_FPR, RID_MAX_FPR)) |
69 | #define RSET_ALL (RSET_GPR|RSET_FPR) | 72 | #define RSET_ALL (RSET_GPR|RSET_FPR) |
70 | #define RSET_INIT RSET_ALL | 73 | #define RSET_INIT RSET_ALL |
@@ -200,6 +203,7 @@ typedef struct { | |||
200 | */ | 203 | */ |
201 | typedef enum { | 204 | typedef enum { |
202 | /* Fixed length opcodes. XI_* prefix. */ | 205 | /* Fixed length opcodes. XI_* prefix. */ |
206 | XI_O16 = 0x66, | ||
203 | XI_NOP = 0x90, | 207 | XI_NOP = 0x90, |
204 | XI_XCHGa = 0x90, | 208 | XI_XCHGa = 0x90, |
205 | XI_CALL = 0xe8, | 209 | XI_CALL = 0xe8, |
@@ -217,6 +221,7 @@ typedef enum { | |||
217 | XI_PUSHi8 = 0x6a, | 221 | XI_PUSHi8 = 0x6a, |
218 | XI_TESTb = 0x84, | 222 | XI_TESTb = 0x84, |
219 | XI_TEST = 0x85, | 223 | XI_TEST = 0x85, |
224 | XI_INT3 = 0xcc, | ||
220 | XI_MOVmi = 0xc7, | 225 | XI_MOVmi = 0xc7, |
221 | XI_GROUP5 = 0xff, | 226 | XI_GROUP5 = 0xff, |
222 | 227 | ||
@@ -243,6 +248,7 @@ typedef enum { | |||
243 | XV_SHRX = XV_f20f38(f7), | 248 | XV_SHRX = XV_f20f38(f7), |
244 | 249 | ||
245 | /* Variable-length opcodes. XO_* prefix. */ | 250 | /* Variable-length opcodes. XO_* prefix. */ |
251 | XO_OR = XO_(0b), | ||
246 | XO_MOV = XO_(8b), | 252 | XO_MOV = XO_(8b), |
247 | XO_MOVto = XO_(89), | 253 | XO_MOVto = XO_(89), |
248 | XO_MOVtow = XO_66(89), | 254 | XO_MOVtow = XO_66(89), |