diff options
author | Mike Pall <mike> | 2010-02-24 07:09:34 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-02-24 07:09:34 +0100 |
commit | 4c9f71be5d4449b717870092839c47a1d5db0dca (patch) | |
tree | ace2d0a3cf4756cc5ac7607c21304f7f7baffd09 /src/lj_ir.h | |
parent | e46f4c8a11bcb2ba76d445e34030ab04ba12668d (diff) | |
download | luajit-4c9f71be5d4449b717870092839c47a1d5db0dca.tar.gz luajit-4c9f71be5d4449b717870092839c47a1d5db0dca.tar.bz2 luajit-4c9f71be5d4449b717870092839c47a1d5db0dca.zip |
Major 32/64 bit cleanups in assembler and exit handling.
Add 64 bit lightuserdata handling. Keep the tagged 64 bit value.
Allocate/save/restore 64 bit spill slots for 64 bit lightuserdata.
Fix code generation for 64 bit loads/stores/moves/compares.
Fix code generation for stack pointer adjustments.
Add fixed spill slot definitions for x64. Reduce reserved spill slots.
Disable STRREF + ADD fusion in 64 bit mode (avoid negative 32 bit ofs).
Diffstat (limited to 'src/lj_ir.h')
-rw-r--r-- | src/lj_ir.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/lj_ir.h b/src/lj_ir.h index 75519ed4..ca871238 100644 --- a/src/lj_ir.h +++ b/src/lj_ir.h | |||
@@ -362,6 +362,7 @@ typedef struct IRType1 { uint8_t irt; } IRType1; | |||
362 | 362 | ||
363 | #define irt_isnil(t) (irt_type(t) == IRT_NIL) | 363 | #define irt_isnil(t) (irt_type(t) == IRT_NIL) |
364 | #define irt_ispri(t) ((uint32_t)irt_type(t) <= IRT_TRUE) | 364 | #define irt_ispri(t) ((uint32_t)irt_type(t) <= IRT_TRUE) |
365 | #define irt_islightud(t) (irt_type(t) == IRT_LIGHTUD) | ||
365 | #define irt_isstr(t) (irt_type(t) == IRT_STR) | 366 | #define irt_isstr(t) (irt_type(t) == IRT_STR) |
366 | #define irt_isfunc(t) (irt_type(t) == IRT_FUNC) | 367 | #define irt_isfunc(t) (irt_type(t) == IRT_FUNC) |
367 | #define irt_istab(t) (irt_type(t) == IRT_TAB) | 368 | #define irt_istab(t) (irt_type(t) == IRT_TAB) |
@@ -376,9 +377,20 @@ typedef struct IRType1 { uint8_t irt; } IRType1; | |||
376 | #define irt_isgcv(t) (irt_typerange((t), IRT_STR, IRT_UDATA)) | 377 | #define irt_isgcv(t) (irt_typerange((t), IRT_STR, IRT_UDATA)) |
377 | #define irt_isaddr(t) (irt_typerange((t), IRT_LIGHTUD, IRT_UDATA)) | 378 | #define irt_isaddr(t) (irt_typerange((t), IRT_LIGHTUD, IRT_UDATA)) |
378 | 379 | ||
379 | #define itype2irt(tv) \ | 380 | static LJ_AINLINE IRType itype2irt(const TValue *tv) |
380 | (~uitype(tv) < IRT_NUM ? cast(IRType, ~uitype(tv)) : IRT_NUM) | 381 | { |
381 | #define irt_toitype(t) ((int32_t)~(uint32_t)irt_type(t)) | 382 | if (tvisnum(tv)) |
383 | return IRT_NUM; | ||
384 | #if LJ_64 | ||
385 | else if (tvislightud(tv)) | ||
386 | return IRT_LIGHTUD; | ||
387 | #endif | ||
388 | else | ||
389 | return cast(IRType, ~uitype(tv)); | ||
390 | } | ||
391 | |||
392 | #define irt_toitype(t) \ | ||
393 | check_exp(!(LJ_64 && irt_islightud((t))), (int32_t)~(uint32_t)irt_type((t))) | ||
382 | 394 | ||
383 | #define irt_isguard(t) ((t).irt & IRT_GUARD) | 395 | #define irt_isguard(t) ((t).irt & IRT_GUARD) |
384 | #define irt_ismarked(t) ((t).irt & IRT_MARK) | 396 | #define irt_ismarked(t) ((t).irt & IRT_MARK) |