aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lj_def.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/lj_def.h b/src/lj_def.h
index 16f76cf6..2d8fff66 100644
--- a/src/lj_def.h
+++ b/src/lj_def.h
@@ -97,6 +97,7 @@ typedef unsigned int uintptr_t;
97#define u32ptr(p) ((uint32_t)(intptr_t)(void *)(p)) 97#define u32ptr(p) ((uint32_t)(intptr_t)(void *)(p))
98#define i64ptr(p) ((int64_t)(intptr_t)(void *)(p)) 98#define i64ptr(p) ((int64_t)(intptr_t)(void *)(p))
99#define u64ptr(p) ((uint64_t)(intptr_t)(void *)(p)) 99#define u64ptr(p) ((uint64_t)(intptr_t)(void *)(p))
100#define igcptr(p) (LJ_GC64 ? i64ptr(p) : i32ptr(p))
100 101
101#define checki8(x) ((x) == (int32_t)(int8_t)(x)) 102#define checki8(x) ((x) == (int32_t)(int8_t)(x))
102#define checku8(x) ((x) == (int32_t)(uint8_t)(x)) 103#define checku8(x) ((x) == (int32_t)(uint8_t)(x))
@@ -105,14 +106,8 @@ typedef unsigned int uintptr_t;
105#define checki32(x) ((x) == (int32_t)(x)) 106#define checki32(x) ((x) == (int32_t)(x))
106#define checku32(x) ((x) == (uint32_t)(x)) 107#define checku32(x) ((x) == (uint32_t)(x))
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)(x) >> 47) == 0) 109#define checkptr47(x) (((uint64_t)(uintptr_t)(x) >> 47) == 0)
109#if LJ_GC64 110#define checkptrGC(x) (LJ_GC64 ? checkptr47((x)) : LJ_64 ? checkptr32((x)) :1)
110#define checkptrGC(x) (checkptr47((x)))
111#elif LJ_64
112#define checkptrGC(x) (checkptr32((x)))
113#else
114#define checkptrGC(x) 1
115#endif
116 111
117/* Every half-decent C compiler transforms this into a rotate instruction. */ 112/* Every half-decent C compiler transforms this into a rotate instruction. */
118#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))))