diff options
Diffstat (limited to 'src/lj_ir.h')
-rw-r--r-- | src/lj_ir.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lj_ir.h b/src/lj_ir.h index 286eb219..d2ad87f3 100644 --- a/src/lj_ir.h +++ b/src/lj_ir.h | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | /* -- IR instructions ----------------------------------------------------- */ | 11 | /* -- IR instructions ----------------------------------------------------- */ |
12 | 12 | ||
13 | /* IR instruction definition. Order matters, see below. */ | 13 | /* IR instruction definition. Order matters, see below. ORDER IR */ |
14 | #define IRDEF(_) \ | 14 | #define IRDEF(_) \ |
15 | /* Guarded assertions. */ \ | 15 | /* Guarded assertions. */ \ |
16 | /* Must be properly aligned to flip opposites (^1) and (un)ordered (^4). */ \ | 16 | /* Must be properly aligned to flip opposites (^1) and (un)ordered (^4). */ \ |
@@ -61,21 +61,21 @@ | |||
61 | _(BROL, N , ref, ref) \ | 61 | _(BROL, N , ref, ref) \ |
62 | _(BROR, N , ref, ref) \ | 62 | _(BROR, N , ref, ref) \ |
63 | \ | 63 | \ |
64 | /* Arithmetic ops. ORDER ARITH (FPMATH/POWI take the space for MOD/POW). */ \ | 64 | /* Arithmetic ops. ORDER ARITH */ \ |
65 | _(ADD, C , ref, ref) \ | 65 | _(ADD, C , ref, ref) \ |
66 | _(SUB, N , ref, ref) \ | 66 | _(SUB, N , ref, ref) \ |
67 | _(MUL, C , ref, ref) \ | 67 | _(MUL, C , ref, ref) \ |
68 | _(DIV, N , ref, ref) \ | 68 | _(DIV, N , ref, ref) \ |
69 | \ | 69 | _(MOD, N , ref, ref) \ |
70 | _(FPMATH, N , ref, lit) \ | ||
71 | _(POWI, N , ref, ref) \ | 70 | _(POWI, N , ref, ref) \ |
72 | \ | ||
73 | _(NEG, N , ref, ref) \ | 71 | _(NEG, N , ref, ref) \ |
72 | \ | ||
74 | _(ABS, N , ref, ref) \ | 73 | _(ABS, N , ref, ref) \ |
75 | _(ATAN2, N , ref, ref) \ | 74 | _(ATAN2, N , ref, ref) \ |
76 | _(LDEXP, N , ref, ref) \ | 75 | _(LDEXP, N , ref, ref) \ |
77 | _(MIN, C , ref, ref) \ | 76 | _(MIN, C , ref, ref) \ |
78 | _(MAX, C , ref, ref) \ | 77 | _(MAX, C , ref, ref) \ |
78 | _(FPMATH, N , ref, lit) \ | ||
79 | \ | 79 | \ |
80 | /* Overflow-checking arithmetic ops. */ \ | 80 | /* Overflow-checking arithmetic ops. */ \ |
81 | _(ADDOV, C , ref, ref) \ | 81 | _(ADDOV, C , ref, ref) \ |
@@ -266,6 +266,10 @@ typedef struct CCallInfo { | |||
266 | #endif | 266 | #endif |
267 | #define IRCALLDEF_FFI(_) \ | 267 | #define IRCALLDEF_FFI(_) \ |
268 | IRCALLDEF_FFI32(_) \ | 268 | IRCALLDEF_FFI32(_) \ |
269 | _(lj_carith_divi64, ARG2_64, N, I64, CCI_NOFPRCLOBBER) \ | ||
270 | _(lj_carith_divu64, ARG2_64, N, U64, CCI_NOFPRCLOBBER) \ | ||
271 | _(lj_carith_modi64, ARG2_64, N, I64, CCI_NOFPRCLOBBER) \ | ||
272 | _(lj_carith_modu64, ARG2_64, N, U64, CCI_NOFPRCLOBBER) \ | ||
269 | _(lj_carith_powi64, ARG2_64, N, I64, CCI_NOFPRCLOBBER) \ | 273 | _(lj_carith_powi64, ARG2_64, N, I64, CCI_NOFPRCLOBBER) \ |
270 | _(lj_carith_powu64, ARG2_64, N, U64, CCI_NOFPRCLOBBER) | 274 | _(lj_carith_powu64, ARG2_64, N, U64, CCI_NOFPRCLOBBER) |
271 | #else | 275 | #else |
@@ -584,12 +588,12 @@ typedef union IRIns { | |||
584 | #define ir_kptr(ir) \ | 588 | #define ir_kptr(ir) \ |
585 | check_exp((ir)->o == IR_KPTR || (ir)->o == IR_KKPTR, mref((ir)->ptr, void)) | 589 | check_exp((ir)->o == IR_KPTR || (ir)->o == IR_KKPTR, mref((ir)->ptr, void)) |
586 | 590 | ||
587 | LJ_STATIC_ASSERT((int)IRT_GUARD == (int)IRM_W); | ||
588 | |||
589 | /* A store or any other op with a non-weak guard has a side-effect. */ | 591 | /* A store or any other op with a non-weak guard has a side-effect. */ |
590 | static LJ_AINLINE int ir_sideeff(IRIns *ir) | 592 | static LJ_AINLINE int ir_sideeff(IRIns *ir) |
591 | { | 593 | { |
592 | return (((ir->t.irt | ~IRT_GUARD) & lj_ir_mode[ir->o]) >= IRM_S); | 594 | return (((ir->t.irt | ~IRT_GUARD) & lj_ir_mode[ir->o]) >= IRM_S); |
593 | } | 595 | } |
594 | 596 | ||
597 | LJ_STATIC_ASSERT((int)IRT_GUARD == (int)IRM_W); | ||
598 | |||
595 | #endif | 599 | #endif |