aboutsummaryrefslogtreecommitdiff
path: root/src/lj_ir.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_ir.h')
-rw-r--r--src/lj_ir.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lj_ir.h b/src/lj_ir.h
index 6d016b93..4953425a 100644
--- a/src/lj_ir.h
+++ b/src/lj_ir.h
@@ -284,16 +284,19 @@ LJ_DATA const uint8_t lj_ir_mode[IR__MAX+1];
284** contiguous and next to IRT_NUM (see the typerange macros below). 284** contiguous and next to IRT_NUM (see the typerange macros below).
285*/ 285*/
286#define IRTDEF(_) \ 286#define IRTDEF(_) \
287 _(NIL) _(FALSE) _(TRUE) _(LIGHTUD) _(STR) _(P32) _(THREAD) \ 287 _(NIL, 4) _(FALSE, 4) _(TRUE, 4) _(LIGHTUD, LJ_64 ? 8 : 4) _(STR, 4) \
288 _(PROTO) _(FUNC) _(P64) _(CDATA) _(TAB) _(UDATA) \ 288 _(P32, 4) _(THREAD, 4) _(PROTO, 4) _(FUNC, 4) _(P64, 8) _(CDATA, 4) \
289 _(FLOAT) _(NUM) _(I8) _(U8) _(I16) _(U16) _(INT) _(U32) _(I64) _(U64) \ 289 _(TAB, 4) _(UDATA, 4) \
290 _(SOFTFP) /* There is room for 9 more types. */ 290 _(FLOAT, 4) _(NUM, 8) _(I8, 1) _(U8, 1) _(I16, 2) _(U16, 2) \
291 _(INT, 4) _(U32, 4) _(I64, 8) _(U64, 8) \
292 _(SOFTFP, 4) /* There is room for 9 more types. */
291 293
292/* IR result type and flags (8 bit). */ 294/* IR result type and flags (8 bit). */
293typedef enum { 295typedef enum {
294#define IRTENUM(name) IRT_##name, 296#define IRTENUM(name, size) IRT_##name,
295IRTDEF(IRTENUM) 297IRTDEF(IRTENUM)
296#undef IRTENUM 298#undef IRTENUM
299 IRT__MAX,
297 300
298 /* Native pointer type and the corresponding integer type. */ 301 /* Native pointer type and the corresponding integer type. */
299 IRT_PTR = LJ_64 ? IRT_P64 : IRT_P32, 302 IRT_PTR = LJ_64 ? IRT_P64 : IRT_P32,
@@ -361,6 +364,10 @@ typedef struct IRType1 { uint8_t irt; } IRType1;
361#define irt_is64(t) ((IRT_IS64 >> irt_type(t)) & 1) 364#define irt_is64(t) ((IRT_IS64 >> irt_type(t)) & 1)
362#define irt_is64orfp(t) (((IRT_IS64|(1u<<IRT_FLOAT))>>irt_type(t)) & 1) 365#define irt_is64orfp(t) (((IRT_IS64|(1u<<IRT_FLOAT))>>irt_type(t)) & 1)
363 366
367#define irt_size(t) (lj_ir_type_size[irt_t((t))])
368
369LJ_DATA const uint8_t lj_ir_type_size[];
370
364static LJ_AINLINE IRType itype2irt(const TValue *tv) 371static LJ_AINLINE IRType itype2irt(const TValue *tv)
365{ 372{
366 if (tvisint(tv)) 373 if (tvisint(tv))