diff options
Diffstat (limited to 'src/lj_ir.h')
-rw-r--r-- | src/lj_ir.h | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/lj_ir.h b/src/lj_ir.h index 9d90d69f..b8ea0fa9 100644 --- a/src/lj_ir.h +++ b/src/lj_ir.h | |||
@@ -12,6 +12,24 @@ | |||
12 | 12 | ||
13 | /* IR instruction definition. Order matters, see below. */ | 13 | /* IR instruction definition. Order matters, see below. */ |
14 | #define IRDEF(_) \ | 14 | #define IRDEF(_) \ |
15 | /* Guarded assertions. */ \ | ||
16 | /* Must be properly aligned to flip opposites (^1) and (un)ordered (^4). */ \ | ||
17 | _(LT, N , ref, ref) \ | ||
18 | _(GE, N , ref, ref) \ | ||
19 | _(LE, N , ref, ref) \ | ||
20 | _(GT, N , ref, ref) \ | ||
21 | \ | ||
22 | _(ULT, N , ref, ref) \ | ||
23 | _(UGE, N , ref, ref) \ | ||
24 | _(ULE, N , ref, ref) \ | ||
25 | _(UGT, N , ref, ref) \ | ||
26 | \ | ||
27 | _(EQ, C , ref, ref) \ | ||
28 | _(NE, C , ref, ref) \ | ||
29 | \ | ||
30 | _(ABC, N , ref, ref) \ | ||
31 | _(RETF, S , ref, ref) \ | ||
32 | \ | ||
15 | /* Miscellaneous ops. */ \ | 33 | /* Miscellaneous ops. */ \ |
16 | _(NOP, N , ___, ___) \ | 34 | _(NOP, N , ___, ___) \ |
17 | _(BASE, N , lit, lit) \ | 35 | _(BASE, N , lit, lit) \ |
@@ -26,26 +44,9 @@ | |||
26 | _(KPTR, N , cst, ___) \ | 44 | _(KPTR, N , cst, ___) \ |
27 | _(KNULL, N , cst, ___) \ | 45 | _(KNULL, N , cst, ___) \ |
28 | _(KNUM, N , cst, ___) \ | 46 | _(KNUM, N , cst, ___) \ |
47 | _(KINT64, N , cst, ___) \ | ||
29 | _(KSLOT, N , ref, lit) \ | 48 | _(KSLOT, N , ref, lit) \ |
30 | \ | 49 | \ |
31 | /* Guarded assertions. */ \ | ||
32 | /* Must be properly aligned to flip opposites (^1) and (un)ordered (^4). */ \ | ||
33 | _(EQ, C , ref, ref) \ | ||
34 | _(NE, C , ref, ref) \ | ||
35 | \ | ||
36 | _(ABC, N , ref, ref) \ | ||
37 | _(RETF, S , ref, ref) \ | ||
38 | \ | ||
39 | _(LT, N , ref, ref) \ | ||
40 | _(GE, N , ref, ref) \ | ||
41 | _(LE, N , ref, ref) \ | ||
42 | _(GT, N , ref, ref) \ | ||
43 | \ | ||
44 | _(ULT, N , ref, ref) \ | ||
45 | _(UGE, N , ref, ref) \ | ||
46 | _(ULE, N , ref, ref) \ | ||
47 | _(UGT, N , ref, ref) \ | ||
48 | \ | ||
49 | /* Bit ops. */ \ | 50 | /* Bit ops. */ \ |
50 | _(BNOT, N , ref, ___) \ | 51 | _(BNOT, N , ref, ___) \ |
51 | _(BSWAP, N , ref, ___) \ | 52 | _(BSWAP, N , ref, ___) \ |
@@ -536,6 +537,9 @@ typedef union IRIns { | |||
536 | #define ir_ktab(ir) (gco2tab(ir_kgc((ir)))) | 537 | #define ir_ktab(ir) (gco2tab(ir_kgc((ir)))) |
537 | #define ir_kfunc(ir) (gco2func(ir_kgc((ir)))) | 538 | #define ir_kfunc(ir) (gco2func(ir_kgc((ir)))) |
538 | #define ir_knum(ir) check_exp((ir)->o == IR_KNUM, mref((ir)->ptr, cTValue)) | 539 | #define ir_knum(ir) check_exp((ir)->o == IR_KNUM, mref((ir)->ptr, cTValue)) |
540 | #define ir_kint64(ir) check_exp((ir)->o == IR_KINT64, mref((ir)->ptr,cTValue)) | ||
541 | #define ir_k64(ir) \ | ||
542 | check_exp((ir)->o == IR_KNUM || (ir)->o == IR_KINT64, mref((ir)->ptr,cTValue)) | ||
539 | #define ir_kptr(ir) check_exp((ir)->o == IR_KPTR, mref((ir)->ptr, void)) | 543 | #define ir_kptr(ir) check_exp((ir)->o == IR_KPTR, mref((ir)->ptr, void)) |
540 | 544 | ||
541 | LJ_STATIC_ASSERT((int)IRT_GUARD == (int)IRM_W); | 545 | LJ_STATIC_ASSERT((int)IRT_GUARD == (int)IRM_W); |