diff options
author | Mike Pall <mike> | 2016-05-21 00:02:45 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2016-05-21 00:02:45 +0200 |
commit | cfa188f1349ba4c843394b53f270cb64635b9805 (patch) | |
tree | e16e643dfa2567fd52506702b79a4b851c3db63e /src/lj_jit.h | |
parent | 1931b38da5a9ea075df73a966630308d3988bb96 (diff) | |
download | luajit-cfa188f1349ba4c843394b53f270cb64635b9805.tar.gz luajit-cfa188f1349ba4c843394b53f270cb64635b9805.tar.bz2 luajit-cfa188f1349ba4c843394b53f270cb64635b9805.zip |
Move common 32/64 bit in-memory FP constants to jit_State.
Prerequisite for immovable IR.
Contributed by Peter Cawley.
Diffstat (limited to 'src/lj_jit.h')
-rw-r--r-- | src/lj_jit.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/lj_jit.h b/src/lj_jit.h index 2d2e833a..6a47961b 100644 --- a/src/lj_jit.h +++ b/src/lj_jit.h | |||
@@ -308,6 +308,37 @@ enum { | |||
308 | LJ_KSIMD__MAX | 308 | LJ_KSIMD__MAX |
309 | }; | 309 | }; |
310 | 310 | ||
311 | enum { | ||
312 | #if LJ_TARGET_X86ORX64 | ||
313 | LJ_K64_TOBIT, /* 2^52 + 2^51 */ | ||
314 | LJ_K64_2P64, /* 2^64 */ | ||
315 | LJ_K64_M2P64, /* -2^64 */ | ||
316 | #if LJ_32 | ||
317 | LJ_K64_M2P64_31, /* -2^64 or -2^31 */ | ||
318 | #else | ||
319 | LJ_K64_M2P64_31 = LJ_K64_M2P64, | ||
320 | #endif | ||
321 | #endif | ||
322 | #if LJ_TARGET_MIPS | ||
323 | LJ_K64_2P31, /* 2^31 */ | ||
324 | #endif | ||
325 | LJ_K64__MAX, | ||
326 | }; | ||
327 | |||
328 | enum { | ||
329 | #if LJ_TARGET_X86ORX64 | ||
330 | LJ_K32_M2P64_31, /* -2^64 or -2^31 */ | ||
331 | #endif | ||
332 | #if LJ_TARGET_PPC | ||
333 | LJ_K32_2P52_2P31, /* 2^52 + 2^31 */ | ||
334 | LJ_K32_2P52, /* 2^52 */ | ||
335 | #endif | ||
336 | #if LJ_TARGET_PPC || LJ_TARGET_MIPS | ||
337 | LJ_K32_2P31, /* 2^31 */ | ||
338 | #endif | ||
339 | LJ_K32__MAX | ||
340 | }; | ||
341 | |||
311 | /* Get 16 byte aligned pointer to SIMD constant. */ | 342 | /* Get 16 byte aligned pointer to SIMD constant. */ |
312 | #define LJ_KSIMD(J, n) \ | 343 | #define LJ_KSIMD(J, n) \ |
313 | ((TValue *)(((intptr_t)&J->ksimd[2*(n)] + 15) & ~(intptr_t)15)) | 344 | ((TValue *)(((intptr_t)&J->ksimd[2*(n)] + 15) & ~(intptr_t)15)) |
@@ -360,8 +391,10 @@ typedef struct jit_State { | |||
360 | int32_t framedepth; /* Current frame depth. */ | 391 | int32_t framedepth; /* Current frame depth. */ |
361 | int32_t retdepth; /* Return frame depth (count of RETF). */ | 392 | int32_t retdepth; /* Return frame depth (count of RETF). */ |
362 | 393 | ||
363 | MRef k64; /* Pointer to chained array of 64 bit constants. */ | 394 | MRef k64p; /* Pointer to chained array of 64 bit constants. */ |
364 | TValue ksimd[LJ_KSIMD__MAX*2+1]; /* 16 byte aligned SIMD constants. */ | 395 | TValue ksimd[LJ_KSIMD__MAX*2+1]; /* 16 byte aligned SIMD constants. */ |
396 | TValue k64[LJ_K64__MAX]; /* Common 8 byte constants used by backends. */ | ||
397 | uint32_t k32[LJ_K32__MAX]; /* Ditto for 4 byte constants. */ | ||
365 | 398 | ||
366 | IRIns *irbuf; /* Temp. IR instruction buffer. Biased with REF_BIAS. */ | 399 | IRIns *irbuf; /* Temp. IR instruction buffer. Biased with REF_BIAS. */ |
367 | IRRef irtoplim; /* Upper limit of instuction buffer (biased). */ | 400 | IRRef irtoplim; /* Upper limit of instuction buffer (biased). */ |