aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lj_def.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_def.h b/src/lj_def.h
index e458c89f..5e63da3e 100644
--- a/src/lj_def.h
+++ b/src/lj_def.h
@@ -104,9 +104,10 @@ typedef unsigned int uintptr_t;
104#define checku16(x) ((x) == (int32_t)(uint16_t)(x)) 104#define checku16(x) ((x) == (int32_t)(uint16_t)(x))
105#define checki32(x) ((x) == (int32_t)(x)) 105#define checki32(x) ((x) == (int32_t)(x))
106#define checku32(x) ((x) == (uint32_t)(x)) 106#define checku32(x) ((x) == (uint32_t)(x))
107#define checkptr31(x) (((uint64_t)(uintptr_t)(x) >> 31) == 0)
107#define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x)) 108#define checkptr32(x) ((uintptr_t)(x) == (uint32_t)(uintptr_t)(x))
108#define checkptr47(x) (((uint64_t)(uintptr_t)(x) >> 47) == 0) 109#define checkptr47(x) (((uint64_t)(uintptr_t)(x) >> 47) == 0)
109#define checkptrGC(x) (LJ_GC64 ? checkptr47((x)) : LJ_64 ? checkptr32((x)) :1) 110#define checkptrGC(x) (LJ_GC64 ? checkptr47((x)) : LJ_64 ? checkptr31((x)) :1)
110 111
111/* Every half-decent C compiler transforms this into a rotate instruction. */ 112/* Every half-decent C compiler transforms this into a rotate instruction. */
112#define lj_rol(x, n) (((x)<<(n)) | ((x)>>(-(int)(n)&(8*sizeof(x)-1)))) 113#define lj_rol(x, n) (((x)<<(n)) | ((x)>>(-(int)(n)&(8*sizeof(x)-1))))