aboutsummaryrefslogtreecommitdiff
path: root/src/lj_jit.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_jit.h')
-rw-r--r--src/lj_jit.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/lj_jit.h b/src/lj_jit.h
index 23adf30d..f0472282 100644
--- a/src/lj_jit.h
+++ b/src/lj_jit.h
@@ -201,6 +201,17 @@ typedef struct BPropEntry {
201/* Number of slots for the backpropagation cache. Must be a power of 2. */ 201/* Number of slots for the backpropagation cache. Must be a power of 2. */
202#define BPROP_SLOTS 16 202#define BPROP_SLOTS 16
203 203
204/* 128 bit SIMD constants. */
205enum {
206 LJ_KSIMD_ABS,
207 LJ_KSIMD_NEG,
208 LJ_KSIMD__MAX
209};
210
211/* Get 16 byte aligned pointer to SIMD constant. */
212#define LJ_KSIMD(J, n) \
213 ((TValue *)(((intptr_t)&J->ksimd[2*(n)] + 15) & ~(intptr_t)15))
214
204/* Fold state is used to fold instructions on-the-fly. */ 215/* Fold state is used to fold instructions on-the-fly. */
205typedef struct FoldState { 216typedef struct FoldState {
206 IRIns ins; /* Currently emitted instruction. */ 217 IRIns ins; /* Currently emitted instruction. */
@@ -214,21 +225,21 @@ typedef struct jit_State {
214 225
215 lua_State *L; /* Current Lua state. */ 226 lua_State *L; /* Current Lua state. */
216 const BCIns *pc; /* Current PC. */ 227 const BCIns *pc; /* Current PC. */
217 BCReg maxslot; /* Relative to baseslot. */
218
219 uint32_t flags; /* JIT engine flags. */
220 TRef *base; /* Current frame base, points into J->slots. */
221 BCReg baseslot; /* Current frame base, offset into J->slots. */
222 GCfunc *fn; /* Current function. */ 228 GCfunc *fn; /* Current function. */
223 GCproto *pt; /* Current prototype. */ 229 GCproto *pt; /* Current prototype. */
230 TRef *base; /* Current frame base, points into J->slots. */
224 231
225 FoldState fold; /* Fold state. */ 232 uint32_t flags; /* JIT engine flags. */
233 BCReg maxslot; /* Relative to baseslot. */
234 BCReg baseslot; /* Current frame base, offset into J->slots. */
226 235
227 uint8_t mergesnap; /* Allowed to merge with next snapshot. */ 236 uint8_t mergesnap; /* Allowed to merge with next snapshot. */
228 uint8_t needsnap; /* Need snapshot before recording next bytecode. */ 237 uint8_t needsnap; /* Need snapshot before recording next bytecode. */
229 IRType1 guardemit; /* Accumulated IRT_GUARD for emitted instructions. */ 238 IRType1 guardemit; /* Accumulated IRT_GUARD for emitted instructions. */
230 uint8_t unused1; 239 uint8_t unused1;
231 240
241 FoldState fold; /* Fold state. */
242
232 const BCIns *bc_min; /* Start of allowed bytecode range for root trace. */ 243 const BCIns *bc_min; /* Start of allowed bytecode range for root trace. */
233 MSize bc_extent; /* Extent of the range. */ 244 MSize bc_extent; /* Extent of the range. */
234 245
@@ -241,19 +252,20 @@ typedef struct jit_State {
241 int32_t retdepth; /* Return frame depth (count of RETF). */ 252 int32_t retdepth; /* Return frame depth (count of RETF). */
242 253
243 MRef knum; /* Pointer to chained array of KNUM constants. */ 254 MRef knum; /* Pointer to chained array of KNUM constants. */
255 TValue ksimd[LJ_KSIMD__MAX*2+1]; /* 16 byte aligned SIMD constants. */
244 256
245 IRIns *irbuf; /* Temp. IR instruction buffer. Biased with REF_BIAS. */ 257 IRIns *irbuf; /* Temp. IR instruction buffer. Biased with REF_BIAS. */
246 IRRef irtoplim; /* Upper limit of instuction buffer (biased). */ 258 IRRef irtoplim; /* Upper limit of instuction buffer (biased). */
247 IRRef irbotlim; /* Lower limit of instuction buffer (biased). */ 259 IRRef irbotlim; /* Lower limit of instuction buffer (biased). */
248 IRRef loopref; /* Last loop reference or ref of final LOOP (or 0). */ 260 IRRef loopref; /* Last loop reference or ref of final LOOP (or 0). */
249 261
262 MSize sizesnap; /* Size of temp. snapshot buffer. */
250 SnapShot *snapbuf; /* Temp. snapshot buffer. */ 263 SnapShot *snapbuf; /* Temp. snapshot buffer. */
251 SnapEntry *snapmapbuf; /* Temp. snapshot map buffer. */ 264 SnapEntry *snapmapbuf; /* Temp. snapshot map buffer. */
252 MSize sizesnap; /* Size of temp. snapshot buffer. */
253 MSize sizesnapmap; /* Size of temp. snapshot map buffer. */ 265 MSize sizesnapmap; /* Size of temp. snapshot map buffer. */
254 266
255 Trace **trace; /* Array of traces. */
256 TraceNo curtrace; /* Current trace number (if not 0). Kept in J->cur. */ 267 TraceNo curtrace; /* Current trace number (if not 0). Kept in J->cur. */
268 Trace **trace; /* Array of traces. */
257 TraceNo freetrace; /* Start of scan for next free trace. */ 269 TraceNo freetrace; /* Start of scan for next free trace. */
258 MSize sizetrace; /* Size of trace array. */ 270 MSize sizetrace; /* Size of trace array. */
259 271