aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2012-01-23 22:20:28 +0100
committerMike Pall <mike>2012-01-23 22:24:11 +0100
commit5bed11e6b4c2bbf0cbec0f00efe998289236b217 (patch)
tree5ed76367d5157df37b358a5874d34a21dc7d60b0
parent7d2774e4c5ee7c649ccb41f75bfbbb1e7f370a96 (diff)
downloadluajit-5bed11e6b4c2bbf0cbec0f00efe998289236b217.tar.gz
luajit-5bed11e6b4c2bbf0cbec0f00efe998289236b217.tar.bz2
luajit-5bed11e6b4c2bbf0cbec0f00efe998289236b217.zip
MIPS: Add interpreter. Enable MIPS build rules.
-rw-r--r--src/Makefile5
-rw-r--r--src/Makefile.dep11
-rw-r--r--src/buildvm_asm.c8
-rw-r--r--src/buildvm_mips.dasc4114
-rw-r--r--src/buildvm_mips.h7245
-rw-r--r--src/lib_base.c2
-rw-r--r--src/lj_arch.h6
-rw-r--r--src/lj_ccall.c59
-rw-r--r--src/lj_ccall.h15
-rw-r--r--src/lj_ccallback.c47
-rw-r--r--src/lj_dispatch.c22
-rw-r--r--src/lj_dispatch.h38
-rw-r--r--src/lj_frame.h15
-rw-r--r--src/lj_target.h2
-rw-r--r--src/lj_target_mips.h153
-rw-r--r--src/lj_vmmath.c25
16 files changed, 11743 insertions, 24 deletions
diff --git a/src/Makefile b/src/Makefile
index 5a60612d..d4db8774 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -408,8 +408,7 @@ ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(BUILDVM_T)
408ALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h 408ALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h
409ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) $(LIB_VMDEFP) 409ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) $(LIB_VMDEFP)
410ALL_DYNGEN= buildvm_x86.h buildvm_x64.h buildvm_x64win.h buildvm_arm.h \ 410ALL_DYNGEN= buildvm_x86.h buildvm_x64.h buildvm_x64win.h buildvm_arm.h \
411 buildvm_ppc.h buildvm_ppcspe.h 411 buildvm_ppc.h buildvm_ppcspe.h buildvm_mips.h
412###ALL_DYNGEN+= buildvm_mips.h
413WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk 412WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk
414ALL_RM= $(ALL_T) $(ALL_GEN) *.o $(WIN_RM) 413ALL_RM= $(ALL_T) $(ALL_GEN) *.o $(WIN_RM)
415 414
@@ -502,7 +501,7 @@ distclean: clean
502 $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_ARM) -o buildvm_arm.h buildvm_arm.dasc 501 $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_ARM) -o buildvm_arm.h buildvm_arm.dasc
503 $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_PPC) -o buildvm_ppc.h buildvm_ppc.dasc 502 $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_PPC) -o buildvm_ppc.h buildvm_ppc.dasc
504 $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_PPCSPE) -o buildvm_ppcspe.h buildvm_ppcspe.dasc 503 $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_PPCSPE) -o buildvm_ppcspe.h buildvm_ppcspe.dasc
505 @### $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_MIPS) -o buildvm_mips.h buildvm_mips.dasc 504 $(Q)$(DASM) $(DASM_DISTFLAGS) $(DASM_FLAGS_MIPS) -o buildvm_mips.h buildvm_mips.dasc
506 505
507depend: 506depend:
508 @for file in $(ALL_HDRGEN) $(ALL_DYNGEN); do \ 507 @for file in $(ALL_HDRGEN) $(ALL_DYNGEN); do \
diff --git a/src/Makefile.dep b/src/Makefile.dep
index add7508a..7a621242 100644
--- a/src/Makefile.dep
+++ b/src/Makefile.dep
@@ -100,8 +100,9 @@ lj_debug.o: lj_debug.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
100 lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_tab.h lj_state.h lj_frame.h \ 100 lj_err.h lj_errmsg.h lj_debug.h lj_str.h lj_tab.h lj_state.h lj_frame.h \
101 lj_bc.h lj_jit.h lj_ir.h 101 lj_bc.h lj_jit.h lj_ir.h
102lj_dispatch.o: lj_dispatch.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \ 102lj_dispatch.o: lj_dispatch.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h \
103 lj_err.h lj_errmsg.h lj_debug.h lj_state.h lj_frame.h lj_bc.h lj_ff.h \ 103 lj_err.h lj_errmsg.h lj_func.h lj_str.h lj_tab.h lj_meta.h lj_debug.h \
104 lj_ffdef.h lj_jit.h lj_ir.h lj_trace.h lj_dispatch.h lj_traceerr.h \ 104 lj_state.h lj_frame.h lj_bc.h lj_ff.h lj_ffdef.h lj_jit.h lj_ir.h \
105 lj_ccallback.h lj_ctype.h lj_gc.h lj_trace.h lj_dispatch.h lj_traceerr.h \
105 lj_vm.h luajit.h 106 lj_vm.h luajit.h
106lj_err.o: lj_err.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_err.h \ 107lj_err.o: lj_err.c lj_obj.h lua.h luaconf.h lj_def.h lj_arch.h lj_err.h \
107 lj_errmsg.h lj_debug.h lj_str.h lj_func.h lj_state.h lj_frame.h lj_bc.h \ 108 lj_errmsg.h lj_debug.h lj_str.h lj_func.h lj_state.h lj_frame.h lj_bc.h \
@@ -191,9 +192,9 @@ ljamalg.o: ljamalg.c lua.h luaconf.h lauxlib.h lj_gc.c lj_obj.h lj_def.h \
191 lj_trace.h lj_jit.h lj_ir.h lj_dispatch.h lj_traceerr.h lj_vm.h lj_err.c \ 192 lj_trace.h lj_jit.h lj_ir.h lj_dispatch.h lj_traceerr.h lj_vm.h lj_err.c \
192 lj_debug.h lj_ff.h lj_ffdef.h lj_char.c lj_char.h lj_bc.c lj_bcdef.h \ 193 lj_debug.h lj_ff.h lj_ffdef.h lj_char.c lj_char.h lj_bc.c lj_bcdef.h \
193 lj_obj.c lj_str.c lj_tab.c lj_func.c lj_udata.c lj_meta.c lj_debug.c \ 194 lj_obj.c lj_str.c lj_tab.c lj_func.c lj_udata.c lj_meta.c lj_debug.c \
194 lj_state.c lj_lex.h lj_alloc.h lj_dispatch.c luajit.h lj_vmevent.c \ 195 lj_state.c lj_lex.h lj_alloc.h lj_dispatch.c lj_ccallback.h luajit.h \
195 lj_vmevent.h lj_vmmath.c lj_api.c lj_bcdump.h lj_parse.h lj_lex.c \ 196 lj_vmevent.c lj_vmevent.h lj_vmmath.c lj_api.c lj_bcdump.h lj_parse.h \
196 lualib.h lj_parse.c lj_bcread.c lj_bcwrite.c lj_ctype.c lj_ccallback.h \ 197 lj_lex.c lualib.h lj_parse.c lj_bcread.c lj_bcwrite.c lj_ctype.c \
197 lj_cdata.c lj_cconv.h lj_cconv.c lj_ccall.c lj_ccall.h lj_ccallback.c \ 198 lj_cdata.c lj_cconv.h lj_cconv.c lj_ccall.c lj_ccall.h lj_ccallback.c \
198 lj_target.h lj_target_*.h lj_mcode.h lj_carith.c lj_carith.h lj_clib.c \ 199 lj_target.h lj_target_*.h lj_mcode.h lj_carith.c lj_carith.h lj_clib.c \
199 lj_clib.h lj_cparse.c lj_cparse.h lj_lib.c lj_lib.h lj_ir.c lj_ircall.h \ 200 lj_clib.h lj_cparse.c lj_cparse.h lj_lib.c lj_lib.h lj_ir.c lj_ircall.h \
diff --git a/src/buildvm_asm.c b/src/buildvm_asm.c
index 236dd176..4ba60638 100644
--- a/src/buildvm_asm.c
+++ b/src/buildvm_asm.c
@@ -120,7 +120,10 @@ static void emit_asm_wordreloc(BuildCtx *ctx, uint8_t *p, int n,
120 exit(1); 120 exit(1);
121 } 121 }
122#elif LJ_TARGET_MIPS 122#elif LJ_TARGET_MIPS
123 UNUSED(sym); /* NYI */ 123 fprintf(stderr,
124 "Error: unsupported opcode %08x for %s symbol relocation.\n",
125 ins, sym);
126 exit(1);
124#else 127#else
125#error "missing relocation support for this architecture" 128#error "missing relocation support for this architecture"
126#endif 129#endif
@@ -200,6 +203,9 @@ void emit_asm(BuildCtx *ctx)
200 ".save {r4, r5, r6, r7, r8, r9, r10, r11, lr}\n" 203 ".save {r4, r5, r6, r7, r8, r9, r10, r11, lr}\n"
201 ".pad #28\n"); 204 ".pad #28\n");
202#endif 205#endif
206#if LJ_TARGET_MIPS
207 fprintf(ctx->fp, ".set nomips16\n.abicalls\n.set noreorder\n.set nomacro\n");
208#endif
203 209
204 for (i = rel = 0; i < ctx->nsym; i++) { 210 for (i = rel = 0; i < ctx->nsym; i++) {
205 int32_t ofs = ctx->sym[i].ofs; 211 int32_t ofs = ctx->sym[i].ofs;
diff --git a/src/buildvm_mips.dasc b/src/buildvm_mips.dasc
new file mode 100644
index 00000000..6b3103dd
--- /dev/null
+++ b/src/buildvm_mips.dasc
@@ -0,0 +1,4114 @@
1|// Low-level VM code for MIPS CPUs.
2|// Bytecode interpreter, fast functions and helper functions.
3|// Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h
4|
5|.arch mips
6|.section code_op, code_sub
7|
8|.actionlist build_actionlist
9|.globals GLOB_
10|.globalnames globnames
11|.externnames extnames
12|
13|// Note: The ragged indentation of the instructions is intentional.
14|// The starting columns indicate data dependencies.
15|
16|//-----------------------------------------------------------------------
17|
18|// Fixed register assignments for the interpreter.
19|// Don't use: r0 = 0, r26/r27 = reserved, r28 = gp, r29 = sp, r31 = ra
20|
21|// The following must be C callee-save (but BASE is often refetched).
22|.define BASE, r16 // Base of current Lua stack frame.
23|.define KBASE, r17 // Constants of current Lua function.
24|.define PC, r18 // Next PC.
25|.define DISPATCH, r19 // Opcode dispatch table.
26|.define LREG, r20 // Register holding lua_State (also in SAVE_L).
27|.define MULTRES, r21 // Size of multi-result: (nresults+1)*8.
28|// NYI: r22 currently unused.
29|
30|.define JGL, r30 // On-trace: global_State + 32768.
31|
32|// Constants for type-comparisons, stores and conversions. C callee-save.
33|.define TISNIL, r30
34|.define TOBIT, f30 // 2^52 + 2^51.
35|
36|// The following temporaries are not saved across C calls, except for RA.
37|.define RA, r23 // Callee-save.
38|.define RB, r8
39|.define RC, r9
40|.define RD, r10
41|.define INS, r11
42|
43|.define AT, r1 // Assembler temporary.
44|.define TMP0, r12
45|.define TMP1, r13
46|.define TMP2, r14
47|.define TMP3, r15
48|
49|// Calling conventions.
50|.define CFUNCADDR, r25
51|.define CARG1, r4
52|.define CARG2, r5
53|.define CARG3, r6
54|.define CARG4, r7
55|
56|.define CRET1, r2
57|.define CRET2, r3
58|
59|.define FARG1, f12
60|.define FARG2, f14
61|
62|.define FRET1, f0
63|.define FRET2, f2
64|
65|// Stack layout while in interpreter. Must match with lj_frame.h.
66|.define CFRAME_SPACE, 112 // Delta for sp.
67|
68|.define SAVE_ERRF, 124(sp) // 32 bit C frame info.
69|.define SAVE_NRES, 120(sp)
70|.define SAVE_CFRAME, 116(sp)
71|.define SAVE_L, 112(sp)
72|//----- 8 byte aligned, ^^^^ 16 byte register save area, owned by interpreter.
73|.define SAVE_GPR_, 72 // .. 72+10*4: 32 bit GPR saves.
74|.define SAVE_FPR_, 24 // .. 24+6*8: 64 bit FPR saves.
75|.define SAVE_PC, 20(sp)
76|.define ARG5, 16(sp)
77|.define CSAVE_4, 12(sp)
78|.define CSAVE_3, 8(sp)
79|.define CSAVE_2, 4(sp)
80|.define CSAVE_1, 0(sp)
81|//----- 8 byte aligned, ^^^^ 16 byte register save area, owned by callee.
82|
83|.define ARG5_OFS, 16
84|.define SAVE_MULTRES, ARG5
85|
86|.macro saveregs
87| addiu sp, sp, -CFRAME_SPACE
88| sw ra, SAVE_GPR_+9*4(sp)
89| sw r30, SAVE_GPR_+8*4(sp)
90| sdc1 f30, SAVE_FPR_+5*8(sp)
91| sw r23, SAVE_GPR_+7*4(sp)
92| sw r22, SAVE_GPR_+6*4(sp)
93| sdc1 f28, SAVE_FPR_+4*8(sp)
94| sw r21, SAVE_GPR_+5*4(sp)
95| sw r20, SAVE_GPR_+4*4(sp)
96| sdc1 f26, SAVE_FPR_+3*8(sp)
97| sw r19, SAVE_GPR_+3*4(sp)
98| sw r18, SAVE_GPR_+2*4(sp)
99| sdc1 f24, SAVE_FPR_+2*8(sp)
100| sw r17, SAVE_GPR_+1*4(sp)
101| sw r16, SAVE_GPR_+0*4(sp)
102| sdc1 f22, SAVE_FPR_+1*8(sp)
103| sdc1 f20, SAVE_FPR_+0*8(sp)
104|.endmacro
105|
106|.macro restoreregs_ret
107| lw ra, SAVE_GPR_+9*4(sp)
108| lw r30, SAVE_GPR_+8*4(sp)
109| ldc1 f30, SAVE_FPR_+5*8(sp)
110| lw r23, SAVE_GPR_+7*4(sp)
111| lw r22, SAVE_GPR_+6*4(sp)
112| ldc1 f28, SAVE_FPR_+4*8(sp)
113| lw r21, SAVE_GPR_+5*4(sp)
114| lw r20, SAVE_GPR_+4*4(sp)
115| ldc1 f26, SAVE_FPR_+3*8(sp)
116| lw r19, SAVE_GPR_+3*4(sp)
117| lw r18, SAVE_GPR_+2*4(sp)
118| ldc1 f24, SAVE_FPR_+2*8(sp)
119| lw r17, SAVE_GPR_+1*4(sp)
120| lw r16, SAVE_GPR_+0*4(sp)
121| ldc1 f22, SAVE_FPR_+1*8(sp)
122| ldc1 f20, SAVE_FPR_+0*8(sp)
123| jr ra
124| addiu sp, sp, CFRAME_SPACE
125|.endmacro
126|
127|// Type definitions. Some of these are only used for documentation.
128|.type L, lua_State, LREG
129|.type GL, global_State
130|.type TVALUE, TValue
131|.type GCOBJ, GCobj
132|.type STR, GCstr
133|.type TAB, GCtab
134|.type LFUNC, GCfuncL
135|.type CFUNC, GCfuncC
136|.type PROTO, GCproto
137|.type UPVAL, GCupval
138|.type NODE, Node
139|.type NARGS8, int
140|.type TRACE, GCtrace
141|
142|//-----------------------------------------------------------------------
143|
144|// Trap for not-yet-implemented parts.
145|.macro NYI; .long 0xf0f0f0f0; .endmacro
146|
147|// Macros to mark delay slots.
148|.macro ., a; a; .endmacro
149|.macro ., a,b; a,b; .endmacro
150|.macro ., a,b,c; a,b,c; .endmacro
151|
152|//-----------------------------------------------------------------------
153|
154|// Endian-specific defines.
155|.define FRAME_PC, LJ_ENDIAN_SELECT(-4,-8)
156|.define FRAME_FUNC, LJ_ENDIAN_SELECT(-8,-4)
157|.define HI, LJ_ENDIAN_SELECT(4,0)
158|.define LO, LJ_ENDIAN_SELECT(0,4)
159|.define OFS_RD, LJ_ENDIAN_SELECT(2,0)
160|.define OFS_RA, LJ_ENDIAN_SELECT(1,2)
161|.define OFS_OP, LJ_ENDIAN_SELECT(0,3)
162|
163|// Instruction decode.
164|.macro decode_OP1, dst, ins; andi dst, ins, 0xff; .endmacro
165|.macro decode_OP4a, dst, ins; andi dst, ins, 0xff; .endmacro
166|.macro decode_OP4b, dst; sll dst, dst, 2; .endmacro
167|.macro decode_RC4a, dst, ins; srl dst, ins, 14; .endmacro
168|.macro decode_RC4b, dst; andi dst, dst, 0x3fc; .endmacro
169|.macro decode_RD4b, dst; sll dst, dst, 2; .endmacro
170|.macro decode_RA8a, dst, ins; srl dst, ins, 5; .endmacro
171|.macro decode_RA8b, dst; andi dst, dst, 0x7f8; .endmacro
172|.macro decode_RB8a, dst, ins; srl dst, ins, 21; .endmacro
173|.macro decode_RB8b, dst; andi dst, dst, 0x7f8; .endmacro
174|.macro decode_RD8a, dst, ins; srl dst, ins, 16; .endmacro
175|.macro decode_RD8b, dst; sll dst, dst, 3; .endmacro
176|.macro decode_RDtoRC8, dst, src; andi dst, src, 0x7f8; .endmacro
177|
178|// Instruction fetch.
179|.macro ins_NEXT1
180| lw INS, 0(PC)
181| addiu PC, PC, 4
182|.endmacro
183|// Instruction decode+dispatch.
184|.macro ins_NEXT2
185| decode_OP4a TMP1, INS
186| decode_OP4b TMP1
187| addu TMP0, DISPATCH, TMP1
188| decode_RD8a RD, INS
189| lw AT, 0(TMP0)
190| decode_RA8a RA, INS
191| decode_RD8b RD
192| jr AT
193| decode_RA8b RA
194|.endmacro
195|.macro ins_NEXT
196| ins_NEXT1
197| ins_NEXT2
198|.endmacro
199|
200|// Instruction footer.
201|.if 1
202| // Replicated dispatch. Less unpredictable branches, but higher I-Cache use.
203| .define ins_next, ins_NEXT
204| .define ins_next_, ins_NEXT
205| .define ins_next1, ins_NEXT1
206| .define ins_next2, ins_NEXT2
207|.else
208| // Common dispatch. Lower I-Cache use, only one (very) unpredictable branch.
209| // Affects only certain kinds of benchmarks (and only with -j off).
210| .macro ins_next
211| b ->ins_next
212| .endmacro
213| .macro ins_next1
214| .endmacro
215| .macro ins_next2
216| b ->ins_next
217| .endmacro
218| .macro ins_next_
219| ->ins_next:
220| ins_NEXT
221| .endmacro
222|.endif
223|
224|// Call decode and dispatch.
225|.macro ins_callt
226| // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC
227| lw PC, LFUNC:RB->pc
228| lw INS, 0(PC)
229| addiu PC, PC, 4
230| decode_OP4a TMP1, INS
231| decode_RA8a RA, INS
232| decode_OP4b TMP1
233| decode_RA8b RA
234| addu TMP0, DISPATCH, TMP1
235| lw TMP0, 0(TMP0)
236| jr TMP0
237| addu RA, RA, BASE
238|.endmacro
239|
240|.macro ins_call
241| // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, PC = caller PC
242| sw PC, FRAME_PC(BASE)
243| ins_callt
244|.endmacro
245|
246|//-----------------------------------------------------------------------
247|
248|.macro branch_RD
249| srl TMP0, RD, 1
250| lui AT, (-(BCBIAS_J*4 >> 16) & 65535)
251| addu TMP0, TMP0, AT
252| addu PC, PC, TMP0
253|.endmacro
254|
255|// Assumes DISPATCH is relative to GL.
256#define DISPATCH_GL(field) (GG_DISP2G + (int)offsetof(global_State, field))
257#define DISPATCH_J(field) (GG_DISP2J + (int)offsetof(jit_State, field))
258#define GG_DISP2GOT (GG_OFS(got) - GG_OFS(dispatch))
259#define DISPATCH_GOT(name) (GG_DISP2GOT + 4*LJ_GOT_##name)
260|
261#define PC2PROTO(field) ((int)offsetof(GCproto, field)-(int)sizeof(GCproto))
262|
263|.macro load_got, func
264| lw CFUNCADDR, DISPATCH_GOT(func)(DISPATCH)
265|.endmacro
266|// Much faster. Sadly, there's no easy way to force the required code layout.
267|// .macro call_intern, func; bal extern func; .endmacro
268|.macro call_intern, func; jalr CFUNCADDR; .endmacro
269|.macro call_extern; jalr CFUNCADDR; .endmacro
270|.macro jmp_extern; jr CFUNCADDR; .endmacro
271|
272|.macro hotcheck, delta, target
273|NYI
274|.endmacro
275|
276|.macro hotloop
277| hotcheck HOTCOUNT_LOOP, ->vm_hotloop
278|.endmacro
279|
280|.macro hotcall
281| hotcheck HOTCOUNT_CALL, ->vm_hotcall
282|.endmacro
283|
284|// Set current VM state. Uses TMP0.
285|.macro li_vmstate, st; li TMP0, ~LJ_VMST_..st; .endmacro
286|.macro st_vmstate; sw TMP0, DISPATCH_GL(vmstate)(DISPATCH); .endmacro
287|
288|// Move table write barrier back. Overwrites mark and tmp.
289|.macro barrierback, tab, mark, tmp, target
290| lw tmp, DISPATCH_GL(gc.grayagain)(DISPATCH)
291| andi mark, mark, ~LJ_GC_BLACK & 255 // black2gray(tab)
292| sw tab, DISPATCH_GL(gc.grayagain)(DISPATCH)
293| sb mark, tab->marked
294| b target
295|. sw tmp, tab->gclist
296|.endmacro
297|
298|//-----------------------------------------------------------------------
299
300/* Generate subroutines used by opcodes and other parts of the VM. */
301/* The .code_sub section should be last to help static branch prediction. */
302static void build_subroutines(BuildCtx *ctx)
303{
304 |.code_sub
305 |
306 |//-----------------------------------------------------------------------
307 |//-- Return handling ----------------------------------------------------
308 |//-----------------------------------------------------------------------
309 |
310 |->vm_returnp:
311 | // See vm_return. Also: TMP2 = previous base.
312 | andi AT, PC, FRAME_P
313 | beqz AT, ->cont_dispatch
314 |. li TMP1, LJ_TTRUE
315 |
316 | // Return from pcall or xpcall fast func.
317 | lw PC, FRAME_PC(TMP2) // Fetch PC of previous frame.
318 | move BASE, TMP2 // Restore caller base.
319 | // Prepending may overwrite the pcall frame, so do it at the end.
320 | sw TMP1, FRAME_PC(RA) // Prepend true to results.
321 | addiu RA, RA, -8
322 |
323 |->vm_returnc:
324 | andi TMP0, PC, FRAME_TYPE
325 | addiu RD, RD, 8 // RD = (nresults+1)*8.
326 | beqz TMP0, ->BC_RET_Z // Handle regular return to Lua.
327 |. move MULTRES, RD
328 |
329 |->vm_return:
330 | // BASE = base, RA = resultptr, RD/MULTRES = (nresults+1)*8, PC = return
331 | // TMP0 = PC & FRAME_TYPE
332 | li TMP2, -8
333 | xori AT, TMP0, FRAME_C
334 | and TMP2, PC, TMP2
335 | bnez AT, ->vm_returnp
336 | subu TMP2, BASE, TMP2 // TMP2 = previous base.
337 |
338 | addiu TMP1, RD, -8
339 | sw TMP2, L->base
340 | li_vmstate C
341 | lw TMP2, SAVE_NRES
342 | addiu BASE, BASE, -8
343 | st_vmstate
344 | beqz TMP1, >2
345 |. sll TMP2, TMP2, 3
346 |1:
347 | addiu TMP1, TMP1, -8
348 | ldc1 f0, 0(RA)
349 | addiu RA, RA, 8
350 | sdc1 f0, 0(BASE)
351 | bnez TMP1, <1
352 |. addiu BASE, BASE, 8
353 |
354 |2:
355 | bne TMP2, RD, >6
356 |3:
357 |. sw BASE, L->top // Store new top.
358 |
359 |->vm_leave_cp:
360 | lw TMP0, SAVE_CFRAME // Restore previous C frame.
361 | move CRET1, r0 // Ok return status for vm_pcall.
362 | sw TMP0, L->cframe
363 |
364 |->vm_leave_unw:
365 | restoreregs_ret
366 |
367 |6:
368 | lw TMP1, L->maxstack
369 | slt AT, TMP2, RD
370 | bnez AT, >7 // Less results wanted?
371 | // More results wanted. Check stack size and fill up results with nil.
372 |. slt AT, BASE, TMP1
373 | beqz AT, >8
374 |. nop
375 | sw TISNIL, HI(BASE)
376 | addiu RD, RD, 8
377 | b <2
378 |. addiu BASE, BASE, 8
379 |
380 |7: // Less results wanted.
381 | subu TMP0, RD, TMP2
382 | subu TMP0, BASE, TMP0 // Either keep top or shrink it.
383 | b <3
384 |. movn BASE, TMP0, TMP2 // LUA_MULTRET+1 case?
385 |
386 |8: // Corner case: need to grow stack for filling up results.
387 | // This can happen if:
388 | // - A C function grows the stack (a lot).
389 | // - The GC shrinks the stack in between.
390 | // - A return back from a lua_call() with (high) nresults adjustment.
391 | load_got lj_state_growstack
392 | move MULTRES, RD
393 | move CARG2, TMP2
394 | call_intern lj_state_growstack // (lua_State *L, int n)
395 |. move CARG1, L
396 | lw TMP2, SAVE_NRES
397 | lw BASE, L->top // Need the (realloced) L->top in BASE.
398 | move RD, MULTRES
399 | b <2
400 |. sll TMP2, TMP2, 3
401 |
402 |->vm_unwind_c: // Unwind C stack, return from vm_pcall.
403 | // (void *cframe, int errcode)
404 | move sp, CARG1
405 | move CRET1, CARG2
406 |->vm_unwind_c_eh: // Landing pad for external unwinder.
407 | lw L, SAVE_L
408 | li TMP0, ~LJ_VMST_C
409 | lw GL:TMP1, L->glref
410 | b ->vm_leave_unw
411 |. sw TMP0, GL:TMP1->vmstate
412 |
413 |->vm_unwind_ff: // Unwind C stack, return from ff pcall.
414 | // (void *cframe)
415 | li AT, -4
416 | and sp, CARG1, AT
417 |->vm_unwind_ff_eh: // Landing pad for external unwinder.
418 | lw L, SAVE_L
419 | lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float).
420 | li TISNIL, LJ_TNIL
421 | lw BASE, L->base
422 | lw DISPATCH, L->glref // Setup pointer to dispatch table.
423 | mtc1 TMP3, TOBIT
424 | li TMP1, LJ_TFALSE
425 | li_vmstate INTERP
426 | lw PC, FRAME_PC(BASE) // Fetch PC of previous frame.
427 | cvt.d.s TOBIT, TOBIT
428 | addiu RA, BASE, -8 // Results start at BASE-8.
429 | addiu DISPATCH, DISPATCH, GG_G2DISP
430 | sw TMP1, HI(RA) // Prepend false to error message.
431 | st_vmstate
432 | b ->vm_returnc
433 |. li RD, 16 // 2 results: false + error message.
434 |
435 |//-----------------------------------------------------------------------
436 |//-- Grow stack for calls -----------------------------------------------
437 |//-----------------------------------------------------------------------
438 |
439 |->vm_growstack_c: // Grow stack for C function.
440 | b >2
441 |. li CARG2, LUA_MINSTACK
442 |
443 |->vm_growstack_l: // Grow stack for Lua function.
444 | // BASE = new base, RA = BASE+framesize*8, RC = nargs*8, PC = first PC
445 | addu RC, BASE, RC
446 | subu RA, RA, BASE
447 | sw BASE, L->base
448 | addiu PC, PC, 4 // Must point after first instruction.
449 | sw RC, L->top
450 | srl CARG2, RA, 3
451 |2:
452 | // L->base = new base, L->top = top
453 | load_got lj_state_growstack
454 | sw PC, SAVE_PC
455 | call_intern lj_state_growstack // (lua_State *L, int n)
456 |. move CARG1, L
457 | lw BASE, L->base
458 | lw RC, L->top
459 | lw LFUNC:RB, FRAME_FUNC(BASE)
460 | subu RC, RC, BASE
461 | // BASE = new base, RB = LFUNC/CFUNC, RC = nargs*8, FRAME_PC(BASE) = PC
462 | ins_callt // Just retry the call.
463 |
464 |//-----------------------------------------------------------------------
465 |//-- Entry points into the assembler VM ---------------------------------
466 |//-----------------------------------------------------------------------
467 |
468 |->vm_resume: // Setup C frame and resume thread.
469 | // (lua_State *L, TValue *base, int nres1 = 0, ptrdiff_t ef = 0)
470 | saveregs
471 | move L, CARG1
472 | lw DISPATCH, L->glref // Setup pointer to dispatch table.
473 | move BASE, CARG2
474 | lbu TMP1, L->status
475 | sw L, SAVE_L
476 | li PC, FRAME_CP
477 | addiu TMP0, sp, CFRAME_RESUME
478 | addiu DISPATCH, DISPATCH, GG_G2DISP
479 | sw r0, SAVE_NRES
480 | sw r0, SAVE_ERRF
481 | sw TMP0, L->cframe
482 | sw r0, SAVE_CFRAME
483 | beqz TMP1, >3
484 |. sw CARG1, SAVE_PC // Any value outside of bytecode is ok.
485 |
486 | // Resume after yield (like a return).
487 | move RA, BASE
488 | lw BASE, L->base
489 | lw TMP1, L->top
490 | lw PC, FRAME_PC(BASE)
491 | lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float).
492 | subu RD, TMP1, BASE
493 | mtc1 TMP3, TOBIT
494 | sb r0, L->status
495 | cvt.d.s TOBIT, TOBIT
496 | li_vmstate INTERP
497 | addiu RD, RD, 8
498 | st_vmstate
499 | move MULTRES, RD
500 | andi TMP0, PC, FRAME_TYPE
501 | beqz TMP0, ->BC_RET_Z
502 |. li TISNIL, LJ_TNIL
503 | b ->vm_return
504 |. nop
505 |
506 |->vm_pcall: // Setup protected C frame and enter VM.
507 | // (lua_State *L, TValue *base, int nres1, ptrdiff_t ef)
508 | saveregs
509 | sw CARG4, SAVE_ERRF
510 | b >1
511 |. li PC, FRAME_CP
512 |
513 |->vm_call: // Setup C frame and enter VM.
514 | // (lua_State *L, TValue *base, int nres1)
515 | saveregs
516 | li PC, FRAME_C
517 |
518 |1: // Entry point for vm_pcall above (PC = ftype).
519 | lw TMP1, L:CARG1->cframe
520 | sw CARG3, SAVE_NRES
521 | move L, CARG1
522 | sw CARG1, SAVE_L
523 | move BASE, CARG2
524 | sw sp, L->cframe // Add our C frame to cframe chain.
525 | lw DISPATCH, L->glref // Setup pointer to dispatch table.
526 | sw CARG1, SAVE_PC // Any value outside of bytecode is ok.
527 | sw TMP1, SAVE_CFRAME
528 | addiu DISPATCH, DISPATCH, GG_G2DISP
529 |
530 |3: // Entry point for vm_cpcall/vm_resume (BASE = base, PC = ftype).
531 | lw TMP2, L->base // TMP2 = old base (used in vmeta_call).
532 | lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float).
533 | lw TMP1, L->top
534 | mtc1 TMP3, TOBIT
535 | addu PC, PC, BASE
536 | subu NARGS8:RC, TMP1, BASE
537 | subu PC, PC, TMP2 // PC = frame delta + frame type
538 | cvt.d.s TOBIT, TOBIT
539 | li_vmstate INTERP
540 | li TISNIL, LJ_TNIL
541 | st_vmstate
542 |
543 |->vm_call_dispatch:
544 | // TMP2 = old base, BASE = new base, RC = nargs*8, PC = caller PC
545 | lw TMP0, FRAME_PC(BASE)
546 | li AT, LJ_TFUNC
547 | bne TMP0, AT, ->vmeta_call
548 |. lw LFUNC:RB, FRAME_FUNC(BASE)
549 |
550 |->vm_call_dispatch_f:
551 | ins_call
552 | // BASE = new base, RB = func, RC = nargs*8, PC = caller PC
553 |
554 |->vm_cpcall: // Setup protected C frame, call C.
555 | // (lua_State *L, lua_CFunction func, void *ud, lua_CPFunction cp)
556 | saveregs
557 | move L, CARG1
558 | lw TMP0, L:CARG1->stack
559 | sw CARG1, SAVE_L
560 | lw TMP1, L->top
561 | sw CARG1, SAVE_PC // Any value outside of bytecode is ok.
562 | subu TMP0, TMP0, TMP1 // Compute -savestack(L, L->top).
563 | lw TMP1, L->cframe
564 | sw sp, L->cframe // Add our C frame to cframe chain.
565 | sw TMP0, SAVE_NRES // Neg. delta means cframe w/o frame.
566 | sw r0, SAVE_ERRF // No error function.
567 | move CFUNCADDR, CARG4
568 | jalr CARG4 // (lua_State *L, lua_CFunction func, void *ud)
569 |. sw TMP1, SAVE_CFRAME
570 | move BASE, CRET1
571 | lw DISPATCH, L->glref // Setup pointer to dispatch table.
572 | li PC, FRAME_CP
573 | bnez CRET1, <3 // Else continue with the call.
574 |. addiu DISPATCH, DISPATCH, GG_G2DISP
575 | b ->vm_leave_cp // No base? Just remove C frame.
576 |. nop
577 |
578 |//-----------------------------------------------------------------------
579 |//-- Metamethod handling ------------------------------------------------
580 |//-----------------------------------------------------------------------
581 |
582 |// The lj_meta_* functions (except for lj_meta_cat) don't reallocate the
583 |// stack, so BASE doesn't need to be reloaded across these calls.
584 |
585 |//-- Continuation dispatch ----------------------------------------------
586 |
587 |->cont_dispatch:
588 | // BASE = meta base, RA = resultptr, RD = (nresults+1)*8
589 | lw TMP0, -16+LO(BASE) // Continuation.
590 | move RB, BASE
591 | move BASE, TMP2 // Restore caller BASE.
592 | lw LFUNC:TMP1, FRAME_FUNC(TMP2)
593#if LJ_HASFFI
594 | sltiu AT, TMP0, 2
595#endif
596 | lw PC, -16+HI(RB) // Restore PC from [cont|PC].
597 | addu TMP2, RA, RD
598 | lw TMP1, LFUNC:TMP1->pc
599#if LJ_HASFFI
600 | bnez AT, >1
601#endif
602 |. sw TISNIL, -8+HI(TMP2) // Ensure one valid arg.
603 | // BASE = base, RA = resultptr, RB = meta base
604 | jr TMP0 // Jump to continuation.
605 |. lw KBASE, PC2PROTO(k)(TMP1)
606 |
607#if LJ_HASFFI
608 |1:
609 | bnez TMP0, ->cont_ffi_callback // cont = 1: return from FFI callback.
610 | // cont = 0: tailcall from C function.
611 |. addiu TMP1, RB, -16
612 | b ->vm_call_tail
613 |. subu RC, TMP1, BASE
614#endif
615 |
616 |->cont_cat: // RA = resultptr, RB = meta base
617 | lw INS, -4(PC)
618 | addiu CARG2, RB, -16
619 | ldc1 f0, 0(RA)
620 | decode_RB8a MULTRES, INS
621 | decode_RA8a RA, INS
622 | decode_RB8b MULTRES
623 | decode_RA8b RA
624 | addu TMP1, BASE, MULTRES
625 | sw BASE, L->base
626 | subu CARG3, CARG2, TMP1
627 | bne TMP1, CARG2, ->BC_CAT_Z
628 |. sdc1 f0, 0(CARG2)
629 | addu RA, BASE, RA
630 | b ->cont_nop
631 |. sdc1 f0, 0(RA)
632 |
633 |//-- Table indexing metamethods -----------------------------------------
634 |
635 |->vmeta_tgets1:
636 | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)
637 | li TMP0, LJ_TSTR
638 | sw STR:RC, LO(CARG3)
639 | b >1
640 |. sw TMP0, HI(CARG3)
641 |
642 |->vmeta_tgets:
643 | addiu CARG2, DISPATCH, DISPATCH_GL(tmptv)
644 | li TMP0, LJ_TTAB
645 | sw TAB:RB, LO(CARG2)
646 | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv2)
647 | sw TMP0, HI(CARG2)
648 | li TMP1, LJ_TSTR
649 | sw STR:RC, LO(CARG3)
650 | b >1
651 |. sw TMP1, HI(CARG3)
652 |
653 |->vmeta_tgetb: // TMP0 = index
654 | mtc1 TMP0, f0
655 | cvt.d.w f0, f0
656 | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)
657 | sdc1 f0, 0(CARG3)
658 |
659 |->vmeta_tgetv:
660 |1:
661 | load_got lj_meta_tget
662 | sw BASE, L->base
663 | sw PC, SAVE_PC
664 | call_intern lj_meta_tget // (lua_State *L, TValue *o, TValue *k)
665 |. move CARG1, L
666 | // Returns TValue * (finished) or NULL (metamethod).
667 | beqz CRET1, >3
668 |. addiu TMP1, BASE, -FRAME_CONT
669 | ldc1 f0, 0(CRET1)
670 | ins_next1
671 | sdc1 f0, 0(RA)
672 | ins_next2
673 |
674 |3: // Call __index metamethod.
675 | // BASE = base, L->top = new base, stack = cont/func/t/k
676 | lw BASE, L->top
677 | sw PC, -16+HI(BASE) // [cont|PC]
678 | subu PC, BASE, TMP1
679 | lw LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here.
680 | b ->vm_call_dispatch_f
681 |. li NARGS8:RC, 16 // 2 args for func(t, k).
682 |
683 |//-----------------------------------------------------------------------
684 |
685 |->vmeta_tsets1:
686 | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)
687 | li TMP0, LJ_TSTR
688 | sw STR:RC, LO(CARG3)
689 | b >1
690 |. sw TMP0, HI(CARG3)
691 |
692 |->vmeta_tsets:
693 | addiu CARG2, DISPATCH, DISPATCH_GL(tmptv)
694 | li TMP0, LJ_TTAB
695 | sw TAB:RB, LO(CARG2)
696 | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv2)
697 | sw TMP0, HI(CARG2)
698 | li TMP1, LJ_TSTR
699 | sw STR:RC, LO(CARG3)
700 | b >1
701 |. sw TMP1, HI(CARG3)
702 |
703 |->vmeta_tsetb: // TMP0 = index
704 | mtc1 TMP0, f0
705 | cvt.d.w f0, f0
706 | addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)
707 | sdc1 f0, 0(CARG3)
708 |
709 |->vmeta_tsetv:
710 |1:
711 | load_got lj_meta_tset
712 | sw BASE, L->base
713 | sw PC, SAVE_PC
714 | call_intern lj_meta_tset // (lua_State *L, TValue *o, TValue *k)
715 |. move CARG1, L
716 | // Returns TValue * (finished) or NULL (metamethod).
717 | beqz CRET1, >3
718 |. ldc1 f0, 0(RA)
719 | // NOBARRIER: lj_meta_tset ensures the table is not black.
720 | ins_next1
721 | sdc1 f0, 0(CRET1)
722 | ins_next2
723 |
724 |3: // Call __newindex metamethod.
725 | // BASE = base, L->top = new base, stack = cont/func/t/k/(v)
726 | addiu TMP1, BASE, -FRAME_CONT
727 | lw BASE, L->top
728 | sw PC, -16+HI(BASE) // [cont|PC]
729 | subu PC, BASE, TMP1
730 | lw LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here.
731 | sdc1 f0, 16(BASE) // Copy value to third argument.
732 | b ->vm_call_dispatch_f
733 |. li NARGS8:RC, 24 // 3 args for func(t, k, v)
734 |
735 |//-- Comparison metamethods ---------------------------------------------
736 |
737 |->vmeta_comp:
738 | // CARG2, CARG3 are already set by BC_ISLT/BC_ISGE/BC_ISLE/BC_ISGT.
739 | load_got lj_meta_comp
740 | addiu PC, PC, -4
741 | sw BASE, L->base
742 | sw PC, SAVE_PC
743 | decode_OP1 CARG4, INS
744 | call_intern lj_meta_comp // (lua_State *L, TValue *o1, *o2, int op)
745 |. move CARG1, L
746 | // Returns 0/1 or TValue * (metamethod).
747 |3:
748 | sltiu AT, CRET1, 2
749 | beqz AT, ->vmeta_binop
750 | negu TMP2, CRET1
751 |4:
752 | lhu RD, OFS_RD(PC)
753 | addiu PC, PC, 4
754 | lui TMP1, (-(BCBIAS_J*4 >> 16) & 65535)
755 | sll RD, RD, 2
756 | addu RD, RD, TMP1
757 | and RD, RD, TMP2
758 | addu PC, PC, RD
759 |->cont_nop:
760 | ins_next
761 |
762 |->cont_ra: // RA = resultptr
763 | lbu TMP1, -4+OFS_RA(PC)
764 | ldc1 f0, 0(RA)
765 | sll TMP1, TMP1, 3
766 | addu TMP1, BASE, TMP1
767 | b ->cont_nop
768 |. sdc1 f0, 0(TMP1)
769 |
770 |->cont_condt: // RA = resultptr
771 | lw TMP0, HI(RA)
772 | sltiu AT, TMP0, LJ_TISTRUECOND
773 | b <4
774 |. negu TMP2, AT // Branch if result is true.
775 |
776 |->cont_condf: // RA = resultptr
777 | lw TMP0, HI(RA)
778 | sltiu AT, TMP0, LJ_TISTRUECOND
779 | b <4
780 |. addiu TMP2, AT, -1 // Branch if result is false.
781 |
782 |->vmeta_equal:
783 | // CARG2, CARG3, CARG4 are already set by BC_ISEQV/BC_ISNEV.
784 | load_got lj_meta_equal
785 | addiu PC, PC, -4
786 | sw BASE, L->base
787 | sw PC, SAVE_PC
788 | call_intern lj_meta_equal // (lua_State *L, GCobj *o1, *o2, int ne)
789 |. move CARG1, L
790 | // Returns 0/1 or TValue * (metamethod).
791 | b <3
792 |. nop
793 |
794 |->vmeta_equal_cd:
795#if LJ_HASFFI
796 | load_got lj_meta_equal_cd
797 | move CARG2, INS
798 | addiu PC, PC, -4
799 | sw BASE, L->base
800 | sw PC, SAVE_PC
801 | call_intern lj_meta_equal_cd // (lua_State *L, BCIns op)
802 |. move CARG1, L
803 | // Returns 0/1 or TValue * (metamethod).
804 | b <3
805 |. nop
806#endif
807 |
808 |//-- Arithmetic metamethods ---------------------------------------------
809 |
810 |->vmeta_unm:
811 | move CARG4, CARG3
812 |
813 |->vmeta_arith:
814 | load_got lj_meta_arith
815 | decode_OP1 TMP0, INS
816 | sw BASE, L->base
817 | sw PC, SAVE_PC
818 | move CARG2, RA
819 | sw TMP0, ARG5
820 | call_intern lj_meta_arith // (lua_State *L, TValue *ra,*rb,*rc, BCReg op)
821 |. move CARG1, L
822 | // Returns NULL (finished) or TValue * (metamethod).
823 | beqz CRET1, ->cont_nop
824 |. nop
825 |
826 | // Call metamethod for binary op.
827 |->vmeta_binop:
828 | // BASE = old base, CRET1 = new base, stack = cont/func/o1/o2
829 | subu TMP1, CRET1, BASE
830 | sw PC, -16+HI(CRET1) // [cont|PC]
831 | move TMP2, BASE
832 | addiu PC, TMP1, FRAME_CONT
833 | move BASE, CRET1
834 | b ->vm_call_dispatch
835 |. li NARGS8:RC, 16 // 2 args for func(o1, o2).
836 |
837 |->vmeta_len:
838 | // CARG2 already set by BC_LEN.
839#ifdef LUAJIT_ENABLE_LUA52COMPAT
840 | move MULTRES, CARG1
841#endif
842 | load_got lj_meta_len
843 | sw BASE, L->base
844 | sw PC, SAVE_PC
845 | call_intern lj_meta_len // (lua_State *L, TValue *o)
846 |. move CARG1, L
847 | // Returns NULL (retry) or TValue * (metamethod base).
848#ifdef LUAJIT_ENABLE_LUA52COMPAT
849 | bnez CRET1, ->vmeta_binop // Binop call for compatibility.
850 |. nop
851 | b ->BC_LEN_Z
852 |. move CARG1, MULTRES
853#else
854 | b ->vmeta_binop // Binop call for compatibility.
855 |. nop
856#endif
857 |
858 |//-- Call metamethod ----------------------------------------------------
859 |
860 |->vmeta_call: // Resolve and call __call metamethod.
861 | // TMP2 = old base, BASE = new base, RC = nargs*8
862 | load_got lj_meta_call
863 | sw TMP2, L->base // This is the callers base!
864 | addiu CARG2, BASE, -8
865 | sw PC, SAVE_PC
866 | addu CARG3, BASE, RC
867 | move MULTRES, NARGS8:RC
868 | call_intern lj_meta_call // (lua_State *L, TValue *func, TValue *top)
869 |. move CARG1, L
870 | lw LFUNC:RB, FRAME_FUNC(BASE) // Guaranteed to be a function here.
871 | addiu NARGS8:RC, MULTRES, 8 // Got one more argument now.
872 | ins_call
873 |
874 |->vmeta_callt: // Resolve __call for BC_CALLT.
875 | // BASE = old base, RA = new base, RC = nargs*8
876 | load_got lj_meta_call
877 | sw BASE, L->base
878 | addiu CARG2, RA, -8
879 | sw PC, SAVE_PC
880 | addu CARG3, RA, RC
881 | move MULTRES, NARGS8:RC
882 | call_intern lj_meta_call // (lua_State *L, TValue *func, TValue *top)
883 |. move CARG1, L
884 | lw TMP1, FRAME_PC(BASE)
885 | lw LFUNC:RB, FRAME_FUNC(RA) // Guaranteed to be a function here.
886 | b ->BC_CALLT_Z
887 |. addiu NARGS8:RC, MULTRES, 8 // Got one more argument now.
888 |
889 |//-- Argument coercion for 'for' statement ------------------------------
890 |
891 |->vmeta_for:
892 | load_got lj_meta_for
893 | sw BASE, L->base
894 | move CARG2, RA
895 | sw PC, SAVE_PC
896 | move MULTRES, INS
897 | call_intern lj_meta_for // (lua_State *L, TValue *base)
898 |. move CARG1, L
899#if LJ_HASJIT
900 | decode_OP1 TMP0, MULTRES
901 | li AT, BC_JFORI
902#endif
903 | decode_RA8a RA, MULTRES
904 | decode_RD8a RD, MULTRES
905 | decode_RA8b RA
906#if LJ_HASJIT
907 | beq TMP0, AT, =>BC_JFORI
908 |. decode_RD8b RD
909 | b =>BC_FORI
910 |. nop
911#else
912 | b =>BC_FORI
913 |. decode_RD8b RD
914#endif
915 |
916 |//-----------------------------------------------------------------------
917 |//-- Fast functions -----------------------------------------------------
918 |//-----------------------------------------------------------------------
919 |
920 |.macro .ffunc, name
921 |->ff_ .. name:
922 |.endmacro
923 |
924 |.macro .ffunc_1, name
925 |->ff_ .. name:
926 | beqz NARGS8:RC, ->fff_fallback
927 |. lw CARG3, HI(BASE)
928 | lw CARG1, LO(BASE)
929 |.endmacro
930 |
931 |.macro .ffunc_2, name
932 |->ff_ .. name:
933 | sltiu AT, NARGS8:RC, 16
934 | lw CARG3, HI(BASE)
935 | bnez AT, ->fff_fallback
936 |. lw CARG4, 8+HI(BASE)
937 | lw CARG1, LO(BASE)
938 | lw CARG2, 8+LO(BASE)
939 |.endmacro
940 |
941 |.macro .ffunc_n, name // Caveat: has delay slot!
942 |->ff_ .. name:
943 | lw CARG3, HI(BASE)
944 | beqz NARGS8:RC, ->fff_fallback
945 |. ldc1 FARG1, 0(BASE)
946 | sltiu AT, CARG3, LJ_TISNUM
947 | beqz AT, ->fff_fallback
948 |.endmacro
949 |
950 |.macro .ffunc_nn, name // Caveat: has delay slot!
951 |->ff_ .. name:
952 | sltiu AT, NARGS8:RC, 16
953 | lw CARG3, HI(BASE)
954 | bnez AT, ->fff_fallback
955 |. lw CARG4, 8+HI(BASE)
956 | ldc1 FARG1, 0(BASE)
957 | ldc1 FARG2, 8(BASE)
958 | sltiu TMP0, CARG3, LJ_TISNUM
959 | sltiu TMP1, CARG4, LJ_TISNUM
960 | and TMP0, TMP0, TMP1
961 | beqz TMP0, ->fff_fallback
962 |.endmacro
963 |
964 |// Inlined GC threshold check. Caveat: uses TMP0 and TMP1 and has delay slot!
965 |.macro ffgccheck
966 | lw TMP0, DISPATCH_GL(gc.total)(DISPATCH)
967 | lw TMP1, DISPATCH_GL(gc.threshold)(DISPATCH)
968 | subu AT, TMP0, TMP1
969 | bgezal AT, ->fff_gcstep
970 |.endmacro
971 |
972 |//-- Base library: checks -----------------------------------------------
973 |
974 |.ffunc_1 assert
975 | sltiu AT, CARG3, LJ_TISTRUECOND
976 | beqz AT, ->fff_fallback
977 |. addiu RA, BASE, -8
978 | lw PC, FRAME_PC(BASE)
979 | addiu RD, NARGS8:RC, 8 // Compute (nresults+1)*8.
980 | addu TMP2, RA, NARGS8:RC
981 | sw CARG3, HI(RA)
982 | addiu TMP1, BASE, 8
983 | beq BASE, TMP2, ->fff_res // Done if exactly 1 argument.
984 |. sw CARG1, LO(RA)
985 |1:
986 | ldc1 f0, 0(TMP1)
987 | sdc1 f0, -8(TMP1)
988 | bne TMP1, TMP2, <1
989 |. addiu TMP1, TMP1, 8
990 | b ->fff_res
991 |. nop
992 |
993 |.ffunc type
994 | lw CARG3, HI(BASE)
995 | li TMP1, LJ_TISNUM
996 | beqz NARGS8:RC, ->fff_fallback
997 |. sltiu TMP0, CARG3, LJ_TISNUM
998 | movz TMP1, CARG3, TMP0
999 | not TMP1, TMP1
1000 | sll TMP1, TMP1, 3
1001 | addu TMP1, CFUNC:RB, TMP1
1002 | b ->fff_resn
1003 |. ldc1 FRET1, CFUNC:TMP1->upvalue
1004 |
1005 |//-- Base library: getters and setters ---------------------------------
1006 |
1007 |.ffunc_1 getmetatable
1008 | li AT, LJ_TTAB
1009 | bne CARG3, AT, >6
1010 |. li AT, LJ_TUDATA
1011 |1: // Field metatable must be at same offset for GCtab and GCudata!
1012 | lw TAB:CARG1, TAB:CARG1->metatable
1013 |2:
1014 | lw STR:RC, DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable])(DISPATCH)
1015 | beqz TAB:CARG1, ->fff_restv
1016 |. li CARG3, LJ_TNIL
1017 | lw TMP0, TAB:CARG1->hmask
1018 | li CARG3, LJ_TTAB // Use metatable as default result.
1019 | lw TMP1, STR:RC->hash
1020 | lw NODE:TMP2, TAB:CARG1->node
1021 | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask
1022 | sll TMP0, TMP1, 5
1023 | sll TMP1, TMP1, 3
1024 | subu TMP1, TMP0, TMP1
1025 | addu NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8)
1026 | li AT, LJ_TSTR
1027 |3: // Rearranged logic, because we expect _not_ to find the key.
1028 | lw CARG4, offsetof(Node, key)+HI(NODE:TMP2)
1029 | lw TMP0, offsetof(Node, key)+LO(NODE:TMP2)
1030 | lw NODE:TMP3, NODE:TMP2->next
1031 | bne CARG4, AT, >4
1032 |. lw CARG2, offsetof(Node, val)+HI(NODE:TMP2)
1033 | beq TMP0, STR:RC, >5
1034 |. lw TMP1, offsetof(Node, val)+LO(NODE:TMP2)
1035 |4:
1036 | beqz NODE:TMP3, ->fff_restv // Not found, keep default result.
1037 |. move NODE:TMP2, NODE:TMP3
1038 | b <3
1039 |. nop
1040 |5:
1041 | beq CARG2, TISNIL, ->fff_restv // Ditto for nil value.
1042 |. nop
1043 | move CARG3, CARG2 // Return value of mt.__metatable.
1044 | b ->fff_restv
1045 |. move CARG1, TMP1
1046 |
1047 |6:
1048 | beq CARG3, AT, <1
1049 |. sltiu TMP0, CARG3, LJ_TISNUM
1050 | li TMP1, LJ_TISNUM
1051 | movz TMP1, CARG3, TMP0
1052 | not TMP1, TMP1
1053 | sll TMP1, TMP1, 2
1054 | addu TMP1, DISPATCH, TMP1
1055 | b <2
1056 |. lw TAB:CARG1, DISPATCH_GL(gcroot[GCROOT_BASEMT])(TMP1)
1057 |
1058 |.ffunc_2 setmetatable
1059 | // Fast path: no mt for table yet and not clearing the mt.
1060 | li AT, LJ_TTAB
1061 | bne CARG3, AT, ->fff_fallback
1062 |. addiu CARG4, CARG4, -LJ_TTAB
1063 | lw TAB:TMP1, TAB:CARG1->metatable
1064 | lbu TMP3, TAB:CARG1->marked
1065 | or AT, CARG4, TAB:TMP1
1066 | bnez AT, ->fff_fallback
1067 |. andi AT, TMP3, LJ_GC_BLACK // isblack(table)
1068 | beqz AT, ->fff_restv
1069 |. sw TAB:CARG2, TAB:CARG1->metatable
1070 | barrierback TAB:CARG1, TMP3, TMP0, ->fff_restv
1071 |
1072 |.ffunc rawget
1073 | lw CARG4, HI(BASE)
1074 | sltiu AT, NARGS8:RC, 16
1075 | lw TAB:CARG2, LO(BASE)
1076 | load_got lj_tab_get
1077 | addiu CARG4, CARG4, -LJ_TTAB
1078 | or AT, AT, CARG4
1079 | bnez AT, ->fff_fallback
1080 | addiu CARG3, BASE, 8
1081 | call_intern lj_tab_get // (lua_State *L, GCtab *t, cTValue *key)
1082 |. move CARG1, L
1083 | // Returns cTValue *.
1084 | b ->fff_resn
1085 |. ldc1 FRET1, 0(CRET1)
1086 |
1087 |//-- Base library: conversions ------------------------------------------
1088 |
1089 |.ffunc tonumber
1090 | // Only handles the number case inline (without a base argument).
1091 | lw CARG1, HI(BASE)
1092 | xori AT, NARGS8:RC, 8
1093 | sltiu CARG1, CARG1, LJ_TISNUM
1094 | movn CARG1, r0, AT
1095 | beqz CARG1, ->fff_fallback // Exactly one number argument.
1096 |. ldc1 FRET1, 0(BASE)
1097 | b ->fff_resn
1098 |. nop
1099 |
1100 |.ffunc_1 tostring
1101 | // Only handles the string or number case inline.
1102 | li AT, LJ_TSTR
1103 | // A __tostring method in the string base metatable is ignored.
1104 | beq CARG3, AT, ->fff_restv // String key?
1105 | // Handle numbers inline, unless a number base metatable is present.
1106 |. lw TMP1, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM])(DISPATCH)
1107 | sltiu TMP0, CARG3, LJ_TISNUM
1108 | sltiu TMP1, TMP1, 1
1109 | and TMP0, TMP0, TMP1
1110 | beqz TMP0, ->fff_fallback
1111 |. sw BASE, L->base // Add frame since C call can throw.
1112 | ffgccheck
1113 |. sw PC, SAVE_PC // Redundant (but a defined value).
1114 | load_got lj_str_fromnum
1115 | move CARG1, L
1116 | call_intern lj_str_fromnum // (lua_State *L, lua_Number *np)
1117 |. move CARG2, BASE
1118 | // Returns GCstr *.
1119 | li CARG3, LJ_TSTR
1120 | b ->fff_restv
1121 |. move CARG1, CRET1
1122 |
1123 |//-- Base library: iterators -------------------------------------------
1124 |
1125 |.ffunc next
1126 | lw CARG1, HI(BASE)
1127 | lw TAB:CARG2, LO(BASE)
1128 | beqz NARGS8:RC, ->fff_fallback
1129 |. addu TMP2, BASE, NARGS8:RC
1130 | li AT, LJ_TTAB
1131 | sw TISNIL, HI(TMP2) // Set missing 2nd arg to nil.
1132 | bne CARG1, AT, ->fff_fallback
1133 |. lw PC, FRAME_PC(BASE)
1134 | load_got lj_tab_next
1135 | sw BASE, L->base // Add frame since C call can throw.
1136 | sw BASE, L->top // Dummy frame length is ok.
1137 | addiu CARG3, BASE, 8
1138 | sw PC, SAVE_PC
1139 | call_intern lj_tab_next // (lua_State *L, GCtab *t, TValue *key)
1140 |. move CARG1, L
1141 | // Returns 0 at end of traversal.
1142 | beqz CRET1, ->fff_restv // End of traversal: return nil.
1143 |. li CARG3, LJ_TNIL
1144 | ldc1 f0, 8(BASE) // Copy key and value to results.
1145 | addiu RA, BASE, -8
1146 | ldc1 f2, 16(BASE)
1147 | li RD, (2+1)*8
1148 | sdc1 f0, 0(RA)
1149 | b ->fff_res
1150 |. sdc1 f2, 8(RA)
1151 |
1152 |.ffunc_1 pairs
1153 | li AT, LJ_TTAB
1154 | bne CARG3, AT, ->fff_fallback
1155 |. lw PC, FRAME_PC(BASE)
1156#ifdef LUAJIT_ENABLE_LUA52COMPAT
1157 | lw TAB:TMP2, TAB:CARG1->metatable
1158 | ldc1 f0, CFUNC:RB->upvalue[0]
1159 | bnez TAB:TMP2, ->fff_fallback
1160#else
1161 | ldc1 f0, CFUNC:RB->upvalue[0]
1162#endif
1163 |. addiu RA, BASE, -8
1164 | sw TISNIL, 8+HI(BASE)
1165 | li RD, (3+1)*8
1166 | b ->fff_res
1167 |. sdc1 f0, 0(RA)
1168 |
1169 |.ffunc ipairs_aux
1170 | sltiu AT, NARGS8:RC, 16
1171 | lw CARG3, HI(BASE)
1172 | lw TAB:CARG1, LO(BASE)
1173 | lw CARG4, 8+HI(BASE)
1174 | bnez AT, ->fff_fallback
1175 |. ldc1 FARG2, 8(BASE)
1176 | addiu CARG3, CARG3, -LJ_TTAB
1177 | sltiu AT, CARG4, LJ_TISNUM
1178 | li TMP0, 1
1179 | movn AT, r0, CARG3
1180 | mtc1 TMP0, FARG1
1181 | beqz AT, ->fff_fallback
1182 |. lw PC, FRAME_PC(BASE)
1183 | cvt.w.d FRET1, FARG2
1184 | cvt.d.w FARG1, FARG1
1185 | lw TMP0, TAB:CARG1->asize
1186 | lw TMP1, TAB:CARG1->array
1187 | mfc1 TMP2, FRET1
1188 | addiu RA, BASE, -8
1189 | add.d FARG2, FARG2, FARG1
1190 | addiu TMP2, TMP2, 1
1191 | sltu AT, TMP2, TMP0
1192 | sll TMP3, TMP2, 3
1193 | addu TMP3, TMP1, TMP3
1194 | beqz AT, >2 // Not in array part?
1195 |. sdc1 FARG2, 0(RA)
1196 | lw TMP2, HI(TMP3)
1197 | ldc1 f0, 0(TMP3)
1198 |1:
1199 | beq TMP2, TISNIL, ->fff_res // End of iteration, return 0 results.
1200 |. li RD, (0+1)*8
1201 | li RD, (2+1)*8
1202 | b ->fff_res
1203 |. sdc1 f0, 8(RA)
1204 |2: // Check for empty hash part first. Otherwise call C function.
1205 | lw TMP0, TAB:CARG1->hmask
1206 | load_got lj_tab_getinth
1207 | beqz TMP0, ->fff_res
1208 |. li RD, (0+1)*8
1209 | call_intern lj_tab_getinth // (GCtab *t, int32_t key)
1210 |. move CARG2, TMP2
1211 | // Returns cTValue * or NULL.
1212 | beqz CRET1, ->fff_res
1213 |. li RD, (0+1)*8
1214 | lw TMP2, HI(CRET1)
1215 | b <1
1216 |. ldc1 f0, 0(CRET1)
1217 |
1218 |.ffunc_1 ipairs
1219 | li AT, LJ_TTAB
1220 | bne CARG3, AT, ->fff_fallback
1221 |. lw PC, FRAME_PC(BASE)
1222#ifdef LUAJIT_ENABLE_LUA52COMPAT
1223 | lw TAB:TMP2, TAB:CARG1->metatable
1224 | ldc1 f0, CFUNC:RB->upvalue[0]
1225 | bnez TAB:TMP2, ->fff_fallback
1226#else
1227 | ldc1 f0, CFUNC:RB->upvalue[0]
1228#endif
1229 |. addiu RA, BASE, -8
1230 | sw r0, 8+HI(BASE)
1231 | sw r0, 8+LO(BASE)
1232 | li RD, (3+1)*8
1233 | b ->fff_res
1234 |. sdc1 f0, 0(RA)
1235 |
1236 |//-- Base library: catch errors ----------------------------------------
1237 |
1238 |.ffunc pcall
1239 | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH)
1240 | beqz NARGS8:RC, ->fff_fallback
1241 | move TMP2, BASE
1242 | addiu BASE, BASE, 8
1243 | // Remember active hook before pcall.
1244 | srl TMP3, TMP3, HOOK_ACTIVE_SHIFT
1245 | andi TMP3, TMP3, 1
1246 | addiu PC, TMP3, 8+FRAME_PCALL
1247 | b ->vm_call_dispatch
1248 |. addiu NARGS8:RC, NARGS8:RC, -8
1249 |
1250 |.ffunc xpcall
1251 | sltiu AT, NARGS8:RC, 16
1252 | lw CARG4, 8+HI(BASE)
1253 | bnez AT, ->fff_fallback
1254 |. ldc1 FARG2, 8(BASE)
1255 | ldc1 FARG1, 0(BASE)
1256 | lbu TMP1, DISPATCH_GL(hookmask)(DISPATCH)
1257 | li AT, LJ_TFUNC
1258 | move TMP2, BASE
1259 | bne CARG4, AT, ->fff_fallback // Traceback must be a function.
1260 | addiu BASE, BASE, 16
1261 | // Remember active hook before pcall.
1262 | srl TMP3, TMP3, HOOK_ACTIVE_SHIFT
1263 | sdc1 FARG2, 0(TMP2) // Swap function and traceback.
1264 | andi TMP3, TMP3, 1
1265 | sdc1 FARG1, 8(TMP2)
1266 | addiu PC, TMP3, 16+FRAME_PCALL
1267 | b ->vm_call_dispatch
1268 |. addiu NARGS8:RC, NARGS8:RC, -16
1269 |
1270 |//-- Coroutine library --------------------------------------------------
1271 |
1272 |.macro coroutine_resume_wrap, resume
1273 |.if resume
1274 |.ffunc_1 coroutine_resume
1275 | li AT, LJ_TTHREAD
1276 | bne CARG3, AT, ->fff_fallback
1277 |.else
1278 |.ffunc coroutine_wrap_aux
1279 | lw L:CARG1, CFUNC:RB->upvalue[0].gcr
1280 |.endif
1281 | lbu TMP0, L:CARG1->status
1282 | lw TMP1, L:CARG1->cframe
1283 | lw CARG2, L:CARG1->top
1284 | lw TMP2, L:CARG1->base
1285 | addiu TMP3, TMP0, -LUA_YIELD
1286 | bgtz TMP3, ->fff_fallback // st > LUA_YIELD?
1287 |. xor TMP2, TMP2, CARG2
1288 | bnez TMP1, ->fff_fallback // cframe != 0?
1289 |. or AT, TMP2, TMP0
1290 | lw TMP0, L:CARG1->maxstack
1291 | beqz AT, ->fff_fallback // base == top && st == 0?
1292 |. lw PC, FRAME_PC(BASE)
1293 | addu TMP2, CARG2, NARGS8:RC
1294 | sltu AT, TMP0, TMP2
1295 | bnez AT, ->fff_fallback // Stack overflow?
1296 |. sw PC, SAVE_PC
1297 | sw BASE, L->base
1298 |1:
1299 |.if resume
1300 | addiu BASE, BASE, 8 // Keep resumed thread in stack for GC.
1301 | addiu NARGS8:RC, NARGS8:RC, -8
1302 | addiu TMP2, TMP2, -8
1303 |.endif
1304 | sw TMP2, L:CARG1->top
1305 | addu TMP1, BASE, NARGS8:RC
1306 | move CARG3, CARG2
1307 | sw BASE, L->top
1308 |2: // Move args to coroutine.
1309 | ldc1 f0, 0(BASE)
1310 | sltu AT, BASE, TMP1
1311 | beqz AT, >3
1312 |. addiu BASE, BASE, 8
1313 | sdc1 f0, 0(CARG3)
1314 | b <2
1315 |. addiu CARG3, CARG3, 8
1316 |3:
1317 | bal ->vm_resume // (lua_State *L, TValue *base, 0, 0)
1318 |. move L:RA, L:CARG1
1319 | // Returns thread status.
1320 |4:
1321 | lw TMP2, L:RA->base
1322 | sltiu AT, CRET1, LUA_YIELD+1
1323 | lw TMP3, L:RA->top
1324 | li_vmstate INTERP
1325 | lw BASE, L->base
1326 | st_vmstate
1327 | beqz AT, >8
1328 |. subu RD, TMP3, TMP2
1329 | lw TMP0, L->maxstack
1330 | beqz RD, >6 // No results?
1331 |. addu TMP1, BASE, RD
1332 | sltu AT, TMP0, TMP1
1333 | bnez AT, >9 // Need to grow stack?
1334 |. addu TMP3, TMP2, RD
1335 | sw TMP2, L:RA->top // Clear coroutine stack.
1336 | move TMP1, BASE
1337 |5: // Move results from coroutine.
1338 | ldc1 f0, 0(TMP2)
1339 | addiu TMP2, TMP2, 8
1340 | sltu AT, TMP2, TMP3
1341 | sdc1 f0, 0(TMP1)
1342 | bnez AT, <5
1343 |. addiu TMP1, TMP1, 8
1344 |6:
1345 | andi TMP0, PC, FRAME_TYPE
1346 |.if resume
1347 | li TMP1, LJ_TTRUE
1348 | addiu RA, BASE, -8
1349 | sw TMP1, -8+HI(BASE) // Prepend true to results.
1350 | addiu RD, RD, 16
1351 |.else
1352 | move RA, BASE
1353 | addiu RD, RD, 8
1354 |.endif
1355 |7:
1356 | sw PC, SAVE_PC
1357 | beqz TMP0, ->BC_RET_Z
1358 |. move MULTRES, RD
1359 | b ->vm_return
1360 |. nop
1361 |
1362 |8: // Coroutine returned with error (at co->top-1).
1363 |.if resume
1364 | addiu TMP3, TMP3, -8
1365 | li TMP1, LJ_TFALSE
1366 | ldc1 f0, 0(TMP3)
1367 | sw TMP3, L:RA->top // Remove error from coroutine stack.
1368 | li RD, (2+1)*8
1369 | sw TMP1, -8+HI(BASE) // Prepend false to results.
1370 | addiu RA, BASE, -8
1371 | sdc1 f0, 0(BASE) // Copy error message.
1372 | b <7
1373 |. andi TMP0, PC, FRAME_TYPE
1374 |.else
1375 | load_got lj_ffh_coroutine_wrap_err
1376 | move CARG2, L:RA
1377 | call_intern lj_ffh_coroutine_wrap_err // (lua_State *L, lua_State *co)
1378 |. move CARG1, L
1379 |.endif
1380 |
1381 |9: // Handle stack expansion on return from yield.
1382 | load_got lj_state_growstack
1383 | srl CARG2, RD, 3
1384 | call_intern lj_state_growstack // (lua_State *L, int n)
1385 |. move CARG1, L
1386 | b <4
1387 |. li CRET1, 0
1388 |.endmacro
1389 |
1390 | coroutine_resume_wrap 1 // coroutine.resume
1391 | coroutine_resume_wrap 0 // coroutine.wrap
1392 |
1393 |.ffunc coroutine_yield
1394 | lw TMP0, L->cframe
1395 | addu TMP1, BASE, NARGS8:RC
1396 | sw BASE, L->base
1397 | andi TMP0, TMP0, CFRAME_RESUME
1398 | sw TMP1, L->top
1399 | beqz TMP0, ->fff_fallback
1400 |. li CRET1, LUA_YIELD
1401 | sw r0, L->cframe
1402 | b ->vm_leave_unw
1403 |. sb CRET1, L->status
1404 |
1405 |//-- Math library -------------------------------------------------------
1406 |
1407 |.ffunc_n math_abs
1408 |. abs.d FRET1, FARG1
1409 |->fff_resn:
1410 | lw PC, FRAME_PC(BASE)
1411 | addiu RA, BASE, -8
1412 | b ->fff_res1
1413 |. sdc1 FRET1, -8(BASE)
1414 |
1415 |->fff_restv:
1416 | // CARG3/CARG1 = TValue result.
1417 | lw PC, FRAME_PC(BASE)
1418 | sw CARG3, -8+HI(BASE)
1419 | addiu RA, BASE, -8
1420 | sw CARG1, -8+LO(BASE)
1421 |->fff_res1:
1422 | // RA = results, PC = return.
1423 | li RD, (1+1)*8
1424 |->fff_res:
1425 | // RA = results, RD = (nresults+1)*8, PC = return.
1426 | andi TMP0, PC, FRAME_TYPE
1427 | bnez TMP0, ->vm_return
1428 |. move MULTRES, RD
1429 | lw INS, -4(PC)
1430 | decode_RB8a RB, INS
1431 | decode_RB8b RB
1432 |5:
1433 | sltu AT, RD, RB
1434 | bnez AT, >6 // More results expected?
1435 |. decode_RA8a TMP0, INS
1436 | decode_RA8b TMP0
1437 | ins_next1
1438 | // Adjust BASE. KBASE is assumed to be set for the calling frame.
1439 | subu BASE, RA, TMP0
1440 | ins_next2
1441 |
1442 |6: // Fill up results with nil.
1443 | addu TMP1, RA, RD
1444 | addiu RD, RD, 8
1445 | b <5
1446 |. sw TISNIL, -8+HI(TMP1)
1447 |
1448 |.macro math_extern, func
1449 |->ff_math_ .. func:
1450 | lw CARG3, HI(BASE)
1451 | beqz NARGS8:RC, ->fff_fallback
1452 |. load_got func
1453 | sltiu AT, CARG3, LJ_TISNUM
1454 | beqz AT, ->fff_fallback
1455 |. nop
1456 | call_extern
1457 |. ldc1 FARG1, 0(BASE)
1458 | b ->fff_resn
1459 |. nop
1460 |.endmacro
1461 |
1462 |.macro math_extern2, func
1463 | .ffunc_nn math_ .. func
1464 |. load_got func
1465 | call_extern
1466 |. nop
1467 | b ->fff_resn
1468 |. nop
1469 |.endmacro
1470 |
1471 |.macro math_round, func
1472 | .ffunc_n math_ .. func
1473 |. nop
1474 | bal ->vm_ .. func
1475 |. nop
1476 | b ->fff_resn
1477 |. nop
1478 |.endmacro
1479 |
1480 | math_round floor
1481 | math_round ceil
1482 |
1483 | math_extern log
1484 | math_extern log10
1485 | math_extern exp
1486 | math_extern sin
1487 | math_extern cos
1488 | math_extern tan
1489 | math_extern asin
1490 | math_extern acos
1491 | math_extern atan
1492 | math_extern sinh
1493 | math_extern cosh
1494 | math_extern tanh
1495 | math_extern2 pow
1496 | math_extern2 atan2
1497 | math_extern2 fmod
1498 |
1499 |.ffunc_n math_sqrt
1500 |. sqrt.d FRET1, FARG1
1501 | b ->fff_resn
1502 |. nop
1503 |
1504 |->ff_math_deg:
1505 |.ffunc_n math_rad
1506 |. ldc1 FARG2, CFUNC:RB->upvalue[0]
1507 | b ->fff_resn
1508 |. mul.d FRET1, FARG1, FARG2
1509 |
1510 |.ffunc_nn math_ldexp
1511 | cvt.w.d FARG2, FARG2
1512 | load_got ldexp
1513 | mfc1 CARG3, FARG2
1514 | call_extern
1515 |. nop
1516 | b ->fff_resn
1517 |. nop
1518 |
1519 |.ffunc_n math_frexp
1520 | load_got frexp
1521 | lw PC, FRAME_PC(BASE)
1522 | call_extern
1523 |. addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)
1524 | lw TMP1, DISPATCH_GL(tmptv)(DISPATCH)
1525 | addiu RA, BASE, -8
1526 | mtc1 TMP1, FARG2
1527 | sdc1 FRET1, 0(RA)
1528 | cvt.d.w FARG2, FARG2
1529 | sdc1 FARG2, 8(RA)
1530 | b ->fff_res
1531 |. li RD, (2+1)*8
1532 |
1533 |.ffunc_n math_modf
1534 | load_got modf
1535 | lw PC, FRAME_PC(BASE)
1536 | call_extern
1537 |. addiu CARG3, BASE, -8
1538 | addiu RA, BASE, -8
1539 | sdc1 FRET1, 0(BASE)
1540 | b ->fff_res
1541 |. li RD, (2+1)*8
1542 |
1543 |.macro math_minmax, name, ismax
1544 |->ff_ .. name:
1545 | lw CARG3, HI(BASE)
1546 | beqz NARGS8:RC, ->fff_fallback
1547 |. ldc1 FRET1, 0(BASE)
1548 | sltiu AT, CARG3, LJ_TISNUM
1549 | beqz AT, ->fff_fallback
1550 |. addu TMP2, BASE, NARGS8:RC
1551 | addiu TMP1, BASE, 8
1552 | beq TMP1, TMP2, ->fff_resn
1553 |1:
1554 |. lw CARG3, HI(TMP1)
1555 | ldc1 FARG1, 0(TMP1)
1556 | addiu TMP1, TMP1, 8
1557 | sltiu AT, CARG3, LJ_TISNUM
1558 | beqz AT, ->fff_fallback
1559 |.if ismax
1560 |. c.olt.d FARG1, FRET1
1561 |.else
1562 |. c.olt.d FRET1, FARG1
1563 |.endif
1564 | bne TMP1, TMP2, <1
1565 |. movf.d FRET1, FARG1
1566 | b ->fff_resn
1567 |. nop
1568 |.endmacro
1569 |
1570 | math_minmax math_min, 0
1571 | math_minmax math_max, 1
1572 |
1573 |//-- String library -----------------------------------------------------
1574 |
1575 |.ffunc_1 string_len
1576 | li AT, LJ_TSTR
1577 | bne CARG3, AT, ->fff_fallback
1578 |. nop
1579 | b ->fff_resi
1580 |. lw CRET1, STR:CARG1->len
1581 |
1582 |.ffunc string_byte // Only handle the 1-arg case here.
1583 | lw CARG3, HI(BASE)
1584 | lw STR:CARG1, LO(BASE)
1585 | xori AT, NARGS8:RC, 8
1586 | addiu CARG3, CARG3, -LJ_TSTR
1587 | or AT, AT, CARG3
1588 | bnez AT, ->fff_fallback // Need exactly 1 string argument.
1589 |. nop
1590 | lw TMP0, STR:CARG1->len
1591 | lbu TMP1, STR:CARG1[1] // Access is always ok (NUL at end).
1592 | addiu RA, BASE, -8
1593 | sltu RD, r0, TMP0
1594 | mtc1 TMP1, f0
1595 | addiu RD, RD, 1
1596 | cvt.d.w f0, f0
1597 | lw PC, FRAME_PC(BASE)
1598 | sll RD, RD, 3 // RD = ((str->len != 0)+1)*8
1599 | b ->fff_res
1600 |. sdc1 f0, 0(RA)
1601 |
1602 |.ffunc string_char // Only handle the 1-arg case here.
1603 | ffgccheck
1604 | lw CARG3, HI(BASE)
1605 | ldc1 FARG1, 0(BASE)
1606 | li AT, 8
1607 | bne NARGS8:RC, AT, ->fff_fallback // Exactly 1 argument.
1608 |. sltiu AT, CARG3, LJ_TISNUM
1609 | beqz AT, ->fff_fallback
1610 |. li CARG3, 1
1611 | cvt.w.d FARG1, FARG1
1612 | addiu CARG2, sp, ARG5_OFS
1613 | sltiu AT, TMP0, 256
1614 | mfc1 TMP0, FARG1
1615 | beqz AT, ->fff_fallback
1616 |. sw TMP0, ARG5
1617 |->fff_newstr:
1618 | load_got lj_str_new
1619 | sw BASE, L->base
1620 | sw PC, SAVE_PC
1621 | call_intern lj_str_new // (lua_State *L, char *str, size_t l)
1622 |. move CARG1, L
1623 | // Returns GCstr *.
1624 | lw BASE, L->base
1625 | move CARG1, CRET1
1626 | b ->fff_restv
1627 |. li CARG3, LJ_TSTR
1628 |
1629 |.ffunc string_sub
1630 | ffgccheck
1631 | addiu AT, NARGS8:RC, -16
1632 | lw CARG3, 16+HI(BASE)
1633 | ldc1 f0, 16(BASE)
1634 | lw TMP0, HI(BASE)
1635 | lw STR:CARG1, LO(BASE)
1636 | bltz AT, ->fff_fallback
1637 | lw CARG2, 8+HI(BASE)
1638 | ldc1 f2, 8(BASE)
1639 | beqz AT, >1
1640 |. li CARG4, -1
1641 | cvt.w.d f0, f0
1642 | sltiu AT, CARG3, LJ_TISNUM
1643 | beqz AT, ->fff_fallback
1644 |. mfc1 CARG4, f0
1645 |1:
1646 | sltiu AT, CARG2, LJ_TISNUM
1647 | beqz AT, ->fff_fallback
1648 |. li AT, LJ_TSTR
1649 | cvt.w.d f2, f2
1650 | bne TMP0, AT, ->fff_fallback
1651 |. lw CARG2, STR:CARG1->len
1652 | mfc1 CARG3, f2
1653 | // STR:CARG1 = str, CARG2 = str->len, CARG3 = start, CARG4 = end
1654 | slt AT, CARG4, r0
1655 | addiu TMP0, CARG2, 1
1656 | addu TMP1, CARG4, TMP0
1657 | slt TMP3, CARG3, r0
1658 | movn CARG4, TMP1, AT // if (end < 0) end += len+1
1659 | addu TMP1, CARG3, TMP0
1660 | movn CARG3, TMP1, TMP3 // if (start < 0) start += len+1
1661 | li TMP2, 1
1662 | slt AT, CARG4, r0
1663 | slt TMP3, r0, CARG3
1664 | movn CARG4, r0, AT // if (end < 0) end = 0
1665 | movz CARG3, TMP2, TMP3 // if (start < 1) start = 1
1666 | slt AT, CARG2, CARG4
1667 | movn CARG4, CARG2, AT // if (end > len) end = len
1668 | addu CARG2, STR:CARG1, CARG3
1669 | subu CARG3, CARG4, CARG3 // len = end - start
1670 | addiu CARG2, CARG2, sizeof(GCstr)-1
1671 | bgez CARG3, ->fff_newstr
1672 |. addiu CARG3, CARG3, 1 // len++
1673 |->fff_emptystr: // Return empty string.
1674 | addiu STR:CARG1, DISPATCH, DISPATCH_GL(strempty)
1675 | b ->fff_restv
1676 |. li CARG3, LJ_TSTR
1677 |
1678 |.ffunc string_rep // Only handle the 1-char case inline.
1679 | ffgccheck
1680 | lw TMP0, HI(BASE)
1681 | sltiu AT, NARGS8:RC, 16
1682 | lw CARG4, 8+HI(BASE)
1683 | lw STR:CARG1, LO(BASE)
1684 | addiu TMP0, TMP0, -LJ_TSTR
1685 | ldc1 f0, 8(BASE)
1686 | or AT, AT, TMP0
1687 | bnez AT, ->fff_fallback
1688 |. sltiu AT, CARG4, LJ_TISNUM
1689 | cvt.w.d f0, f0
1690 | beqz AT, ->fff_fallback
1691 |. lw TMP0, STR:CARG1->len
1692 | mfc1 CARG3, f0
1693 | lw TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)
1694 | li AT, 1
1695 | blez CARG3, ->fff_emptystr // Count <= 0?
1696 |. sltu AT, AT, TMP0
1697 | beqz TMP0, ->fff_emptystr // Zero length string?
1698 |. sltu TMP0, TMP1, CARG3
1699 | or AT, AT, TMP0
1700 | lw CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)
1701 | bnez AT, ->fff_fallback // Fallback for > 1-char strings.
1702 |. lbu TMP0, STR:CARG1[1]
1703 | addu TMP2, CARG2, CARG3
1704 |1: // Fill buffer with char. Yes, this is suboptimal code (do you care?).
1705 | addiu TMP2, TMP2, -1
1706 | sltu AT, CARG2, TMP2
1707 | bnez AT, <1
1708 |. sb TMP0, 0(TMP2)
1709 | b ->fff_newstr
1710 |. nop
1711 |
1712 |.ffunc string_reverse
1713 | ffgccheck
1714 | lw CARG3, HI(BASE)
1715 | lw STR:CARG1, LO(BASE)
1716 | beqz NARGS8:RC, ->fff_fallback
1717 |. li AT, LJ_TSTR
1718 | bne CARG3, AT, ->fff_fallback
1719 |. lw TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)
1720 | lw CARG3, STR:CARG1->len
1721 | addiu CARG1, STR:CARG1, #STR
1722 | lw CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)
1723 | sltu AT, TMP1, CARG3
1724 | bnez AT, ->fff_fallback
1725 |. addu TMP3, CARG1, CARG3
1726 | addu CARG4, CARG2, CARG3
1727 |1: // Reverse string copy.
1728 | lbu TMP1, 0(CARG1)
1729 | sltu AT, CARG1, TMP3
1730 | beqz AT, ->fff_newstr
1731 |. addiu CARG1, CARG1, 1
1732 | addiu CARG4, CARG4, -1
1733 | b <1
1734 | sb TMP1, 0(CARG4)
1735 |
1736 |.macro ffstring_case, name, lo
1737 | .ffunc name
1738 | ffgccheck
1739 | lw CARG3, HI(BASE)
1740 | lw STR:CARG1, LO(BASE)
1741 | beqz NARGS8:RC, ->fff_fallback
1742 |. li AT, LJ_TSTR
1743 | bne CARG3, AT, ->fff_fallback
1744 |. lw TMP1, DISPATCH_GL(tmpbuf.sz)(DISPATCH)
1745 | lw CARG3, STR:CARG1->len
1746 | addiu CARG1, STR:CARG1, #STR
1747 | lw CARG2, DISPATCH_GL(tmpbuf.buf)(DISPATCH)
1748 | sltu AT, TMP1, CARG3
1749 | bnez AT, ->fff_fallback
1750 |. addu TMP3, CARG1, CARG3
1751 | move CARG4, CARG2
1752 |1: // ASCII case conversion.
1753 | lbu TMP1, 0(CARG1)
1754 | sltu AT, CARG1, TMP3
1755 | beqz AT, ->fff_newstr
1756 |. addiu TMP0, TMP1, -lo
1757 | xori TMP2, TMP1, 0x20
1758 | sltiu AT, TMP0, 26
1759 | movn TMP1, TMP2, AT
1760 | addiu CARG1, CARG1, 1
1761 | sb TMP1, 0(CARG4)
1762 | b <1
1763 |. addiu CARG4, CARG4, 1
1764 |.endmacro
1765 |
1766 |ffstring_case string_lower, 65
1767 |ffstring_case string_upper, 97
1768 |
1769 |//-- Table library ------------------------------------------------------
1770 |
1771 |.ffunc_1 table_getn
1772 | li AT, LJ_TTAB
1773 | bne CARG3, AT, ->fff_fallback
1774 |. load_got lj_tab_len
1775 | call_intern lj_tab_len // (GCtab *t)
1776 |. nop
1777 | // Returns uint32_t (but less than 2^31).
1778 | b ->fff_resi
1779 |. nop
1780 |
1781 |//-- Bit library --------------------------------------------------------
1782 |
1783 |.macro .ffunc_bit, name
1784 | .ffunc_n bit_..name
1785 |. add.d FARG1, FARG1, TOBIT
1786 | mfc1 CRET1, FARG1
1787 |.endmacro
1788 |
1789 |.macro .ffunc_bit_op, name, ins
1790 | .ffunc_bit name
1791 | addiu TMP1, BASE, 8
1792 | addu TMP2, BASE, NARGS8:RC
1793 |1:
1794 | lw CARG4, HI(TMP1)
1795 | beq TMP1, TMP2, ->fff_resi
1796 |. ldc1 FARG1, 0(TMP1)
1797 | sltiu AT, CARG4, LJ_TISNUM
1798 | beqz AT, ->fff_fallback
1799 | add.d FARG1, FARG1, TOBIT
1800 | mfc1 CARG2, FARG1
1801 | ins CRET1, CRET1, CARG2
1802 | b <1
1803 |. addiu TMP1, TMP1, 8
1804 |.endmacro
1805 |
1806 |.ffunc_bit_op band, and
1807 |.ffunc_bit_op bor, or
1808 |.ffunc_bit_op bxor, xor
1809 |
1810 |.ffunc_bit bswap
1811 | srl TMP0, CRET1, 24
1812 | srl TMP2, CRET1, 8
1813 | sll TMP1, CRET1, 24
1814 | andi TMP2, TMP2, 0xff00
1815 | or TMP0, TMP0, TMP1
1816 | andi CRET1, CRET1, 0xff00
1817 | or TMP0, TMP0, TMP2
1818 | sll CRET1, CRET1, 8
1819 | b ->fff_resi
1820 |. or CRET1, TMP0, CRET1
1821 |
1822 |.ffunc_bit bnot
1823 | b ->fff_resi
1824 |. not CRET1, CRET1
1825 |
1826 |.macro .ffunc_bit_sh, name, ins, shmod
1827 | .ffunc_nn bit_..name
1828 |. add.d FARG1, FARG1, TOBIT
1829 | add.d FARG2, FARG2, TOBIT
1830 | mfc1 CARG1, FARG1
1831 | mfc1 CARG2, FARG2
1832 |.if shmod == 1
1833 | li AT, 32
1834 | subu TMP0, AT, CARG2
1835 | sllv CARG2, CARG1, CARG2
1836 | srlv CARG1, CARG1, TMP0
1837 |.elif shmod == 2
1838 | li AT, 32
1839 | subu TMP0, AT, CARG2
1840 | srlv CARG2, CARG1, CARG2
1841 | sllv CARG1, CARG1, TMP0
1842 |.endif
1843 | b ->fff_resi
1844 |. ins CRET1, CARG1, CARG2
1845 |.endmacro
1846 |
1847 |.ffunc_bit_sh lshift, sllv, 0
1848 |.ffunc_bit_sh rshift, srlv, 0
1849 |.ffunc_bit_sh arshift, srav, 0
1850 |// Can't use rotrv, since it's only in MIPS32R2.
1851 |.ffunc_bit_sh rol, or, 1
1852 |.ffunc_bit_sh ror, or, 2
1853 |
1854 |.ffunc_bit tobit
1855 |->fff_resi:
1856 | mtc1 CRET1, FRET1
1857 | b ->fff_resn
1858 |. cvt.d.w FRET1, FRET1
1859 |
1860 |//-----------------------------------------------------------------------
1861 |
1862 |->fff_fallback: // Call fast function fallback handler.
1863 | // BASE = new base, RB = CFUNC, RC = nargs*8
1864 | lw TMP3, CFUNC:RB->f
1865 | addu TMP1, BASE, NARGS8:RC
1866 | lw PC, FRAME_PC(BASE) // Fallback may overwrite PC.
1867 | addiu TMP0, TMP1, 8*LUA_MINSTACK
1868 | lw TMP2, L->maxstack
1869 | sw PC, SAVE_PC // Redundant (but a defined value).
1870 | sltu AT, TMP2, TMP0
1871 | sw BASE, L->base
1872 | sw TMP1, L->top
1873 | bnez AT, >5 // Need to grow stack.
1874 |. move CFUNCADDR, TMP3
1875 | jalr TMP3 // (lua_State *L)
1876 |. move CARG1, L
1877 | // Either throws an error, or recovers and returns -1, 0 or nresults+1.
1878 | lw BASE, L->base
1879 | sll RD, CRET1, 3
1880 | bgtz CRET1, ->fff_res // Returned nresults+1?
1881 |. addiu RA, BASE, -8
1882 |1: // Returned 0 or -1: retry fast path.
1883 | lw TMP0, L->top
1884 | lw LFUNC:RB, FRAME_FUNC(BASE)
1885 | bnez CRET1, ->vm_call_tail // Returned -1?
1886 |. subu NARGS8:RC, TMP0, BASE
1887 | ins_callt // Returned 0: retry fast path.
1888 |
1889 |// Reconstruct previous base for vmeta_call during tailcall.
1890 |->vm_call_tail:
1891 | andi TMP0, PC, FRAME_TYPE
1892 | li AT, -4
1893 | bnez TMP0, >3
1894 |. and TMP1, PC, AT
1895 | lbu TMP1, OFS_RA(PC)
1896 | sll TMP1, TMP1, 3
1897 |3:
1898 | b ->vm_call_dispatch // Resolve again for tailcall.
1899 |. subu TMP2, BASE, TMP1
1900 |
1901 |5: // Grow stack for fallback handler.
1902 | load_got lj_state_growstack
1903 | li CARG2, LUA_MINSTACK
1904 | call_intern lj_state_growstack // (lua_State *L, int n)
1905 |. move CARG1, L
1906 | lw BASE, L->base
1907 | b <1
1908 |. li CRET1, 0 // Force retry.
1909 |
1910 |->fff_gcstep: // Call GC step function.
1911 | // BASE = new base, RC = nargs*8
1912 | move MULTRES, ra
1913 | load_got lj_gc_step
1914 | sw BASE, L->base
1915 | addu TMP0, BASE, NARGS8:RC
1916 | sw PC, SAVE_PC // Redundant (but a defined value).
1917 | sw TMP0, L->top
1918 | call_intern lj_gc_step // (lua_State *L)
1919 |. move CARG1, L
1920 | lw BASE, L->base
1921 | move ra, MULTRES
1922 | lw TMP0, L->top
1923 | lw CFUNC:RB, FRAME_FUNC(BASE)
1924 | jr ra
1925 |. subu NARGS8:RC, TMP0, BASE
1926 |
1927 |//-----------------------------------------------------------------------
1928 |//-- Special dispatch targets -------------------------------------------
1929 |//-----------------------------------------------------------------------
1930 |
1931 |->vm_record: // Dispatch target for recording phase.
1932#if LJ_HASJIT
1933 | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH)
1934 | andi AT, TMP3, HOOK_VMEVENT // No recording while in vmevent.
1935 | bnez AT, >5
1936 | // Decrement the hookcount for consistency, but always do the call.
1937 |. lw TMP2, DISPATCH_GL(hookcount)(DISPATCH)
1938 | andi AT, TMP3, HOOK_ACTIVE
1939 | bnez AT, >1
1940 |. addiu TMP2, TMP2, -1
1941 | andi AT, TMP3, LUA_MASKLINE|LUA_MASKCOUNT
1942 | beqz AT, >1
1943 |. nop
1944 | b >1
1945 |. sw TMP2, DISPATCH_GL(hookcount)(DISPATCH)
1946#endif
1947 |
1948 |->vm_rethook: // Dispatch target for return hooks.
1949 | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH)
1950 | andi AT, TMP3, HOOK_ACTIVE // Hook already active?
1951 | beqz AT, >1
1952 |5: // Re-dispatch to static ins.
1953 |. lw AT, GG_DISP2STATIC(TMP0) // Assumes TMP0 holds DISPATCH+OP*4.
1954 | jr AT
1955 |. nop
1956 |
1957 |->vm_inshook: // Dispatch target for instr/line hooks.
1958 | lbu TMP3, DISPATCH_GL(hookmask)(DISPATCH)
1959 | lw TMP2, DISPATCH_GL(hookcount)(DISPATCH)
1960 | andi AT, TMP3, HOOK_ACTIVE // Hook already active?
1961 | bnez AT, <5
1962 |. andi AT, TMP3, LUA_MASKLINE|LUA_MASKCOUNT
1963 | beqz AT, <5
1964 |. addiu TMP2, TMP2, -1
1965 | beqz TMP2, >1
1966 |. sw TMP2, DISPATCH_GL(hookcount)(DISPATCH)
1967 | andi AT, TMP3, LUA_MASKLINE
1968 | beqz AT, <5
1969 |1:
1970 |. load_got lj_dispatch_ins
1971 | sw MULTRES, SAVE_MULTRES
1972 | move CARG2, PC
1973 | sw BASE, L->base
1974 | // SAVE_PC must hold the _previous_ PC. The callee updates it with PC.
1975 | call_intern lj_dispatch_ins // (lua_State *L, const BCIns *pc)
1976 |. move CARG1, L
1977 |3:
1978 | lw BASE, L->base
1979 |4: // Re-dispatch to static ins.
1980 | lw INS, -4(PC)
1981 | decode_OP4a TMP1, INS
1982 | decode_OP4b TMP1
1983 | addu TMP0, DISPATCH, TMP1
1984 | decode_RD8a RD, INS
1985 | lw AT, GG_DISP2STATIC(TMP0)
1986 | decode_RA8a RA, INS
1987 | decode_RD8b RD
1988 | jr AT
1989 | decode_RA8b RA
1990 |
1991 |->cont_hook: // Continue from hook yield.
1992 | addiu PC, PC, 4
1993 | b <4
1994 |. lw MULTRES, -24+LO(RB) // Restore MULTRES for *M ins.
1995 |
1996 |->vm_hotloop: // Hot loop counter underflow.
1997#if LJ_HASJIT
1998 |NYI
1999#endif
2000 |
2001 |->vm_callhook: // Dispatch target for call hooks.
2002#if LJ_HASJIT
2003 | b >1
2004#endif
2005 |. move CARG2, PC
2006 |
2007 |->vm_hotcall: // Hot call counter underflow.
2008#if LJ_HASJIT
2009 | ori CARG2, PC, 1
2010 |1:
2011#endif
2012 | load_got lj_dispatch_call
2013 | addu TMP0, BASE, RC
2014 | sw PC, SAVE_PC
2015 | sw BASE, L->base
2016 | subu RA, RA, BASE
2017 | sw TMP0, L->top
2018 | call_intern lj_dispatch_call // (lua_State *L, const BCIns *pc)
2019 |. move CARG1, L
2020 | // Returns ASMFunction.
2021 | lw BASE, L->base
2022 | lw TMP0, L->top
2023 | sw r0, SAVE_PC // Invalidate for subsequent line hook.
2024 | subu NARGS8:RC, TMP0, BASE
2025 | addu RA, BASE, RA
2026 | lw LFUNC:RB, FRAME_FUNC(BASE)
2027 | jr CRET1
2028 |. lw INS, -4(PC)
2029 |
2030 |//-----------------------------------------------------------------------
2031 |//-- Trace exit handler -------------------------------------------------
2032 |//-----------------------------------------------------------------------
2033 |
2034 |->vm_exit_handler:
2035#if LJ_HASJIT
2036 |NYI
2037#endif
2038 |->vm_exit_interp:
2039#if LJ_HASJIT
2040 |NYI
2041#endif
2042 |
2043 |//-----------------------------------------------------------------------
2044 |//-- Math helper functions ----------------------------------------------
2045 |//-----------------------------------------------------------------------
2046 |
2047 |// Modifies AT, TMP0, FRET1, FRET2, f4. Keeps all others incl. FARG1, FARG2.
2048 |.macro vm_round, func
2049 | lui TMP0, 0x4330 // Hiword of 2^52 (double).
2050 | mtc1 r0, f4
2051 | mtc1 TMP0, f5
2052 | abs.d FRET2, FARG1 // |x|
2053 | mfc1 AT, f13
2054 | c.olt.d 0, FRET2, f4
2055 | add.d FRET1, FRET2, f4 // (|x| + 2^52) - 2^52
2056 | bc1f 0, >1 // Truncate only if |x| < 2^52.
2057 |. sub.d FRET1, FRET1, f4
2058 | slt AT, AT, r0
2059 |.if "func" == "ceil"
2060 | lui TMP0, 0xbff0 // Hiword of -1 (double). Preserves -0.
2061 |.else
2062 | lui TMP0, 0x3ff0 // Hiword of +1 (double).
2063 |.endif
2064 |.if "func" == "trunc"
2065 | mtc1 TMP0, f5
2066 | c.olt.d 0, FRET2, FRET1 // |x| < result?
2067 | sub.d FRET2, FRET1, f4
2068 | movt.d FRET1, FRET2, 0 // If yes, subtract +1.
2069 | neg.d FRET2, FRET1
2070 | jr ra
2071 |. movn.d FRET1, FRET2, AT // Merge sign bit back in.
2072 |.else
2073 | neg.d FRET2, FRET1
2074 | mtc1 TMP0, f5
2075 | movn.d FRET1, FRET2, AT // Merge sign bit back in.
2076 |.if "func" == "ceil"
2077 | c.olt.d 0, FRET1, FARG1 // x > result?
2078 |.else
2079 | c.olt.d 0, FARG1, FRET1 // x < result?
2080 |.endif
2081 | sub.d FRET2, FRET1, f4 // If yes, subtract +-1.
2082 | jr ra
2083 |. movt.d FRET1, FRET2, 0
2084 |.endif
2085 |1:
2086 | jr ra
2087 |. mov.d FRET1, FARG1
2088 |.endmacro
2089 |
2090 |->vm_floor:
2091 | vm_round floor
2092 |->vm_ceil:
2093 | vm_round ceil
2094 |->vm_trunc:
2095#if LJ_HASJIT
2096 | vm_round trunc
2097#endif
2098 |
2099 |//-----------------------------------------------------------------------
2100 |//-- Miscellaneous functions --------------------------------------------
2101 |//-----------------------------------------------------------------------
2102 |
2103 |//-----------------------------------------------------------------------
2104 |//-- FFI helper functions -----------------------------------------------
2105 |//-----------------------------------------------------------------------
2106 |
2107 |// Handler for callback functions. Callback slot number in r1, g in r2.
2108 |->vm_ffi_callback:
2109#if LJ_HASFFI
2110 |.type CTSTATE, CTState, PC
2111 | saveregs
2112 | lw CTSTATE, GL:r2->ctype_state
2113 | addiu DISPATCH, r2, GG_G2DISP
2114 | load_got lj_ccallback_enter
2115 | sw r1, CTSTATE->cb.slot
2116 | sw CARG1, CTSTATE->cb.gpr[0]
2117 | sw CARG2, CTSTATE->cb.gpr[1]
2118 | sdc1 FARG1, CTSTATE->cb.fpr[0]
2119 | sw CARG3, CTSTATE->cb.gpr[2]
2120 | sw CARG4, CTSTATE->cb.gpr[3]
2121 | sdc1 FARG2, CTSTATE->cb.fpr[1]
2122 | addiu TMP0, sp, CFRAME_SPACE+16
2123 | sw TMP0, CTSTATE->cb.stack
2124 | sw r0, SAVE_PC // Any value outside of bytecode is ok.
2125 | move CARG2, sp
2126 | call_intern lj_ccallback_enter // (CTState *cts, void *cf)
2127 |. move CARG1, CTSTATE
2128 | // Returns lua_State *.
2129 | lw BASE, L:CRET1->base
2130 | lw RC, L:CRET1->top
2131 | move L, CRET1
2132 | lui TMP3, 0x59c0 // TOBIT = 2^52 + 2^51 (float).
2133 | lw LFUNC:RB, FRAME_FUNC(BASE)
2134 | mtc1 TMP3, TOBIT
2135 | li_vmstate INTERP
2136 | li TISNIL, LJ_TNIL
2137 | subu RC, RC, BASE
2138 | st_vmstate
2139 | cvt.d.s TOBIT, TOBIT
2140 | ins_callt
2141#endif
2142 |
2143 |->cont_ffi_callback: // Return from FFI callback.
2144#if LJ_HASFFI
2145 | load_got lj_ccallback_leave
2146 | lw CTSTATE, DISPATCH_GL(ctype_state)(DISPATCH)
2147 | sw BASE, L->base
2148 | sw RB, L->top
2149 | sw L, CTSTATE->L
2150 | move CARG2, RA
2151 | call_intern lj_ccallback_leave // (CTState *cts, TValue *o)
2152 |. move CARG1, CTSTATE
2153 | lw CRET1, CTSTATE->cb.gpr[0]
2154 | ldc1 FRET1, CTSTATE->cb.fpr[0]
2155 | lw CRET2, CTSTATE->cb.gpr[1]
2156 | b ->vm_leave_unw
2157 |. ldc1 FRET2, CTSTATE->cb.fpr[1]
2158#endif
2159 |
2160 |->vm_ffi_call: // Call C function via FFI.
2161 | // Caveat: needs special frame unwinding, see below.
2162#if LJ_HASFFI
2163 | .type CCSTATE, CCallState, CARG1
2164 | lw TMP1, CCSTATE->spadj
2165 | lbu CARG2, CCSTATE->nsp
2166 | move TMP2, sp
2167 | subu sp, sp, TMP1
2168 | sw ra, -4(TMP2)
2169 | sll CARG2, CARG2, 2
2170 | sw r16, -8(TMP2)
2171 | sw CCSTATE, -12(TMP2)
2172 | move r16, TMP2
2173 | addiu TMP1, CCSTATE, offsetof(CCallState, stack)
2174 | addiu TMP2, sp, 16
2175 | beqz CARG2, >2
2176 |. addu TMP3, TMP1, CARG2
2177 |1:
2178 | lw TMP0, 0(TMP1)
2179 | addiu TMP1, TMP1, 4
2180 | sltu AT, TMP1, TMP3
2181 | sw TMP0, 0(TMP2)
2182 | bnez AT, <1
2183 |. addiu TMP2, TMP2, 4
2184 |2:
2185 | lw CFUNCADDR, CCSTATE->func
2186 | lw CARG2, CCSTATE->gpr[1]
2187 | lw CARG3, CCSTATE->gpr[2]
2188 | lw CARG4, CCSTATE->gpr[3]
2189 | ldc1 FARG1, CCSTATE->fpr[0]
2190 | ldc1 FARG2, CCSTATE->fpr[1]
2191 | jalr CFUNCADDR
2192 |. lw CARG1, CCSTATE->gpr[0] // Do this last, since CCSTATE is CARG1.
2193 | lw CCSTATE:TMP1, -12(r16)
2194 | lw TMP2, -8(r16)
2195 | lw ra, -4(r16)
2196 | sw CRET1, CCSTATE:TMP1->gpr[0]
2197 | sw CRET2, CCSTATE:TMP1->gpr[1]
2198 | sdc1 FRET1, CCSTATE:TMP1->fpr[0]
2199 | sdc1 FRET2, CCSTATE:TMP1->fpr[1]
2200 | move sp, r16
2201 | jr ra
2202 |. move r16, TMP2
2203#endif
2204 |// Note: vm_ffi_call must be the last function in this object file!
2205 |
2206 |//-----------------------------------------------------------------------
2207}
2208
2209/* Generate the code for a single instruction. */
2210static void build_ins(BuildCtx *ctx, BCOp op, int defop)
2211{
2212 int vk = 0;
2213 |=>defop:
2214
2215 switch (op) {
2216
2217 /* -- Comparison ops ---------------------------------------------------- */
2218
2219 /* Remember: all ops branch for a true comparison, fall through otherwise. */
2220
2221 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
2222 | // RA = src1*8, RD = src2*8, JMP with RD = target
2223 | addu CARG2, BASE, RA
2224 | addu CARG3, BASE, RD
2225 | lw TMP0, HI(CARG2)
2226 | lw TMP1, HI(CARG3)
2227 | ldc1 f0, 0(CARG2)
2228 | ldc1 f2, 0(CARG3)
2229 | sltiu TMP0, TMP0, LJ_TISNUM
2230 | sltiu TMP1, TMP1, LJ_TISNUM
2231 | lhu TMP2, OFS_RD(PC)
2232 | and TMP0, TMP0, TMP1
2233 | addiu PC, PC, 4
2234 | beqz TMP0, ->vmeta_comp
2235 |. lui TMP1, (-(BCBIAS_J*4 >> 16) & 65535)
2236 | decode_RD4b TMP2
2237 | addu TMP2, TMP2, TMP1
2238 if (op == BC_ISLT || op == BC_ISGE) {
2239 | c.olt.d f0, f2
2240 } else {
2241 | c.ole.d f0, f2
2242 }
2243 if (op == BC_ISLT || op == BC_ISLE) {
2244 | movf TMP2, r0
2245 } else {
2246 | movt TMP2, r0
2247 }
2248 | addu PC, PC, TMP2
2249 |1:
2250 | ins_next
2251 break;
2252
2253 case BC_ISEQV: case BC_ISNEV:
2254 vk = op == BC_ISEQV;
2255 | // RA = src1*8, RD = src2*8, JMP with RD = target
2256 | addu RA, BASE, RA
2257 | addiu PC, PC, 4
2258 | lw TMP0, HI(RA)
2259 | ldc1 f0, 0(RA)
2260 | addu RD, BASE, RD
2261 | lhu TMP2, -4+OFS_RD(PC)
2262 | lw TMP1, HI(RD)
2263 | ldc1 f2, 0(RD)
2264 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)
2265 | sltiu AT, TMP0, LJ_TISNUM
2266 | sltiu CARG1, TMP1, LJ_TISNUM
2267 | decode_RD4b TMP2
2268 | and AT, AT, CARG1
2269 | beqz AT, >5
2270 |. addu TMP2, TMP2, TMP3
2271 | c.eq.d f0, f2
2272 if (vk) {
2273 | movf TMP2, r0
2274 } else {
2275 | movt TMP2, r0
2276 }
2277 |1:
2278 | addu PC, PC, TMP2
2279 | ins_next
2280 |5: // Either or both types are not numbers.
2281 | lw CARG2, LO(RA)
2282 | lw CARG3, LO(RD)
2283 if (LJ_HASFFI) {
2284 | li TMP3, LJ_TCDATA
2285 | beq TMP0, TMP3, ->vmeta_equal_cd
2286 }
2287 |. sltiu AT, TMP0, LJ_TISPRI // Not a primitive?
2288 if (LJ_HASFFI) {
2289 | beq TMP1, TMP3, ->vmeta_equal_cd
2290 }
2291 |. xor TMP3, CARG2, CARG3 // Same tv?
2292 | xor TMP1, TMP1, TMP0 // Same type?
2293 | sltiu CARG1, TMP0, LJ_TISTABUD+1 // Table or userdata?
2294 | movz TMP3, r0, AT // Ignore tv if primitive.
2295 | movn CARG1, r0, TMP1 // Tab/ud and same type?
2296 | or AT, TMP1, TMP3 // Same type && (pri||same tv).
2297 | movz CARG1, r0, AT
2298 | beqz CARG1, <1 // Done if not tab/ud or not same type or same tv.
2299 if (vk) {
2300 |. movn TMP2, r0, AT
2301 } else {
2302 |. movz TMP2, r0, AT
2303 }
2304 | // Different tables or userdatas. Need to check __eq metamethod.
2305 | // Field metatable must be at same offset for GCtab and GCudata!
2306 | lw TAB:TMP1, TAB:CARG2->metatable
2307 | beqz TAB:TMP1, <1 // No metatable?
2308 |. nop
2309 | lbu TMP1, TAB:TMP1->nomm
2310 | andi TMP1, TMP1, 1<<MM_eq
2311 | bnez TMP1, <1 // Or 'no __eq' flag set?
2312 |. nop
2313 | b ->vmeta_equal // Handle __eq metamethod.
2314 |. li CARG4, 1-vk // ne = 0 or 1.
2315 break;
2316
2317 case BC_ISEQS: case BC_ISNES:
2318 vk = op == BC_ISEQS;
2319 | // RA = src*8, RD = str_const*8 (~), JMP with RD = target
2320 | addu RA, BASE, RA
2321 | addiu PC, PC, 4
2322 | lw TMP0, HI(RA)
2323 | srl RD, RD, 1
2324 | lw STR:TMP3, LO(RA)
2325 | subu RD, KBASE, RD
2326 | lhu TMP2, -4+OFS_RD(PC)
2327 if (LJ_HASFFI) {
2328 | li AT, LJ_TCDATA
2329 | beq TMP0, AT, ->vmeta_equal_cd
2330 }
2331 |. lw STR:TMP1, -4(RD) // KBASE-4-str_const*4
2332 | addiu TMP0, TMP0, -LJ_TSTR
2333 | decode_RD4b TMP2
2334 | xor TMP1, STR:TMP1, STR:TMP3
2335 | or TMP0, TMP0, TMP1
2336 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)
2337 | addu TMP2, TMP2, TMP3
2338 if (vk) {
2339 | movn TMP2, r0, TMP0
2340 } else {
2341 | movz TMP2, r0, TMP0
2342 }
2343 | addu PC, PC, TMP2
2344 | ins_next
2345 break;
2346
2347 case BC_ISEQN: case BC_ISNEN:
2348 vk = op == BC_ISEQN;
2349 | // RA = src*8, RD = num_const*8, JMP with RD = target
2350 | addu RA, BASE, RA
2351 | addiu PC, PC, 4
2352 | lw TMP0, HI(RA)
2353 | ldc1 f0, 0(RA)
2354 | addu RD, KBASE, RD
2355 | lhu TMP2, -4+OFS_RD(PC)
2356 | ldc1 f2, 0(RD)
2357 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)
2358 | sltiu AT, TMP0, LJ_TISNUM
2359 | decode_RD4b TMP2
2360 if (LJ_HASFFI) {
2361 | beqz AT, >5
2362 } else {
2363 | beqz AT, >1
2364 }
2365 |. addu TMP2, TMP2, TMP3
2366 | c.eq.d f0, f2
2367 if (vk) {
2368 | movf TMP2, r0
2369 | addu PC, PC, TMP2
2370 |1:
2371 } else {
2372 | movt TMP2, r0
2373 |1:
2374 | addu PC, PC, TMP2
2375 }
2376 | ins_next
2377 if (LJ_HASFFI) {
2378 |5:
2379 | li AT, LJ_TCDATA
2380 | beq TMP0, AT, ->vmeta_equal_cd
2381 |. nop
2382 | b <1
2383 |. nop
2384 }
2385 break;
2386
2387 case BC_ISEQP: case BC_ISNEP:
2388 vk = op == BC_ISEQP;
2389 | // RA = src*8, RD = primitive_type*8 (~), JMP with RD = target
2390 | addu RA, BASE, RA
2391 | srl TMP1, RD, 3
2392 | lw TMP0, HI(RA)
2393 | lhu TMP2, OFS_RD(PC)
2394 | not TMP1, TMP1
2395 | addiu PC, PC, 4
2396 if (LJ_HASFFI) {
2397 | li AT, LJ_TCDATA
2398 | beq TMP0, AT, ->vmeta_equal_cd
2399 }
2400 |. xor TMP0, TMP0, TMP1
2401 | decode_RD4b TMP2
2402 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)
2403 | addu TMP2, TMP2, TMP3
2404 if (vk) {
2405 | movn TMP2, r0, TMP0
2406 } else {
2407 | movz TMP2, r0, TMP0
2408 }
2409 | addu PC, PC, TMP2
2410 | ins_next
2411 break;
2412
2413 /* -- Unary test and copy ops ------------------------------------------- */
2414
2415 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:
2416 | // RA = dst*8 or unused, RD = src*8, JMP with RD = target
2417 | addu RD, BASE, RD
2418 | lhu TMP2, OFS_RD(PC)
2419 | lw TMP0, HI(RD)
2420 | addiu PC, PC, 4
2421 if (op == BC_IST || op == BC_ISF) {
2422 | sltiu TMP0, TMP0, LJ_TISTRUECOND
2423 | decode_RD4b TMP2
2424 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)
2425 | addu TMP2, TMP2, TMP3
2426 if (op == BC_IST) {
2427 | movz TMP2, r0, TMP0
2428 } else {
2429 | movn TMP2, r0, TMP0
2430 }
2431 | addu PC, PC, TMP2
2432 } else {
2433 | sltiu TMP0, TMP0, LJ_TISTRUECOND
2434 | ldc1 f0, 0(RD)
2435 if (op == BC_ISTC) {
2436 | beqz TMP0, >1
2437 } else {
2438 | bnez TMP0, >1
2439 }
2440 |. addu RA, BASE, RA
2441 | decode_RD4b TMP2
2442 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)
2443 | addu TMP2, TMP2, TMP3
2444 | sdc1 f0, 0(RA)
2445 | addu PC, PC, TMP2
2446 |1:
2447 }
2448 | ins_next
2449 break;
2450
2451 /* -- Unary ops --------------------------------------------------------- */
2452
2453 case BC_MOV:
2454 | // RA = dst*8, RD = src*8
2455 | addu RD, BASE, RD
2456 | addu RA, BASE, RA
2457 | ldc1 f0, 0(RD)
2458 | ins_next1
2459 | sdc1 f0, 0(RA)
2460 | ins_next2
2461 break;
2462 case BC_NOT:
2463 | // RA = dst*8, RD = src*8
2464 | addu RD, BASE, RD
2465 | addu RA, BASE, RA
2466 | lw TMP0, HI(RD)
2467 | li TMP1, LJ_TFALSE
2468 | sltiu TMP0, TMP0, LJ_TISTRUECOND
2469 | addiu TMP1, TMP0, LJ_TTRUE
2470 | ins_next1
2471 | sw TMP1, HI(RA)
2472 | ins_next2
2473 break;
2474 case BC_UNM:
2475 | // RA = dst*8, RD = src*8
2476 | addu CARG3, BASE, RD
2477 | addu RA, BASE, RA
2478 | lw TMP0, HI(CARG3)
2479 | ldc1 f0, 0(CARG3)
2480 | sltiu AT, TMP0, LJ_TISNUM
2481 | beqz AT, ->vmeta_unm
2482 |. neg.d f0, f0
2483 | ins_next1
2484 | sdc1 f0, 0(RA)
2485 | ins_next2
2486 break;
2487 case BC_LEN:
2488 | // RA = dst*8, RD = src*8
2489 | addu CARG2, BASE, RD
2490 | addu RA, BASE, RA
2491 | lw TMP0, HI(CARG2)
2492 | lw CARG1, LO(CARG2)
2493 | li AT, LJ_TSTR
2494 | bne TMP0, AT, >2
2495 |. li AT, LJ_TTAB
2496 | lw CRET1, STR:CARG1->len
2497 |1:
2498 | mtc1 CRET1, f0
2499 | cvt.d.w f0, f0
2500 | ins_next1
2501 | sdc1 f0, 0(RA)
2502 | ins_next2
2503 |2:
2504 | bne TMP0, AT, ->vmeta_len
2505 |. nop
2506#ifdef LUAJIT_ENABLE_LUA52COMPAT
2507 | lw TAB:TMP2, TAB:CARG1->metatable
2508 | bnez TAB:TMP2, >9
2509 |. nop
2510 |3:
2511#endif
2512 |->BC_LEN_Z:
2513 | load_got lj_tab_len
2514 | call_intern lj_tab_len // (GCtab *t)
2515 |. nop
2516 | // Returns uint32_t (but less than 2^31).
2517 | b <1
2518 |. nop
2519#ifdef LUAJIT_ENABLE_LUA52COMPAT
2520 |9:
2521 | lbu TMP0, TAB:TMP2->nomm
2522 | andi TMP0, TMP0, 1<<MM_len
2523 | bnez TMP0, <3 // 'no __len' flag set: done.
2524 |. nop
2525 | b ->vmeta_len
2526 |. nop
2527#endif
2528 break;
2529
2530 /* -- Binary ops -------------------------------------------------------- */
2531
2532 |.macro ins_arithpre
2533 ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
2534 | decode_RB8a RB, INS
2535 | decode_RB8b RB
2536 | decode_RDtoRC8 RC, RD
2537 | // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8
2538 ||switch (vk) {
2539 ||case 0:
2540 | addu CARG3, BASE, RB
2541 | addu CARG4, KBASE, RC
2542 | lw TMP1, HI(CARG3)
2543 | ldc1 f20, 0(CARG3)
2544 | ldc1 f22, 0(CARG4)
2545 | sltiu AT, TMP1, LJ_TISNUM
2546 || break;
2547 ||case 1:
2548 | addu CARG4, BASE, RB
2549 | addu CARG3, KBASE, RC
2550 | lw TMP1, HI(CARG4)
2551 | ldc1 f22, 0(CARG4)
2552 | ldc1 f20, 0(CARG3)
2553 | sltiu AT, TMP1, LJ_TISNUM
2554 || break;
2555 ||default:
2556 | addu CARG3, BASE, RB
2557 | addu CARG4, BASE, RC
2558 | lw TMP1, HI(CARG3)
2559 | lw TMP2, HI(CARG4)
2560 | ldc1 f20, 0(CARG3)
2561 | ldc1 f22, 0(CARG4)
2562 | sltiu AT, TMP1, LJ_TISNUM
2563 | sltiu TMP0, TMP2, LJ_TISNUM
2564 | and AT, AT, TMP0
2565 || break;
2566 ||}
2567 | beqz AT, ->vmeta_arith
2568 |. addu RA, BASE, RA
2569 |.endmacro
2570 |
2571 |.macro fpmod, a, b, c
2572 |->BC_MODVN_Z:
2573 | bal ->vm_floor // floor(b/c)
2574 |. div.d FARG1, b, c
2575 | mul.d a, FRET1, c
2576 | sub.d a, b, a // b - floor(b/c)*c
2577 |.endmacro
2578 |
2579 |.macro ins_arith, ins
2580 | ins_arithpre
2581 |.if "ins" == "fpmod_"
2582 | b ->BC_MODVN_Z // Avoid 3 copies. It's slow anyway.
2583 |. nop
2584 |.else
2585 | ins f0, f20, f22
2586 | ins_next1
2587 | sdc1 f0, 0(RA)
2588 | ins_next2
2589 |.endif
2590 |.endmacro
2591
2592 case BC_ADDVN: case BC_ADDNV: case BC_ADDVV:
2593 | ins_arith add.d
2594 break;
2595 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
2596 | ins_arith sub.d
2597 break;
2598 case BC_MULVN: case BC_MULNV: case BC_MULVV:
2599 | ins_arith mul.d
2600 break;
2601 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
2602 | ins_arith div.d
2603 break;
2604 case BC_MODVN:
2605 | ins_arith fpmod
2606 break;
2607 case BC_MODNV: case BC_MODVV:
2608 | ins_arith fpmod_
2609 break;
2610 case BC_POW:
2611 | decode_RB8a RB, INS
2612 | decode_RB8b RB
2613 | decode_RDtoRC8 RC, RD
2614 | addu CARG3, BASE, RB
2615 | addu CARG4, BASE, RC
2616 | lw TMP1, HI(CARG3)
2617 | lw TMP2, HI(CARG4)
2618 | ldc1 FARG1, 0(CARG3)
2619 | ldc1 FARG2, 0(CARG4)
2620 | sltiu AT, TMP1, LJ_TISNUM
2621 | sltiu TMP0, TMP2, LJ_TISNUM
2622 | and AT, AT, TMP0
2623 | load_got pow
2624 | beqz AT, ->vmeta_arith
2625 |. addu RA, BASE, RA
2626 | call_extern
2627 |. nop
2628 | ins_next1
2629 | sdc1 FRET1, 0(RA)
2630 | ins_next2
2631 break;
2632
2633 case BC_CAT:
2634 | // RA = dst*8, RB = src_start*8, RC = src_end*8
2635 | decode_RB8a RB, INS
2636 | decode_RB8b RB
2637 | decode_RDtoRC8 RC, RD
2638 | subu CARG3, RC, RB
2639 | sw BASE, L->base
2640 | addu CARG2, BASE, RC
2641 | move MULTRES, RB
2642 |->BC_CAT_Z:
2643 | load_got lj_meta_cat
2644 | srl CARG3, CARG3, 3
2645 | sw PC, SAVE_PC
2646 | call_intern lj_meta_cat // (lua_State *L, TValue *top, int left)
2647 |. move CARG1, L
2648 | // Returns NULL (finished) or TValue * (metamethod).
2649 | bnez CRET1, ->vmeta_binop
2650 |. lw BASE, L->base
2651 | addu RB, BASE, MULTRES
2652 | ldc1 f0, 0(RB)
2653 | addu RA, BASE, RA
2654 | ins_next1
2655 | sdc1 f0, 0(RA) // Copy result from RB to RA.
2656 | ins_next2
2657 break;
2658
2659 /* -- Constant ops ------------------------------------------------------ */
2660
2661 case BC_KSTR:
2662 | // RA = dst*8, RD = str_const*8 (~)
2663 | srl TMP1, RD, 1
2664 | subu TMP1, KBASE, TMP1
2665 | ins_next1
2666 | lw TMP0, -4(TMP1) // KBASE-4-str_const*4
2667 | addu RA, BASE, RA
2668 | li TMP2, LJ_TSTR
2669 | sw TMP0, LO(RA)
2670 | sw TMP2, HI(RA)
2671 | ins_next2
2672 break;
2673 case BC_KCDATA:
2674#if LJ_HASFFI
2675 | // RA = dst*8, RD = cdata_const*8 (~)
2676 | srl TMP1, RD, 1
2677 | subu TMP1, KBASE, TMP1
2678 | ins_next1
2679 | lw TMP0, -4(TMP1) // KBASE-4-cdata_const*4
2680 | addu RA, BASE, RA
2681 | li TMP2, LJ_TCDATA
2682 | sw TMP0, LO(RA)
2683 | sw TMP2, HI(RA)
2684 | ins_next2
2685#endif
2686 break;
2687 case BC_KSHORT:
2688 | // RA = dst*8, RD = int16_literal*8
2689 | sra RD, INS, 16
2690 | mtc1 RD, f0
2691 | addu RA, BASE, RA
2692 | cvt.d.w f0, f0
2693 | ins_next1
2694 | sdc1 f0, 0(RA)
2695 | ins_next2
2696 break;
2697 case BC_KNUM:
2698 | // RA = dst*8, RD = num_const*8
2699 | addu RD, KBASE, RD
2700 | addu RA, BASE, RA
2701 | ldc1 f0, 0(RD)
2702 | ins_next1
2703 | sdc1 f0, 0(RA)
2704 | ins_next2
2705 break;
2706 case BC_KPRI:
2707 | // RA = dst*8, RD = primitive_type*8 (~)
2708 | srl TMP1, RD, 3
2709 | addu RA, BASE, RA
2710 | not TMP0, TMP1
2711 | ins_next1
2712 | sw TMP0, HI(RA)
2713 | ins_next2
2714 break;
2715 case BC_KNIL:
2716 | // RA = base*8, RD = end*8
2717 | addu RA, BASE, RA
2718 | sw TISNIL, HI(RA)
2719 | addiu RA, RA, 8
2720 | addu RD, BASE, RD
2721 |1:
2722 | sw TISNIL, HI(RA)
2723 | slt AT, RA, RD
2724 | bnez AT, <1
2725 |. addiu RA, RA, 8
2726 | ins_next_
2727 break;
2728
2729 /* -- Upvalue and function ops ------------------------------------------ */
2730
2731 case BC_UGET:
2732 | // RA = dst*8, RD = uvnum*8
2733 | lw LFUNC:RB, FRAME_FUNC(BASE)
2734 | srl RD, RD, 1
2735 | addu RD, RD, LFUNC:RB
2736 | lw UPVAL:RB, LFUNC:RD->uvptr
2737 | ins_next1
2738 | lw TMP1, UPVAL:RB->v
2739 | ldc1 f0, 0(TMP1)
2740 | addu RA, BASE, RA
2741 | sdc1 f0, 0(RA)
2742 | ins_next2
2743 break;
2744 case BC_USETV:
2745 | // RA = uvnum*8, RD = src*8
2746 | lw LFUNC:RB, FRAME_FUNC(BASE)
2747 | srl RA, RA, 1
2748 | addu RD, BASE, RD
2749 | addu RA, RA, LFUNC:RB
2750 | ldc1 f0, 0(RD)
2751 | lw UPVAL:RB, LFUNC:RA->uvptr
2752 | lbu TMP3, UPVAL:RB->marked
2753 | lw CARG2, UPVAL:RB->v
2754 | andi TMP3, TMP3, LJ_GC_BLACK // isblack(uv)
2755 | lbu TMP0, UPVAL:RB->closed
2756 | lw TMP2, HI(RD)
2757 | sdc1 f0, 0(CARG2)
2758 | li AT, LJ_GC_BLACK|1
2759 | or TMP3, TMP3, TMP0
2760 | beq TMP3, AT, >2 // Upvalue is closed and black?
2761 |. addiu TMP2, TMP2, -(LJ_TISNUM+1)
2762 |1:
2763 | ins_next
2764 |
2765 |2: // Check if new value is collectable.
2766 | sltiu AT, TMP2, LJ_TISGCV - (LJ_TISNUM+1)
2767 | beqz AT, <1 // tvisgcv(v)
2768 |. lw TMP1, LO(RD)
2769 | lbu TMP3, GCOBJ:TMP1->gch.marked
2770 | andi TMP3, TMP3, LJ_GC_WHITES // iswhite(v)
2771 | beqz TMP3, <1
2772 |. load_got lj_gc_barrieruv
2773 | // Crossed a write barrier. Move the barrier forward.
2774 | call_intern lj_gc_barrieruv // (global_State *g, TValue *tv)
2775 |. addiu CARG1, DISPATCH, GG_DISP2G
2776 | b <1
2777 |. nop
2778 break;
2779 case BC_USETS:
2780 | // RA = uvnum*8, RD = str_const*8 (~)
2781 | lw LFUNC:RB, FRAME_FUNC(BASE)
2782 | srl RA, RA, 1
2783 | srl TMP1, RD, 1
2784 | addu RA, RA, LFUNC:RB
2785 | subu TMP1, KBASE, TMP1
2786 | lw UPVAL:RB, LFUNC:RA->uvptr
2787 | lw STR:TMP1, -4(TMP1) // KBASE-4-str_const*4
2788 | lbu TMP2, UPVAL:RB->marked
2789 | lw CARG2, UPVAL:RB->v
2790 | lbu TMP3, STR:TMP1->marked
2791 | andi AT, TMP2, LJ_GC_BLACK // isblack(uv)
2792 | lbu TMP2, UPVAL:RB->closed
2793 | li TMP0, LJ_TSTR
2794 | sw STR:TMP1, LO(CARG2)
2795 | bnez AT, >2
2796 |. sw TMP0, HI(CARG2)
2797 |1:
2798 | ins_next
2799 |
2800 |2: // Check if string is white and ensure upvalue is closed.
2801 | beqz TMP2, <1
2802 |. andi AT, TMP3, LJ_GC_WHITES // iswhite(str)
2803 | beqz AT, <1
2804 |. load_got lj_gc_barrieruv
2805 | // Crossed a write barrier. Move the barrier forward.
2806 | call_intern lj_gc_barrieruv // (global_State *g, TValue *tv)
2807 |. addiu CARG1, DISPATCH, GG_DISP2G
2808 | b <1
2809 |. nop
2810 break;
2811 case BC_USETN:
2812 | // RA = uvnum*8, RD = num_const*8
2813 | lw LFUNC:RB, FRAME_FUNC(BASE)
2814 | srl RA, RA, 1
2815 | addu RD, KBASE, RD
2816 | addu RA, RA, LFUNC:RB
2817 | ldc1 f0, 0(RD)
2818 | lw UPVAL:RB, LFUNC:RA->uvptr
2819 | ins_next1
2820 | lw TMP1, UPVAL:RB->v
2821 | sdc1 f0, 0(TMP1)
2822 | ins_next2
2823 break;
2824 case BC_USETP:
2825 | // RA = uvnum*8, RD = primitive_type*8 (~)
2826 | lw LFUNC:RB, FRAME_FUNC(BASE)
2827 | srl RA, RA, 1
2828 | srl TMP0, RD, 3
2829 | addu RA, RA, LFUNC:RB
2830 | not TMP0, TMP0
2831 | lw UPVAL:RB, LFUNC:RA->uvptr
2832 | ins_next1
2833 | lw TMP1, UPVAL:RB->v
2834 | sw TMP0, HI(TMP1)
2835 | ins_next2
2836 break;
2837
2838 case BC_UCLO:
2839 | // RA = level*8, RD = target
2840 | lw TMP2, L->openupval
2841 | branch_RD // Do this first since RD is not saved.
2842 | load_got lj_func_closeuv
2843 | sw BASE, L->base
2844 | beqz TMP2, >1
2845 |. move CARG1, L
2846 | call_intern lj_func_closeuv // (lua_State *L, TValue *level)
2847 |. addu CARG2, BASE, RA
2848 | lw BASE, L->base
2849 |1:
2850 | ins_next
2851 break;
2852
2853 case BC_FNEW:
2854 | // RA = dst*8, RD = proto_const*8 (~) (holding function prototype)
2855 | srl TMP1, RD, 1
2856 | load_got lj_func_newL_gc
2857 | subu TMP1, KBASE, TMP1
2858 | lw CARG3, FRAME_FUNC(BASE)
2859 | lw CARG2, -4(TMP1) // KBASE-4-tab_const*4
2860 | sw BASE, L->base
2861 | sw PC, SAVE_PC
2862 | // (lua_State *L, GCproto *pt, GCfuncL *parent)
2863 | call_intern lj_func_newL_gc
2864 |. move CARG1, L
2865 | // Returns GCfuncL *.
2866 | lw BASE, L->base
2867 | li TMP0, LJ_TFUNC
2868 | ins_next1
2869 | addu RA, BASE, RA
2870 | sw TMP0, HI(RA)
2871 | sw LFUNC:CRET1, LO(RA)
2872 | ins_next2
2873 break;
2874
2875 /* -- Table ops --------------------------------------------------------- */
2876
2877 case BC_TNEW:
2878 case BC_TDUP:
2879 | // RA = dst*8, RD = (hbits|asize)*8 | tab_const*8 (~)
2880 | lw TMP0, DISPATCH_GL(gc.total)(DISPATCH)
2881 | lw TMP1, DISPATCH_GL(gc.threshold)(DISPATCH)
2882 | sw BASE, L->base
2883 | sw PC, SAVE_PC
2884 | sltu AT, TMP0, TMP1
2885 | beqz AT, >5
2886 |1:
2887 if (op == BC_TNEW) {
2888 | load_got lj_tab_new
2889 | srl CARG2, RD, 3
2890 | andi CARG2, CARG2, 0x7ff
2891 | li TMP0, 0x801
2892 | addiu AT, CARG2, -0x7ff
2893 | srl CARG3, RD, 14
2894 | movz CARG2, TMP0, AT
2895 | // (lua_State *L, int32_t asize, uint32_t hbits)
2896 | call_intern lj_tab_new
2897 |. move CARG1, L
2898 | // Returns Table *.
2899 } else {
2900 | load_got lj_tab_dup
2901 | srl TMP1, RD, 1
2902 | subu TMP1, KBASE, TMP1
2903 | move CARG1, L
2904 | call_intern lj_tab_dup // (lua_State *L, Table *kt)
2905 |. lw CARG2, -4(TMP1) // KBASE-4-str_const*4
2906 | // Returns Table *.
2907 }
2908 | lw BASE, L->base
2909 | ins_next1
2910 | addu RA, BASE, RA
2911 | li TMP0, LJ_TTAB
2912 | sw TAB:CRET1, LO(RA)
2913 | sw TMP0, HI(RA)
2914 | ins_next2
2915 |5:
2916 | load_got lj_gc_step_fixtop
2917 | move MULTRES, RD
2918 | call_intern lj_gc_step_fixtop // (lua_State *L)
2919 |. move CARG1, L
2920 | b <1
2921 |. move RD, MULTRES
2922 break;
2923
2924 case BC_GGET:
2925 | // RA = dst*8, RD = str_const*8 (~)
2926 case BC_GSET:
2927 | // RA = src*8, RD = str_const*8 (~)
2928 | lw LFUNC:TMP2, FRAME_FUNC(BASE)
2929 | srl TMP1, RD, 1
2930 | subu TMP1, KBASE, TMP1
2931 | lw TAB:RB, LFUNC:TMP2->env
2932 | lw STR:RC, -4(TMP1) // KBASE-4-str_const*4
2933 if (op == BC_GGET) {
2934 | b ->BC_TGETS_Z
2935 } else {
2936 | b ->BC_TSETS_Z
2937 }
2938 |. addu RA, BASE, RA
2939 break;
2940
2941 case BC_TGETV:
2942 | // RA = dst*8, RB = table*8, RC = key*8
2943 | decode_RB8a RB, INS
2944 | decode_RB8b RB
2945 | decode_RDtoRC8 RC, RD
2946 | addu CARG2, BASE, RB
2947 | addu CARG3, BASE, RC
2948 | lw TMP1, HI(CARG2)
2949 | lw TMP2, HI(CARG3)
2950 | lw TAB:RB, LO(CARG2)
2951 | li AT, LJ_TTAB
2952 | ldc1 f0, 0(CARG3)
2953 | bne TMP1, AT, ->vmeta_tgetv
2954 |. addu RA, BASE, RA
2955 | sltiu AT, TMP2, LJ_TISNUM
2956 | beqz AT, >5
2957 |. li AT, LJ_TSTR
2958 |
2959 | // Convert number key to integer, check for integerness and range.
2960 | cvt.w.d f2, f0
2961 | lw TMP0, TAB:RB->asize
2962 | mfc1 TMP2, f2
2963 | cvt.d.w f4, f2
2964 | lw TMP1, TAB:RB->array
2965 | c.eq.d f0, f4
2966 | sltu AT, TMP2, TMP0
2967 | movf AT, r0
2968 | sll TMP2, TMP2, 3
2969 | beqz AT, ->vmeta_tgetv // Integer key and in array part?
2970 |. addu TMP2, TMP1, TMP2
2971 | lw TMP0, HI(TMP2)
2972 | beq TMP0, TISNIL, >2
2973 |. ldc1 f0, 0(TMP2)
2974 |1:
2975 | ins_next1
2976 | sdc1 f0, 0(RA)
2977 | ins_next2
2978 |
2979 |2: // Check for __index if table value is nil.
2980 | lw TAB:TMP2, TAB:RB->metatable
2981 | beqz TAB:TMP2, <1 // No metatable: done.
2982 |. nop
2983 | lbu TMP0, TAB:TMP2->nomm
2984 | andi TMP0, TMP0, 1<<MM_index
2985 | bnez TMP0, <1 // 'no __index' flag set: done.
2986 |. nop
2987 | b ->vmeta_tgetv
2988 |. nop
2989 |
2990 |5:
2991 | bne TMP2, AT, ->vmeta_tgetv
2992 |. lw STR:RC, LO(CARG3)
2993 | b ->BC_TGETS_Z // String key?
2994 |. nop
2995 break;
2996 case BC_TGETS:
2997 | // RA = dst*8, RB = table*8, RC = str_const*4 (~)
2998 | decode_RB8a RB, INS
2999 | decode_RB8b RB
3000 | addu CARG2, BASE, RB
3001 | decode_RC4a RC, INS
3002 | lw TMP0, HI(CARG2)
3003 | decode_RC4b RC
3004 | li AT, LJ_TTAB
3005 | lw TAB:RB, LO(CARG2)
3006 | subu CARG3, KBASE, RC
3007 | lw STR:RC, -4(CARG3) // KBASE-4-str_const*4
3008 | bne TMP0, AT, ->vmeta_tgets1
3009 |. addu RA, BASE, RA
3010 |->BC_TGETS_Z:
3011 | // TAB:RB = GCtab *, STR:RC = GCstr *, RA = dst*8
3012 | lw TMP0, TAB:RB->hmask
3013 | lw TMP1, STR:RC->hash
3014 | lw NODE:TMP2, TAB:RB->node
3015 | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask
3016 | sll TMP0, TMP1, 5
3017 | sll TMP1, TMP1, 3
3018 | subu TMP1, TMP0, TMP1
3019 | addu NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8)
3020 |1:
3021 | lw CARG1, offsetof(Node, key)+HI(NODE:TMP2)
3022 | lw TMP0, offsetof(Node, key)+LO(NODE:TMP2)
3023 | lw NODE:TMP1, NODE:TMP2->next
3024 | lw CARG2, offsetof(Node, val)+HI(NODE:TMP2)
3025 | addiu CARG1, CARG1, -LJ_TSTR
3026 | xor TMP0, TMP0, STR:RC
3027 | or AT, CARG1, TMP0
3028 | bnez AT, >4
3029 |. lw TAB:TMP3, TAB:RB->metatable
3030 | beq CARG2, TISNIL, >5 // Key found, but nil value?
3031 |. lw CARG1, offsetof(Node, val)+LO(NODE:TMP2)
3032 |3:
3033 | ins_next1
3034 | sw CARG2, HI(RA)
3035 | sw CARG1, LO(RA)
3036 | ins_next2
3037 |
3038 |4: // Follow hash chain.
3039 | bnez NODE:TMP1, <1
3040 |. move NODE:TMP2, NODE:TMP1
3041 | // End of hash chain: key not found, nil result.
3042 |
3043 |5: // Check for __index if table value is nil.
3044 | beqz TAB:TMP3, <3 // No metatable: done.
3045 |. li CARG2, LJ_TNIL
3046 | lbu TMP0, TAB:TMP3->nomm
3047 | andi TMP0, TMP0, 1<<MM_index
3048 | bnez TMP0, <3 // 'no __index' flag set: done.
3049 |. nop
3050 | b ->vmeta_tgets
3051 |. nop
3052 break;
3053 case BC_TGETB:
3054 | // RA = dst*8, RB = table*8, RC = index*8
3055 | decode_RB8a RB, INS
3056 | decode_RB8b RB
3057 | addu CARG2, BASE, RB
3058 | decode_RDtoRC8 RC, RD
3059 | lw CARG1, HI(CARG2)
3060 | li AT, LJ_TTAB
3061 | lw TAB:RB, LO(CARG2)
3062 | addu RA, BASE, RA
3063 | bne CARG1, AT, ->vmeta_tgetb
3064 |. srl TMP0, RC, 3
3065 | lw TMP1, TAB:RB->asize
3066 | lw TMP2, TAB:RB->array
3067 | sltu AT, TMP0, TMP1
3068 | beqz AT, ->vmeta_tgetb
3069 |. addu RC, TMP2, RC
3070 | lw TMP1, HI(RC)
3071 | beq TMP1, TISNIL, >5
3072 |. ldc1 f0, 0(RC)
3073 |1:
3074 | ins_next1
3075 | sdc1 f0, 0(RA)
3076 | ins_next2
3077 |
3078 |5: // Check for __index if table value is nil.
3079 | lw TAB:TMP2, TAB:RB->metatable
3080 | beqz TAB:TMP2, <1 // No metatable: done.
3081 |. nop
3082 | lbu TMP1, TAB:TMP2->nomm
3083 | andi TMP1, TMP1, 1<<MM_index
3084 | bnez TMP1, <1 // 'no __index' flag set: done.
3085 |. nop
3086 | b ->vmeta_tgetb // Caveat: preserve TMP0!
3087 |. nop
3088 break;
3089
3090 case BC_TSETV:
3091 | // RA = src*8, RB = table*8, RC = key*8
3092 | decode_RB8a RB, INS
3093 | decode_RB8b RB
3094 | decode_RDtoRC8 RC, RD
3095 | addu CARG2, BASE, RB
3096 | addu CARG3, BASE, RC
3097 | lw TMP1, HI(CARG2)
3098 | lw TMP2, HI(CARG3)
3099 | lw TAB:RB, LO(CARG2)
3100 | li AT, LJ_TTAB
3101 | ldc1 f0, 0(CARG3)
3102 | bne TMP1, AT, ->vmeta_tsetv
3103 |. addu RA, BASE, RA
3104 | sltiu AT, TMP2, LJ_TISNUM
3105 | beqz AT, >5
3106 |. li AT, LJ_TSTR
3107 |
3108 | // Convert number key to integer, check for integerness and range.
3109 | cvt.w.d f2, f0
3110 | lw TMP0, TAB:RB->asize
3111 | mfc1 TMP2, f2
3112 | cvt.d.w f4, f2
3113 | lw TMP1, TAB:RB->array
3114 | c.eq.d f0, f4
3115 | sltu AT, TMP2, TMP0
3116 | movf AT, r0
3117 | sll TMP2, TMP2, 3
3118 | beqz AT, ->vmeta_tsetv // Integer key and in array part?
3119 |. addu TMP1, TMP1, TMP2
3120 | lbu TMP3, TAB:RB->marked
3121 | lw TMP0, HI(TMP1)
3122 | beq TMP0, TISNIL, >3
3123 |. ldc1 f0, 0(RA)
3124 |1:
3125 | andi AT, TMP3, LJ_GC_BLACK // isblack(table)
3126 | bnez AT, >7
3127 |. sdc1 f0, 0(TMP1)
3128 |2:
3129 | ins_next
3130 |
3131 |3: // Check for __newindex if previous value is nil.
3132 | lw TAB:TMP2, TAB:RB->metatable
3133 | beqz TAB:TMP2, <1 // No metatable: done.
3134 |. nop
3135 | lbu TMP2, TAB:TMP2->nomm
3136 | andi TMP2, TMP2, 1<<MM_newindex
3137 | bnez TMP2, <1 // 'no __newindex' flag set: done.
3138 |. nop
3139 | b ->vmeta_tsetv
3140 |. nop
3141 |
3142 |5:
3143 | bne TMP2, AT, ->vmeta_tsetv
3144 |. lw STR:RC, LO(CARG3)
3145 | b ->BC_TSETS_Z // String key?
3146 |. nop
3147 |
3148 |7: // Possible table write barrier for the value. Skip valiswhite check.
3149 | barrierback TAB:RB, TMP3, TMP0, <2
3150 break;
3151 case BC_TSETS:
3152 | // RA = src*8, RB = table*8, RC = str_const*8 (~)
3153 | decode_RB8a RB, INS
3154 | decode_RB8b RB
3155 | addu CARG2, BASE, RB
3156 | decode_RC4a RC, INS
3157 | lw TMP0, HI(CARG2)
3158 | decode_RC4b RC
3159 | li AT, LJ_TTAB
3160 | subu CARG3, KBASE, RC
3161 | lw TAB:RB, LO(CARG2)
3162 | lw STR:RC, -4(CARG3) // KBASE-4-str_const*4
3163 | bne TMP0, AT, ->vmeta_tsets1
3164 |. addu RA, BASE, RA
3165 |->BC_TSETS_Z:
3166 | // TAB:RB = GCtab *, STR:RC = GCstr *, RA = BASE+src*8
3167 | lw TMP0, TAB:RB->hmask
3168 | lw TMP1, STR:RC->hash
3169 | lw NODE:TMP2, TAB:RB->node
3170 | sb r0, TAB:RB->nomm // Clear metamethod cache.
3171 | and TMP1, TMP1, TMP0 // idx = str->hash & tab->hmask
3172 | sll TMP0, TMP1, 5
3173 | sll TMP1, TMP1, 3
3174 | subu TMP1, TMP0, TMP1
3175 | addu NODE:TMP2, NODE:TMP2, TMP1 // node = tab->node + (idx*32-idx*8)
3176 | ldc1 f20, 0(RA)
3177 |1:
3178 | lw CARG1, offsetof(Node, key)+HI(NODE:TMP2)
3179 | lw TMP0, offsetof(Node, key)+LO(NODE:TMP2)
3180 | li AT, LJ_TSTR
3181 | lw NODE:TMP1, NODE:TMP2->next
3182 | bne CARG1, AT, >5
3183 |. lw CARG2, offsetof(Node, val)+HI(NODE:TMP2)
3184 | bne TMP0, STR:RC, >5
3185 |. lbu TMP3, TAB:RB->marked
3186 | beq CARG2, TISNIL, >4 // Key found, but nil value?
3187 |. lw TAB:TMP0, TAB:RB->metatable
3188 |2:
3189 | andi AT, TMP3, LJ_GC_BLACK // isblack(table)
3190 | bnez AT, >7
3191 |. sdc1 f20, NODE:TMP2->val
3192 |3:
3193 | ins_next
3194 |
3195 |4: // Check for __newindex if previous value is nil.
3196 | beqz TAB:TMP0, <2 // No metatable: done.
3197 |. nop
3198 | lbu TMP0, TAB:TMP0->nomm
3199 | andi TMP0, TMP0, 1<<MM_newindex
3200 | bnez TMP0, <2 // 'no __newindex' flag set: done.
3201 |. nop
3202 | b ->vmeta_tsets
3203 |. nop
3204 |
3205 |5: // Follow hash chain.
3206 | bnez NODE:TMP1, <1
3207 |. move NODE:TMP2, NODE:TMP1
3208 | // End of hash chain: key not found, add a new one
3209 |
3210 | // But check for __newindex first.
3211 | lw TAB:TMP2, TAB:RB->metatable
3212 | beqz TAB:TMP2, >6 // No metatable: continue.
3213 |. addiu CARG3, DISPATCH, DISPATCH_GL(tmptv)
3214 | lbu TMP0, TAB:TMP2->nomm
3215 | andi TMP0, TMP0, 1<<MM_newindex
3216 | beqz TMP0, ->vmeta_tsets // 'no __newindex' flag NOT set: check.
3217 |. li AT, LJ_TSTR
3218 |6:
3219 | load_got lj_tab_newkey
3220 | sw STR:RC, LO(CARG3)
3221 | sw AT, HI(CARG3)
3222 | sw BASE, L->base
3223 | move CARG2, TAB:RB
3224 | sw PC, SAVE_PC
3225 | call_intern lj_tab_newkey // (lua_State *L, GCtab *t, TValue *k
3226 |. move CARG1, L
3227 | // Returns TValue *.
3228 | lw BASE, L->base
3229 | b <3 // No 2nd write barrier needed.
3230 |. sdc1 f20, 0(CRET1)
3231 |
3232 |7: // Possible table write barrier for the value. Skip valiswhite check.
3233 | barrierback TAB:RB, TMP3, TMP0, <3
3234 break;
3235 case BC_TSETB:
3236 | // RA = src*8, RB = table*8, RC = index*8
3237 | decode_RB8a RB, INS
3238 | decode_RB8b RB
3239 | addu CARG2, BASE, RB
3240 | decode_RDtoRC8 RC, RD
3241 | lw CARG1, HI(CARG2)
3242 | li AT, LJ_TTAB
3243 | lw TAB:RB, LO(CARG2)
3244 | addu RA, BASE, RA
3245 | bne CARG1, AT, ->vmeta_tsetb
3246 |. srl TMP0, RC, 3
3247 | lw TMP1, TAB:RB->asize
3248 | lw TMP2, TAB:RB->array
3249 | sltu AT, TMP0, TMP1
3250 | beqz AT, ->vmeta_tsetb
3251 |. addu RC, TMP2, RC
3252 | lw TMP1, HI(RC)
3253 | lbu TMP3, TAB:RB->marked
3254 | beq TMP1, TISNIL, >5
3255 |. ldc1 f0, 0(RA)
3256 |1:
3257 | andi AT, TMP3, LJ_GC_BLACK // isblack(table)
3258 | bnez AT, >7
3259 |. sdc1 f0, 0(RC)
3260 |2:
3261 | ins_next
3262 |
3263 |5: // Check for __newindex if previous value is nil.
3264 | lw TAB:TMP2, TAB:RB->metatable
3265 | beqz TAB:TMP2, <1 // No metatable: done.
3266 |. nop
3267 | lbu TMP1, TAB:TMP2->nomm
3268 | andi TMP1, TMP1, 1<<MM_newindex
3269 | bnez TMP1, <1 // 'no __newindex' flag set: done.
3270 |. nop
3271 | b ->vmeta_tsetb // Caveat: preserve TMP0!
3272 |. nop
3273 |
3274 |7: // Possible table write barrier for the value. Skip valiswhite check.
3275 | barrierback TAB:RB, TMP3, TMP0, <2
3276 break;
3277
3278 case BC_TSETM:
3279 | // RA = base*8 (table at base-1), RD = num_const*8 (start index)
3280 | addu RA, BASE, RA
3281 |1:
3282 | addu TMP3, KBASE, RD
3283 | lw TAB:CARG2, -8+LO(RA) // Guaranteed to be a table.
3284 | addiu TMP0, MULTRES, -8
3285 | lw TMP3, LO(TMP3) // Integer constant is in lo-word.
3286 | beqz TMP0, >4 // Nothing to copy?
3287 |. srl CARG3, TMP0, 3
3288 | addu CARG3, CARG3, TMP3
3289 | lw TMP2, TAB:CARG2->asize
3290 | sll TMP1, TMP3, 3
3291 | lbu TMP3, TAB:CARG2->marked
3292 | lw CARG1, TAB:CARG2->array
3293 | sltu AT, TMP2, CARG3
3294 | bnez AT, >5
3295 |. addu TMP2, RA, TMP0
3296 | addu TMP1, TMP1, CARG1
3297 | andi TMP0, TMP3, LJ_GC_BLACK // isblack(table)
3298 |3: // Copy result slots to table.
3299 | ldc1 f0, 0(RA)
3300 | addiu RA, RA, 8
3301 | sltu AT, RA, TMP2
3302 | sdc1 f0, 0(TMP1)
3303 | bnez AT, <3
3304 |. addiu TMP1, TMP1, 8
3305 | bnez TMP0, >7
3306 |. nop
3307 |4:
3308 | ins_next
3309 |
3310 |5: // Need to resize array part.
3311 | load_got lj_tab_reasize
3312 | sw BASE, L->base
3313 | sw PC, SAVE_PC
3314 | move BASE, RD
3315 | call_intern lj_tab_reasize // (lua_State *L, GCtab *t, int nasize)
3316 |. move CARG1, L
3317 | // Must not reallocate the stack.
3318 | move RD, BASE
3319 | b <1
3320 |. lw BASE, L->base // Reload BASE for lack of a saved register.
3321 |
3322 |7: // Possible table write barrier for any value. Skip valiswhite check.
3323 | barrierback TAB:CARG2, TMP3, TMP0, <4
3324 break;
3325
3326 /* -- Calls and vararg handling ----------------------------------------- */
3327
3328 case BC_CALLM:
3329 | // RA = base*8, (RB = (nresults+1)*8,) RC = extra_nargs*8
3330 | decode_RDtoRC8 NARGS8:RC, RD
3331 | b ->BC_CALL_Z
3332 |. addu NARGS8:RC, NARGS8:RC, MULTRES
3333 break;
3334 case BC_CALL:
3335 | // RA = base*8, (RB = (nresults+1)*8,) RC = (nargs+1)*8
3336 | decode_RDtoRC8 NARGS8:RC, RD
3337 |->BC_CALL_Z:
3338 | move TMP2, BASE
3339 | addu BASE, BASE, RA
3340 | li AT, LJ_TFUNC
3341 | lw TMP0, HI(BASE)
3342 | lw LFUNC:RB, LO(BASE)
3343 | addiu BASE, BASE, 8
3344 | bne TMP0, AT, ->vmeta_call
3345 |. addiu NARGS8:RC, NARGS8:RC, -8
3346 | ins_call
3347 break;
3348
3349 case BC_CALLMT:
3350 | // RA = base*8, (RB = 0,) RC = extra_nargs*8
3351 | addu NARGS8:RD, NARGS8:RD, MULTRES // BC_CALLT gets RC from RD.
3352 | // Fall through. Assumes BC_CALLT follows.
3353 break;
3354 case BC_CALLT:
3355 | // RA = base*8, (RB = 0,) RC = (nargs+1)*8
3356 | addu RA, BASE, RA
3357 | li AT, LJ_TFUNC
3358 | lw TMP0, HI(RA)
3359 | lw LFUNC:RB, LO(RA)
3360 | move NARGS8:RC, RD
3361 | lw TMP1, FRAME_PC(BASE)
3362 | addiu RA, RA, 8
3363 | bne TMP0, AT, ->vmeta_callt
3364 |. addiu NARGS8:RC, NARGS8:RC, -8
3365 |->BC_CALLT_Z:
3366 | andi TMP0, TMP1, FRAME_TYPE // Caveat: preserve TMP0 until the 'or'.
3367 | lbu TMP3, LFUNC:RB->ffid
3368 | bnez TMP0, >7
3369 |. xori TMP2, TMP1, FRAME_VARG
3370 |1:
3371 | sw LFUNC:RB, FRAME_FUNC(BASE) // Copy function down, but keep PC.
3372 | sltiu AT, TMP3, 2 // (> FF_C) Calling a fast function?
3373 | move TMP2, BASE
3374 | beqz NARGS8:RC, >3
3375 |. move TMP3, NARGS8:RC
3376 |2:
3377 | ldc1 f0, 0(RA)
3378 | addiu RA, RA, 8
3379 | addiu TMP3, TMP3, -8
3380 | sdc1 f0, 0(TMP2)
3381 | bnez TMP3, <2
3382 |. addiu TMP2, TMP2, 8
3383 |3:
3384 | or TMP0, TMP0, AT
3385 | beqz TMP0, >5
3386 |. nop
3387 |4:
3388 | ins_callt
3389 |
3390 |5: // Tailcall to a fast function with a Lua frame below.
3391 | lw INS, -4(TMP1)
3392 | decode_RA8a RA, INS
3393 | decode_RA8b RA
3394 | subu TMP1, BASE, RA
3395 | lw LFUNC:TMP1, -8+FRAME_FUNC(TMP1)
3396 | lw TMP1, LFUNC:TMP1->pc
3397 | b <4
3398 |. lw KBASE, PC2PROTO(k)(TMP1) // Need to prepare KBASE.
3399 |
3400 |7: // Tailcall from a vararg function.
3401 | andi AT, TMP2, FRAME_TYPEP
3402 | bnez AT, <1 // Vararg frame below?
3403 |. subu TMP2, BASE, TMP2 // Relocate BASE down.
3404 | move BASE, TMP2
3405 | lw TMP1, FRAME_PC(TMP2)
3406 | b <1
3407 |. andi TMP0, TMP1, FRAME_TYPE
3408 break;
3409
3410 case BC_ITERC:
3411 | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 ((2+1)*8))
3412 | move TMP2, BASE
3413 | addu BASE, BASE, RA
3414 | li AT, LJ_TFUNC
3415 | lw TMP1, -24+HI(BASE)
3416 | lw LFUNC:RB, -24+LO(BASE)
3417 | ldc1 f2, -8(BASE)
3418 | ldc1 f0, -16(BASE)
3419 | sw TMP1, HI(BASE) // Copy callable.
3420 | sw LFUNC:RB, LO(BASE)
3421 | sdc1 f2, 16(BASE) // Copy control var.
3422 | sdc1 f0, 8(BASE) // Copy state.
3423 | addiu BASE, BASE, 8
3424 | bne TMP1, AT, ->vmeta_call
3425 |. li NARGS8:RC, 16 // Iterators get 2 arguments.
3426 | ins_call
3427 break;
3428
3429 case BC_ITERN:
3430 | // RA = base*8, (RB = (nresults+1)*8, RC = (nargs+1)*8 (2+1)*8)
3431#if LJ_HASJIT
3432 | // NYI: add hotloop, record BC_ITERN.
3433#endif
3434 | addu RA, BASE, RA
3435 | lw TAB:RB, -16+LO(RA)
3436 | lw RC, -8+LO(RA) // Get index from control var.
3437 | lw TMP0, TAB:RB->asize
3438 | lw TMP1, TAB:RB->array
3439 | addiu PC, PC, 4
3440 |1: // Traverse array part.
3441 | sltu AT, RC, TMP0
3442 | beqz AT, >5 // Index points after array part?
3443 |. sll TMP3, RC, 3
3444 | addu TMP3, TMP1, TMP3
3445 | lw TMP2, HI(TMP3)
3446 | ldc1 f0, 0(TMP3)
3447 | mtc1 RC, f2
3448 | lhu RD, -4+OFS_RD(PC)
3449 | beq TMP2, TISNIL, <1 // Skip holes in array part.
3450 |. addiu RC, RC, 1
3451 | cvt.d.w f2, f2
3452 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)
3453 | sdc1 f0, 8(RA)
3454 | decode_RD4b RD
3455 | addu RD, RD, TMP3
3456 | sw RC, -8+LO(RA) // Update control var.
3457 | addu PC, PC, RD
3458 | sdc1 f2, 0(RA)
3459 |3:
3460 | ins_next
3461 |
3462 |5: // Traverse hash part.
3463 | lw TMP1, TAB:RB->hmask
3464 | subu RC, RC, TMP0
3465 | lw TMP2, TAB:RB->node
3466 |6:
3467 | sltu AT, TMP1, RC // End of iteration? Branch to ITERL+1.
3468 | bnez AT, <3
3469 |. sll TMP3, RC, 5
3470 | sll RB, RC, 3
3471 | subu TMP3, TMP3, RB
3472 | addu NODE:TMP3, TMP3, TMP2
3473 | lw RB, HI(NODE:TMP3)
3474 | ldc1 f0, 0(NODE:TMP3)
3475 | lhu RD, -4+OFS_RD(PC)
3476 | beq RB, TISNIL, <6 // Skip holes in hash part.
3477 |. addiu RC, RC, 1
3478 | ldc1 f2, NODE:TMP3->key
3479 | lui TMP3, (-(BCBIAS_J*4 >> 16) & 65535)
3480 | sdc1 f0, 8(RA)
3481 | addu RC, RC, TMP0
3482 | decode_RD4b RD
3483 | addu RD, RD, TMP3
3484 | sdc1 f2, 0(RA)
3485 | addu PC, PC, RD
3486 | b <3
3487 |. sw RC, -8+LO(RA) // Update control var.
3488 break;
3489
3490 case BC_ISNEXT:
3491 | // RA = base*8, RD = target (points to ITERN)
3492 | addu RA, BASE, RA
3493 | lw TMP0, -24+HI(RA)
3494 | lw CFUNC:TMP1, -24+LO(RA)
3495 | lw TMP2, -16+HI(RA)
3496 | lw TMP3, -8+HI(RA)
3497 | li AT, LJ_TFUNC
3498 | bne TMP0, AT, >5
3499 |. addiu TMP2, TMP2, -LJ_TTAB
3500 | lbu TMP1, CFUNC:TMP1->ffid
3501 | addiu TMP3, TMP3, -LJ_TNIL
3502 | srl TMP0, RD, 1
3503 | or TMP2, TMP2, TMP3
3504 | addiu TMP1, TMP1, -FF_next_N
3505 | addu TMP0, PC, TMP0
3506 | or TMP1, TMP1, TMP2
3507 | bnez TMP1, >5
3508 |. lui TMP2, (-(BCBIAS_J*4 >> 16) & 65535)
3509 | addu PC, TMP0, TMP2
3510 | sw r0, -8+LO(RA) // Initialize control var.
3511 |1:
3512 | ins_next
3513 |5: // Despecialize bytecode if any of the checks fail.
3514 | li TMP3, BC_JMP
3515 | li TMP1, BC_ITERC
3516 | sb TMP3, -4+OFS_OP(PC)
3517 | addu PC, TMP0, TMP2
3518 | b <1
3519 |. sb TMP1, OFS_OP(PC)
3520 break;
3521
3522 case BC_VARG:
3523 | // RA = base*8, RB = (nresults+1)*8, RC = numparams*8
3524 | lw TMP0, FRAME_PC(BASE)
3525 | decode_RDtoRC8 RC, RD
3526 | decode_RB8a RB, INS
3527 | addu RC, BASE, RC
3528 | decode_RB8b RB
3529 | addu RA, BASE, RA
3530 | addiu RC, RC, FRAME_VARG
3531 | addu TMP2, RA, RB
3532 | addiu TMP3, BASE, -8 // TMP3 = vtop
3533 | subu RC, RC, TMP0 // RC = vbase
3534 | // Note: RC may now be even _above_ BASE if nargs was < numparams.
3535 | beqz RB, >5 // Copy all varargs?
3536 |. subu TMP1, TMP3, RC
3537 | addiu TMP2, TMP2, -16
3538 |1: // Copy vararg slots to destination slots.
3539 | lw CARG1, HI(RC)
3540 | sltu AT, RC, TMP3
3541 | lw CARG2, LO(RC)
3542 | addiu RC, RC, 8
3543 | movz CARG1, TISNIL, AT
3544 | sw CARG1, HI(RA)
3545 | sw CARG2, LO(RA)
3546 | sltu AT, RA, TMP2
3547 | bnez AT, <1
3548 |. addiu RA, RA, 8
3549 |3:
3550 | ins_next
3551 |
3552 |5: // Copy all varargs.
3553 | lw TMP0, L->maxstack
3554 | blez TMP1, <3 // No vararg slots?
3555 |. li MULTRES, 8 // MULTRES = (0+1)*8
3556 | addu TMP2, RA, TMP1
3557 | sltu AT, TMP0, TMP2
3558 | bnez AT, >7
3559 |. addiu MULTRES, TMP1, 8
3560 |6:
3561 | ldc1 f0, 0(RC)
3562 | addiu RC, RC, 8
3563 | sdc1 f0, 0(RA)
3564 | sltu AT, RC, TMP3
3565 | bnez AT, <6 // More vararg slots?
3566 |. addiu RA, RA, 8
3567 | b <3
3568 |. nop
3569 |
3570 |7: // Grow stack for varargs.
3571 | load_got lj_state_growstack
3572 | sw RA, L->top
3573 | subu RA, RA, BASE
3574 | sw BASE, L->base
3575 | subu BASE, RC, BASE // Need delta, because BASE may change.
3576 | sw PC, SAVE_PC
3577 | srl CARG2, TMP1, 3
3578 | call_intern lj_state_growstack // (lua_State *L, int n)
3579 |. move CARG1, L
3580 | move RC, BASE
3581 | lw BASE, L->base
3582 | addu RA, BASE, RA
3583 | addu RC, BASE, RC
3584 | b <6
3585 |. addiu TMP3, BASE, -8
3586 break;
3587
3588 /* -- Returns ----------------------------------------------------------- */
3589
3590 case BC_RETM:
3591 | // RA = results*8, RD = extra_nresults*8
3592 | addu RD, RD, MULTRES // MULTRES >= 8, so RD >= 8.
3593 | // Fall through. Assumes BC_RET follows.
3594 break;
3595
3596 case BC_RET:
3597 | // RA = results*8, RD = (nresults+1)*8
3598 | lw PC, FRAME_PC(BASE)
3599 | addu RA, BASE, RA
3600 | move MULTRES, RD
3601 |1:
3602 | andi TMP0, PC, FRAME_TYPE
3603 | bnez TMP0, ->BC_RETV_Z
3604 |. xori TMP1, PC, FRAME_VARG
3605 |
3606 |->BC_RET_Z:
3607 | // BASE = base, RA = resultptr, RD = (nresults+1)*8, PC = return
3608 | lw INS, -4(PC)
3609 | addiu TMP2, BASE, -8
3610 | addiu RC, RD, -8
3611 | decode_RA8a TMP0, INS
3612 | decode_RB8a RB, INS
3613 | decode_RA8b TMP0
3614 | decode_RB8b RB
3615 | addu TMP3, TMP2, RB
3616 | beqz RC, >3
3617 |. subu BASE, TMP2, TMP0
3618 |2:
3619 | ldc1 f0, 0(RA)
3620 | addiu RA, RA, 8
3621 | addiu RC, RC, -8
3622 | sdc1 f0, 0(TMP2)
3623 | bnez RC, <2
3624 |. addiu TMP2, TMP2, 8
3625 |3:
3626 | addiu TMP3, TMP3, -8
3627 |5:
3628 | sltu AT, TMP2, TMP3
3629 | bnez AT, >6
3630 |. lw LFUNC:TMP1, FRAME_FUNC(BASE)
3631 | ins_next1
3632 | lw TMP1, LFUNC:TMP1->pc
3633 | lw KBASE, PC2PROTO(k)(TMP1)
3634 | ins_next2
3635 |
3636 |6: // Fill up results with nil.
3637 | sw TISNIL, HI(TMP2)
3638 | b <5
3639 |. addiu TMP2, TMP2, 8
3640 |
3641 |->BC_RETV_Z: // Non-standard return case.
3642 | andi TMP2, TMP1, FRAME_TYPEP
3643 | bnez TMP2, ->vm_return
3644 |. nop
3645 | // Return from vararg function: relocate BASE down.
3646 | subu BASE, BASE, TMP1
3647 | b <1
3648 |. lw PC, FRAME_PC(BASE)
3649 break;
3650
3651 case BC_RET0: case BC_RET1:
3652 | // RA = results*8, RD = (nresults+1)*8
3653 | lw PC, FRAME_PC(BASE)
3654 | addu RA, BASE, RA
3655 | move MULTRES, RD
3656 | andi TMP0, PC, FRAME_TYPE
3657 | bnez TMP0, ->BC_RETV_Z
3658 |. xori TMP1, PC, FRAME_VARG
3659 |
3660 | lw INS, -4(PC)
3661 | addiu TMP2, BASE, -8
3662 if (op == BC_RET1) {
3663 | ldc1 f0, 0(RA)
3664 }
3665 | decode_RB8a RB, INS
3666 | decode_RA8a RA, INS
3667 | decode_RB8b RB
3668 | decode_RA8b RA
3669 if (op == BC_RET1) {
3670 | sdc1 f0, 0(TMP2)
3671 }
3672 | subu BASE, TMP2, RA
3673 |5:
3674 | sltu AT, RD, RB
3675 | bnez AT, >6
3676 |. lw LFUNC:TMP1, FRAME_FUNC(BASE)
3677 | ins_next1
3678 | lw TMP1, LFUNC:TMP1->pc
3679 | lw KBASE, PC2PROTO(k)(TMP1)
3680 | ins_next2
3681 |
3682 |6: // Fill up results with nil.
3683 | addiu TMP2, TMP2, 8
3684 | addiu RD, RD, 8
3685 | b <5
3686 if (op == BC_RET1) {
3687 |. sw TISNIL, HI(TMP2)
3688 } else {
3689 |. sw TISNIL, -8+HI(TMP2)
3690 }
3691 break;
3692
3693 /* -- Loops and branches ------------------------------------------------ */
3694
3695 case BC_FORL:
3696#if LJ_HASJIT
3697 | hotloop
3698#endif
3699 | // Fall through. Assumes BC_IFORL follows.
3700 break;
3701
3702 case BC_JFORI:
3703 case BC_JFORL:
3704#if !LJ_HASJIT
3705 break;
3706#endif
3707 case BC_FORI:
3708 case BC_IFORL:
3709 | // RA = base*8, RD = target (after end of loop or start of loop)
3710 vk = (op == BC_IFORL || op == BC_JFORL);
3711 | addu RA, BASE, RA
3712 if (vk) {
3713 | ldc1 f0, FORL_IDX*8(RA)
3714 | ldc1 f4, FORL_STEP*8(RA)
3715 | ldc1 f2, FORL_STOP*8(RA)
3716 | lw TMP3, FORL_STEP*8+HI(RA)
3717 | add.d f0, f0, f4
3718 | sdc1 f0, FORL_IDX*8(RA)
3719 } else {
3720 | lw TMP1, FORL_IDX*8+HI(RA)
3721 | lw TMP3, FORL_STEP*8+HI(RA)
3722 | lw TMP2, FORL_STOP*8+HI(RA)
3723 | sltiu TMP1, TMP1, LJ_TISNUM
3724 | sltiu TMP0, TMP3, LJ_TISNUM
3725 | sltiu TMP2, TMP2, LJ_TISNUM
3726 | and TMP1, TMP1, TMP0
3727 | and TMP1, TMP1, TMP2
3728 | ldc1 f0, FORL_IDX*8(RA)
3729 | beqz TMP1, ->vmeta_for
3730 |. ldc1 f2, FORL_STOP*8(RA)
3731 }
3732 if (op != BC_JFORL) {
3733 | srl RD, RD, 1
3734 | lui TMP0, (-(BCBIAS_J*4 >> 16) & 65535)
3735 }
3736 | c.le.d 0, f0, f2
3737 | c.le.d 1, f2, f0
3738 | sdc1 f0, FORL_EXT*8(RA)
3739 if (op == BC_JFORI) {
3740 | li TMP1, 1
3741 | li TMP2, 1
3742 | lw INS, -4(PC)
3743 | slt TMP3, TMP3, r0
3744 | movt TMP1, r0, 0
3745 | movt TMP2, r0, 1
3746 | addu PC, RD, TMP0
3747 | movn TMP1, TMP2, TMP3
3748 | decode_RD8a RD, INS
3749 | bnez TMP1, =>BC_JLOOP
3750 |. decode_RD8b RD
3751 } else if (op == BC_JFORL) {
3752 | li TMP1, 1
3753 | li TMP2, 1
3754 | slt TMP3, TMP3, r0
3755 | movf TMP1, r0, 0
3756 | movf TMP2, r0, 1
3757 | movn TMP1, TMP2, TMP3
3758 | bnez TMP1, =>BC_JLOOP
3759 |. nop
3760 } else {
3761 | addu TMP1, RD, TMP0
3762 | slt TMP3, TMP3, r0
3763 | move TMP2, TMP1
3764 if (op == BC_FORI) {
3765 | movt TMP1, r0, 0
3766 | movt TMP2, r0, 1
3767 } else {
3768 | movf TMP1, r0, 0
3769 | movf TMP2, r0, 1
3770 }
3771 | movn TMP1, TMP2, TMP3
3772 | addu PC, PC, TMP1
3773 }
3774 | ins_next
3775 break;
3776
3777 case BC_ITERL:
3778#if LJ_HASJIT
3779 | hotloop
3780#endif
3781 | // Fall through. Assumes BC_IITERL follows.
3782 break;
3783
3784 case BC_JITERL:
3785#if !LJ_HASJIT
3786 break;
3787#endif
3788 case BC_IITERL:
3789 | // RA = base*8, RD = target
3790 | addu RA, BASE, RA
3791 | lw TMP1, HI(RA)
3792 | beq TMP1, TISNIL, >1 // Stop if iterator returned nil.
3793 |. lw TMP2, LO(RA)
3794 if (op == BC_JITERL) {
3795 | sw TMP1, -8+HI(RA)
3796 | b =>BC_JLOOP
3797 |. sw TMP2, -8+LO(RA)
3798 } else {
3799 | branch_RD // Otherwise save control var + branch.
3800 | sw TMP1, -8+HI(RA)
3801 | sw TMP2, -8+LO(RA)
3802 }
3803 |1:
3804 | ins_next
3805 break;
3806
3807 case BC_LOOP:
3808 | // RA = base*8, RD = target (loop extent)
3809 | // Note: RA/RD is only used by trace recorder to determine scope/extent
3810 | // This opcode does NOT jump, it's only purpose is to detect a hot loop.
3811#if LJ_HASJIT
3812 | hotloop
3813#endif
3814 | // Fall through. Assumes BC_ILOOP follows.
3815 break;
3816
3817 case BC_ILOOP:
3818 | // RA = base*8, RD = target (loop extent)
3819 | ins_next
3820 break;
3821
3822 case BC_JLOOP:
3823#if LJ_HASJIT
3824 | // RA = base*8 (ignored), RD = traceno*8
3825 | lw TMP1, DISPATCH_J(trace)(DISPATCH)
3826 | srl RD, RD, 1
3827 | li AT, 0
3828 | addu TMP1, TMP1, RD
3829 | // Traces on MIPS don't store the trace number, so use 0.
3830 | sw AT, DISPATCH_GL(vmstate)(DISPATCH)
3831 | lw TRACE:TMP2, 0(TMP1)
3832 | sw BASE, DISPATCH_GL(jit_base)(DISPATCH)
3833 | sw L, DISPATCH_GL(jit_L)(DISPATCH)
3834 | lw TMP2, TRACE:TMP2->mcode
3835 | jr TMP2
3836 |. addiu JGL, DISPATCH, GG_DISP2G+32768
3837#endif
3838 break;
3839
3840 case BC_JMP:
3841 | // RA = base*8 (only used by trace recorder), RD = target
3842 | branch_RD
3843 | ins_next
3844 break;
3845
3846 /* -- Function headers -------------------------------------------------- */
3847
3848 case BC_FUNCF:
3849#if LJ_HASJIT
3850 | hotcall
3851#endif
3852 case BC_FUNCV: /* NYI: compiled vararg functions. */
3853 | // Fall through. Assumes BC_IFUNCF/BC_IFUNCV follow.
3854 break;
3855
3856 case BC_JFUNCF:
3857#if !LJ_HASJIT
3858 break;
3859#endif
3860 case BC_IFUNCF:
3861 | // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8
3862 | lw TMP2, L->maxstack
3863 | lbu TMP1, -4+PC2PROTO(numparams)(PC)
3864 | lw KBASE, -4+PC2PROTO(k)(PC)
3865 | sltu AT, TMP2, RA
3866 | bnez AT, ->vm_growstack_l
3867 |. sll TMP1, TMP1, 3
3868 if (op != BC_JFUNCF) {
3869 | ins_next1
3870 }
3871 |2:
3872 | sltu AT, NARGS8:RC, TMP1 // Check for missing parameters.
3873 | bnez AT, >3
3874 |. addu AT, BASE, NARGS8:RC
3875 if (op == BC_JFUNCF) {
3876 | decode_RD8a RD, INS
3877 | b =>BC_JLOOP
3878 |. decode_RD8b RD
3879 } else {
3880 | ins_next2
3881 }
3882 |
3883 |3: // Clear missing parameters.
3884 | sw TISNIL, HI(AT)
3885 | b <2
3886 |. addiu NARGS8:RC, NARGS8:RC, 8
3887 break;
3888
3889 case BC_JFUNCV:
3890#if !LJ_HASJIT
3891 break;
3892#endif
3893 | NYI // NYI: compiled vararg functions
3894 break; /* NYI: compiled vararg functions. */
3895
3896 case BC_IFUNCV:
3897 | // BASE = new base, RA = BASE+framesize*8, RB = LFUNC, RC = nargs*8
3898 | addu TMP1, BASE, RC
3899 | lw TMP2, L->maxstack
3900 | addu TMP0, RA, RC
3901 | sw LFUNC:RB, LO(TMP1) // Store copy of LFUNC.
3902 | addiu TMP3, RC, 8+FRAME_VARG
3903 | sltu AT, TMP0, TMP2
3904 | lw KBASE, -4+PC2PROTO(k)(PC)
3905 | beqz AT, ->vm_growstack_l
3906 |. sw TMP3, HI(TMP1) // Store delta + FRAME_VARG.
3907 | lbu TMP2, -4+PC2PROTO(numparams)(PC)
3908 | move RA, BASE
3909 | move RC, TMP1
3910 | ins_next1
3911 | beqz TMP2, >3
3912 |. addiu BASE, TMP1, 8
3913 |1:
3914 | lw TMP0, HI(RA)
3915 | lw TMP3, LO(RA)
3916 | sltu AT, RA, RC // Less args than parameters?
3917 | move CARG1, TMP0
3918 | movz TMP0, TISNIL, AT // Clear missing parameters.
3919 | movn CARG1, TISNIL, AT // Clear old fixarg slot (help the GC).
3920 | sw TMP3, 8+LO(TMP1)
3921 | addiu TMP2, TMP2, -1
3922 | sw TMP0, 8+HI(TMP1)
3923 | addiu TMP1, TMP1, 8
3924 | sw CARG1, HI(RA)
3925 | bnez TMP2, <1
3926 |. addiu RA, RA, 8
3927 |3:
3928 | ins_next2
3929 break;
3930
3931 case BC_FUNCC:
3932 case BC_FUNCCW:
3933 | // BASE = new base, RA = BASE+framesize*8, RB = CFUNC, RC = nargs*8
3934 if (op == BC_FUNCC) {
3935 | lw CFUNCADDR, CFUNC:RB->f
3936 } else {
3937 | lw CFUNCADDR, DISPATCH_GL(wrapf)(DISPATCH)
3938 }
3939 | addu TMP1, RA, NARGS8:RC
3940 | lw TMP2, L->maxstack
3941 | addu RC, BASE, NARGS8:RC
3942 | sw BASE, L->base
3943 | sltu AT, TMP2, TMP1
3944 | sw RC, L->top
3945 | li_vmstate C
3946 if (op == BC_FUNCCW) {
3947 | lw CARG2, CFUNC:RB->f
3948 }
3949 | bnez AT, ->vm_growstack_c // Need to grow stack.
3950 |. move CARG1, L
3951 | jalr CFUNCADDR // (lua_State *L [, lua_CFunction f])
3952 |. st_vmstate
3953 | // Returns nresults.
3954 | lw BASE, L->base
3955 | sll RD, CRET1, 3
3956 | lw TMP1, L->top
3957 | li_vmstate INTERP
3958 | lw PC, FRAME_PC(BASE) // Fetch PC of caller.
3959 | subu RA, TMP1, RD // RA = L->top - nresults*8
3960 | b ->vm_returnc
3961 |. st_vmstate
3962 break;
3963
3964 /* ---------------------------------------------------------------------- */
3965
3966 default:
3967 fprintf(stderr, "Error: undefined opcode BC_%s\n", bc_names[op]);
3968 exit(2);
3969 break;
3970 }
3971}
3972
3973static int build_backend(BuildCtx *ctx)
3974{
3975 int op;
3976
3977 dasm_growpc(Dst, BC__MAX);
3978
3979 build_subroutines(ctx);
3980
3981 |.code_op
3982 for (op = 0; op < BC__MAX; op++)
3983 build_ins(ctx, (BCOp)op, op);
3984
3985 return BC__MAX;
3986}
3987
3988/* Emit pseudo frame-info for all assembler functions. */
3989static void emit_asm_debug(BuildCtx *ctx)
3990{
3991 int fcofs = (int)((uint8_t *)ctx->glob[GLOB_vm_ffi_call] - ctx->code);
3992 int i;
3993 switch (ctx->mode) {
3994 case BUILD_elfasm:
3995 fprintf(ctx->fp, "\t.section .debug_frame,\"\",@progbits\n");
3996 fprintf(ctx->fp,
3997 ".Lframe0:\n"
3998 "\t.4byte .LECIE0-.LSCIE0\n"
3999 ".LSCIE0:\n"
4000 "\t.4byte 0xffffffff\n"
4001 "\t.byte 0x1\n"
4002 "\t.string \"\"\n"
4003 "\t.uleb128 0x1\n"
4004 "\t.sleb128 -4\n"
4005 "\t.byte 31\n"
4006 "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 0\n"
4007 "\t.align 2\n"
4008 ".LECIE0:\n\n");
4009 fprintf(ctx->fp,
4010 ".LSFDE0:\n"
4011 "\t.4byte .LEFDE0-.LASFDE0\n"
4012 ".LASFDE0:\n"
4013 "\t.4byte .Lframe0\n"
4014 "\t.4byte .Lbegin\n"
4015 "\t.4byte %d\n"
4016 "\t.byte 0xe\n\t.uleb128 %d\n"
4017 "\t.byte 0x9f\n\t.sleb128 1\n"
4018 "\t.byte 0x9e\n\t.sleb128 2\n",
4019 fcofs, CFRAME_SIZE);
4020 for (i = 23; i >= 16; i--)
4021 fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+i, 26-i);
4022 for (i = 30; i >= 20; i -= 2)
4023 fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+32+i, 42-i);
4024 fprintf(ctx->fp,
4025 "\t.align 2\n"
4026 ".LEFDE0:\n\n");
4027#if LJ_HASFFI
4028 fprintf(ctx->fp,
4029 ".LSFDE1:\n"
4030 "\t.4byte .LEFDE1-.LASFDE1\n"
4031 ".LASFDE1:\n"
4032 "\t.4byte .Lframe0\n"
4033 "\t.4byte lj_vm_ffi_call\n"
4034 "\t.4byte %d\n"
4035 "\t.byte 0x9f\n\t.uleb128 1\n"
4036 "\t.byte 0x90\n\t.uleb128 2\n"
4037 "\t.byte 0xd\n\t.uleb128 0x10\n"
4038 "\t.align 2\n"
4039 ".LEFDE1:\n\n", (int)ctx->codesz - fcofs);
4040#endif
4041 fprintf(ctx->fp, "\t.section .eh_frame,\"aw\",@progbits\n");
4042 fprintf(ctx->fp,
4043 "\t.globl lj_err_unwind_dwarf\n"
4044 ".Lframe1:\n"
4045 "\t.4byte .LECIE1-.LSCIE1\n"
4046 ".LSCIE1:\n"
4047 "\t.4byte 0\n"
4048 "\t.byte 0x1\n"
4049 "\t.string \"zPR\"\n"
4050 "\t.uleb128 0x1\n"
4051 "\t.sleb128 -4\n"
4052 "\t.byte 31\n"
4053 "\t.uleb128 6\n" /* augmentation length */
4054 "\t.byte 0\n"
4055 "\t.4byte lj_err_unwind_dwarf\n"
4056 "\t.byte 0\n"
4057 "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 0\n"
4058 "\t.align 2\n"
4059 ".LECIE1:\n\n");
4060 fprintf(ctx->fp,
4061 ".LSFDE2:\n"
4062 "\t.4byte .LEFDE2-.LASFDE2\n"
4063 ".LASFDE2:\n"
4064 "\t.4byte .LASFDE2-.Lframe1\n"
4065 "\t.4byte .Lbegin\n"
4066 "\t.4byte %d\n"
4067 "\t.uleb128 0\n" /* augmentation length */
4068 "\t.byte 0xe\n\t.uleb128 %d\n"
4069 "\t.byte 0x9f\n\t.sleb128 1\n"
4070 "\t.byte 0x9e\n\t.sleb128 2\n",
4071 fcofs, CFRAME_SIZE);
4072 for (i = 23; i >= 16; i--)
4073 fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+i, 26-i);
4074 for (i = 30; i >= 20; i -= 2)
4075 fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+32+i, 42-i);
4076 fprintf(ctx->fp,
4077 "\t.align 2\n"
4078 ".LEFDE2:\n\n");
4079#if LJ_HASFFI
4080 fprintf(ctx->fp,
4081 ".Lframe2:\n"
4082 "\t.4byte .LECIE2-.LSCIE2\n"
4083 ".LSCIE2:\n"
4084 "\t.4byte 0\n"
4085 "\t.byte 0x1\n"
4086 "\t.string \"zR\"\n"
4087 "\t.uleb128 0x1\n"
4088 "\t.sleb128 -4\n"
4089 "\t.byte 31\n"
4090 "\t.uleb128 1\n" /* augmentation length */
4091 "\t.byte 0\n"
4092 "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 0\n"
4093 "\t.align 2\n"
4094 ".LECIE2:\n\n");
4095 fprintf(ctx->fp,
4096 ".LSFDE3:\n"
4097 "\t.4byte .LEFDE3-.LASFDE3\n"
4098 ".LASFDE3:\n"
4099 "\t.4byte .LASFDE3-.Lframe2\n"
4100 "\t.4byte lj_vm_ffi_call\n"
4101 "\t.4byte %d\n"
4102 "\t.uleb128 0\n" /* augmentation length */
4103 "\t.byte 0x9f\n\t.uleb128 1\n"
4104 "\t.byte 0x90\n\t.uleb128 2\n"
4105 "\t.byte 0xd\n\t.uleb128 0x10\n"
4106 "\t.align 2\n"
4107 ".LEFDE3:\n\n", (int)ctx->codesz - fcofs);
4108#endif
4109 break;
4110 default:
4111 break;
4112 }
4113}
4114
diff --git a/src/buildvm_mips.h b/src/buildvm_mips.h
new file mode 100644
index 00000000..948f7d49
--- /dev/null
+++ b/src/buildvm_mips.h
@@ -0,0 +1,7245 @@
1/*
2** This file has been pre-processed with DynASM.
3** http://luajit.org/dynasm.html
4** DynASM version 1.3.0, DynASM mips version 1.3.0
5** DO NOT EDIT! The original file is in "buildvm_mips.dasc".
6*/
7
8#if DASM_VERSION != 10300
9#error "Version mismatch between DynASM and included encoding engine"
10#endif
11
12#define DASM_SECTION_CODE_OP 0
13#define DASM_SECTION_CODE_SUB 1
14#define DASM_MAXSECTION 2
15static const unsigned int build_actionlist[6076] = {
160xff010001,
170xff060014,
180x32410000,
190xff090200,
200x10200000,
210xff050815,
220x240d0000,
230xff098200,
240x8dd20000,
250xff098200,
260x01c08021,
270xaeed0000,
280xff098200,
290x26f7fff8,
300xff060016,
310x324c0000,
320xff090200,
330x254a0008,
340x11800000,
350xff050817,
360x0140a821,
370xff060018,
380x240efff8,
390x39810000,
400xff090200,
410x024e7024,
420x14200000,
430xff050814,
440x020e7023,
450x254dfff8,
460xae8e0000,
470xff098200,
480x240c0000,
490xff098200,
500x8fae0078,
510x2610fff8,
520xae6c0000,
530xff098200,
540x11a00000,
550xff050802,
560x000e70c0,
570xff06000b,
580x25adfff8,
590xd6e00000,
600x26f70008,
610xf6000000,
620x15a00000,
630xff05080b,
640x26100008,
650xff06000c,
660x15ca0000,
670xff050806,
680xff06000d,
690xae900000,
700xff098200,
710xff060019,
720xff000000,
730x8fac0074,
740x00001021,
750xae8c0000,
760xff098200,
770xff06001a,
780x8fbf0000,
790xff098200,
800x8fbe0000,
810xff098200,
820xd7be0000,
830xff098200,
840x8fb70000,
850xff098200,
860x8fb60000,
870xff098200,
880xd7bc0000,
890xff098200,
900x8fb50000,
910xff098200,
920x8fb40000,
930xff098200,
940xd7ba0000,
950xff098200,
960x8fb30000,
970xff098200,
980x8fb20000,
990xff098200,
1000xd7b80000,
1010xff098200,
1020x8fb10000,
1030xff098200,
1040x8fb00000,
1050xff098200,
1060xd7b60000,
1070xff098200,
1080xd7b40000,
1090xff098200,
1100x03e00008,
1110x27bd0070,
1120xff060010,
1130x8e8d0000,
1140xff098200,
1150x01ca082a,
1160x14200000,
1170xff050807,
1180x020d082a,
1190x10200000,
1200xff050808,
1210x00000000,
1220xae1e0000,
1230xff098200,
1240xff000000,
1250x254a0008,
1260x10000000,
1270xff05080c,
1280x26100008,
1290xff060011,
1300x014e6023,
1310x020c6023,
1320x10000000,
1330xff05080d,
1340x018e800b,
1350xff060012,
1360x8e790000,
1370xff098200,
1380x0140a821,
1390x01c02821,
1400x0320f809,
1410x02802021,
1420x8fae0078,
1430x8e900000,
1440xff098200,
1450x02a05021,
1460x10000000,
1470xff05080c,
1480x000e70c0,
1490xff06001b,
1500x0080e821,
1510x00a01021,
1520xff06001c,
1530x8fb40070,
1540x240c0000,
1550xff098200,
1560x8e8d0000,
1570xff098200,
1580x10000000,
1590xff05081a,
1600xadac0000,
1610xff098200,
1620xff06001d,
1630x2401fffc,
1640x0081e824,
1650xff06001e,
1660x8fb40070,
1670x3c0f59c0,
1680x241e0000,
1690xff098200,
1700x8e900000,
1710xff098200,
1720x8e930000,
1730xff098200,
1740x448ff000,
1750x240d0000,
1760xff098200,
1770x240c0000,
1780xff098200,
1790x8e120000,
1800xff098200,
1810x4600f7a1,
1820x2617fff8,
1830x26730000,
1840xff098200,
1850xaeed0000,
1860xff098200,
1870xff000000,
1880xae6c0000,
1890xff098200,
1900x10000000,
1910xff050816,
1920x240a0010,
1930xff06001f,
1940x10000000,
1950xff050802,
1960x24050000,
1970xff098200,
1980xff060020,
1990x02094821,
2000x02f0b823,
2010xae900000,
2020xff098200,
2030x26520004,
2040xae890000,
2050xff098200,
2060x001728c2,
2070xff06000c,
2080x8e790000,
2090xff098200,
2100xafb20014,
2110x0320f809,
2120x02802021,
2130x8e900000,
2140xff098200,
2150x8e890000,
2160xff098200,
2170x8e080000,
2180xff098200,
2190x01304823,
2200x8d120000,
2210xff098200,
2220x8e4b0000,
2230x26520004,
2240x316d00ff,
2250x000bb942,
2260x000d6880,
2270x32f707f8,
2280x026d6021,
2290x8d8c0000,
2300x01800008,
2310x02f0b821,
2320xff060021,
2330x27bdff90,
2340xafbf0000,
2350xff098200,
2360xafbe0000,
2370xff098200,
2380xf7be0000,
2390xff098200,
2400xafb70000,
2410xff098200,
2420xafb60000,
2430xff098200,
2440xf7bc0000,
2450xff098200,
2460xafb50000,
2470xff098200,
2480xafb40000,
2490xff098200,
2500xff000000,
2510xf7ba0000,
2520xff098200,
2530xafb30000,
2540xff098200,
2550xafb20000,
2560xff098200,
2570xf7b80000,
2580xff098200,
2590xafb10000,
2600xff098200,
2610xafb00000,
2620xff098200,
2630xf7b60000,
2640xff098200,
2650xf7b40000,
2660xff098200,
2670x0080a021,
2680x8e930000,
2690xff098200,
2700x00a08021,
2710x928d0000,
2720xff098200,
2730xafb40070,
2740x24120000,
2750xff098200,
2760x27ac0000,
2770xff098200,
2780x26730000,
2790xff098200,
2800xafa00078,
2810xafa0007c,
2820xae8c0000,
2830xff098200,
2840xafa00074,
2850x11a00000,
2860xff050803,
2870xafa40014,
2880x0200b821,
2890x8e900000,
2900xff098200,
2910x8e8d0000,
2920xff098200,
2930x8e120000,
2940xff098200,
2950x3c0f59c0,
2960x01b05023,
2970x448ff000,
2980xa2800000,
2990xff098200,
3000x4600f7a1,
3010x240c0000,
3020xff098200,
3030x254a0008,
3040xae6c0000,
3050xff098200,
3060x0140a821,
3070x324c0000,
3080xff090200,
3090x11800000,
3100xff050817,
3110xff000000,
3120x241e0000,
3130xff098200,
3140x10000000,
3150xff050818,
3160x00000000,
3170xff060022,
3180x27bdff90,
3190xafbf0000,
3200xff098200,
3210xafbe0000,
3220xff098200,
3230xf7be0000,
3240xff098200,
3250xafb70000,
3260xff098200,
3270xafb60000,
3280xff098200,
3290xf7bc0000,
3300xff098200,
3310xafb50000,
3320xff098200,
3330xafb40000,
3340xff098200,
3350xf7ba0000,
3360xff098200,
3370xafb30000,
3380xff098200,
3390xafb20000,
3400xff098200,
3410xf7b80000,
3420xff098200,
3430xafb10000,
3440xff098200,
3450xafb00000,
3460xff098200,
3470xf7b60000,
3480xff098200,
3490xf7b40000,
3500xff098200,
3510xafa7007c,
3520x10000000,
3530xff050801,
3540x24120000,
3550xff098200,
3560xff060023,
3570x27bdff90,
3580xafbf0000,
3590xff098200,
3600xff000000,
3610xafbe0000,
3620xff098200,
3630xf7be0000,
3640xff098200,
3650xafb70000,
3660xff098200,
3670xafb60000,
3680xff098200,
3690xf7bc0000,
3700xff098200,
3710xafb50000,
3720xff098200,
3730xafb40000,
3740xff098200,
3750xf7ba0000,
3760xff098200,
3770xafb30000,
3780xff098200,
3790xafb20000,
3800xff098200,
3810xf7b80000,
3820xff098200,
3830xafb10000,
3840xff098200,
3850xafb00000,
3860xff098200,
3870xf7b60000,
3880xff098200,
3890xf7b40000,
3900xff098200,
3910x24120000,
3920xff098200,
3930xff06000b,
3940x8c8d0000,
3950xff098200,
3960xafa60078,
3970x0080a021,
3980xafa40070,
3990x00a08021,
4000xae9d0000,
4010xff098200,
4020x8e930000,
4030xff098200,
4040xafa40014,
4050xafad0074,
4060x26730000,
4070xff098200,
4080xff06000d,
4090x8e8e0000,
4100xff098200,
4110xff000000,
4120x3c0f59c0,
4130x8e8d0000,
4140xff098200,
4150x448ff000,
4160x02509021,
4170x01b04823,
4180x024e9023,
4190x4600f7a1,
4200x240c0000,
4210xff098200,
4220x241e0000,
4230xff098200,
4240xae6c0000,
4250xff098200,
4260xff060024,
4270x8e0c0000,
4280xff098200,
4290x24010000,
4300xff098200,
4310x15810000,
4320xff050825,
4330x8e080000,
4340xff098200,
4350xff060026,
4360xae120000,
4370xff098200,
4380x8d120000,
4390xff098200,
4400x8e4b0000,
4410x26520004,
4420x316d00ff,
4430x000bb942,
4440x000d6880,
4450x32f707f8,
4460x026d6021,
4470x8d8c0000,
4480x01800008,
4490x02f0b821,
4500xff060027,
4510x27bdff90,
4520xafbf0000,
4530xff098200,
4540xafbe0000,
4550xff098200,
4560xf7be0000,
4570xff098200,
4580xafb70000,
4590xff098200,
4600xafb60000,
4610xff098200,
4620xf7bc0000,
4630xff098200,
4640xafb50000,
4650xff098200,
4660xafb40000,
4670xff098200,
4680xf7ba0000,
4690xff098200,
4700xafb30000,
4710xff098200,
4720xff000000,
4730xafb20000,
4740xff098200,
4750xf7b80000,
4760xff098200,
4770xafb10000,
4780xff098200,
4790xafb00000,
4800xff098200,
4810xf7b60000,
4820xff098200,
4830xf7b40000,
4840xff098200,
4850x0080a021,
4860x8c8c0000,
4870xff098200,
4880xafa40070,
4890x8e8d0000,
4900xff098200,
4910xafa40014,
4920x018d6023,
4930x8e8d0000,
4940xff098200,
4950xae9d0000,
4960xff098200,
4970xafac0078,
4980xafa0007c,
4990x00e0c821,
5000x00e0f809,
5010xafad0074,
5020x00408021,
5030x8e930000,
5040xff098200,
5050x24120000,
5060xff098200,
5070x14400000,
5080xff05080d,
5090x26730000,
5100xff098200,
5110x10000000,
5120xff050819,
5130x00000000,
5140xff060015,
5150x8e0c0000,
5160xff098200,
5170x02004021,
5180x01c08021,
5190x8dcd0000,
5200xff098200,
5210xff000000,
5220x2d810002,
5230xff000000,
5240x8d120000,
5250xff098200,
5260x02ea7021,
5270x8dad0000,
5280xff098200,
5290xff000000,
5300x14200000,
5310xff050801,
5320xff000000,
5330xadde0000,
5340xff098200,
5350x01800008,
5360x8db10000,
5370xff098200,
5380xff000000,
5390xff06000b,
5400x15800000,
5410xff050828,
5420x250dfff0,
5430x10000000,
5440xff050829,
5450x01b04823,
5460xff000000,
5470xff06002a,
5480x8e4bfffc,
5490x2505fff0,
5500xd6e00000,
5510x000bad42,
5520x000bb942,
5530x32b507f8,
5540x32f707f8,
5550x02156821,
5560xae900000,
5570xff098200,
5580x00ad3023,
5590x15a50000,
5600xff05082b,
5610xf4a00000,
5620x0217b821,
5630x10000000,
5640xff05082c,
5650xf6e00000,
5660xff06002d,
5670x26660000,
5680xff098200,
5690x240c0000,
5700xff098200,
5710xacc90000,
5720xff098200,
5730x10000000,
5740xff050801,
5750xaccc0000,
5760xff098200,
5770xff06002e,
5780x26650000,
5790xff098200,
5800x240c0000,
5810xff098200,
5820xaca80000,
5830xff098200,
5840x26660000,
5850xff098200,
5860xacac0000,
5870xff098200,
5880x240d0000,
5890xff098200,
5900xacc90000,
5910xff098200,
5920x10000000,
5930xff050801,
5940xaccd0000,
5950xff098200,
5960xff06002f,
5970x448c0000,
5980x46800021,
5990x26660000,
6000xff098200,
6010xf4c00000,
6020xff060030,
6030xff06000b,
6040xff000000,
6050x8e790000,
6060xff098200,
6070xae900000,
6080xff098200,
6090xafb20014,
6100x0320f809,
6110x02802021,
6120x10400000,
6130xff050803,
6140x260d0000,
6150xff098200,
6160xd4400000,
6170x8e4b0000,
6180x26520004,
6190xf6e00000,
6200x316d00ff,
6210x000d6880,
6220x026d6021,
6230x000b5402,
6240x8d810000,
6250x000bb942,
6260x000a50c0,
6270x00200008,
6280x32f707f8,
6290xff06000d,
6300x8e900000,
6310xff098200,
6320xae120000,
6330xff098200,
6340x020d9023,
6350x8e080000,
6360xff098200,
6370x10000000,
6380xff050826,
6390x24090010,
6400xff060031,
6410x26660000,
6420xff098200,
6430x240c0000,
6440xff098200,
6450xacc90000,
6460xff098200,
6470x10000000,
6480xff050801,
6490xaccc0000,
6500xff098200,
6510xff060032,
6520x26650000,
6530xff098200,
6540x240c0000,
6550xff098200,
6560xaca80000,
6570xff098200,
6580x26660000,
6590xff098200,
6600xacac0000,
6610xff098200,
6620x240d0000,
6630xff098200,
6640xacc90000,
6650xff098200,
6660xff000000,
6670x10000000,
6680xff050801,
6690xaccd0000,
6700xff098200,
6710xff060033,
6720x448c0000,
6730x46800021,
6740x26660000,
6750xff098200,
6760xf4c00000,
6770xff060034,
6780xff06000b,
6790x8e790000,
6800xff098200,
6810xae900000,
6820xff098200,
6830xafb20014,
6840x0320f809,
6850x02802021,
6860x10400000,
6870xff050803,
6880xd6e00000,
6890x8e4b0000,
6900x26520004,
6910xf4400000,
6920x316d00ff,
6930x000d6880,
6940x026d6021,
6950x000b5402,
6960x8d810000,
6970x000bb942,
6980x000a50c0,
6990x00200008,
7000x32f707f8,
7010xff06000d,
7020x260d0000,
7030xff098200,
7040x8e900000,
7050xff098200,
7060xae120000,
7070xff098200,
7080x020d9023,
7090x8e080000,
7100xff098200,
7110xf6000010,
7120x10000000,
7130xff050826,
7140x24090018,
7150xff060035,
7160x8e790000,
7170xff098200,
7180x2652fffc,
7190xae900000,
7200xff098200,
7210xafb20014,
7220x316700ff,
7230x0320f809,
7240x02802021,
7250xff06000d,
7260x2c410002,
7270x10200000,
7280xff050836,
7290x00027023,
7300xff06000e,
7310x964a0000,
7320xff098200,
7330x26520004,
7340x3c0d0000,
7350xff090200,
7360xff000000,
7370x000a5080,
7380x014d5021,
7390x014e5024,
7400x024a9021,
7410xff06002c,
7420x8e4b0000,
7430x26520004,
7440x316d00ff,
7450x000d6880,
7460x026d6021,
7470x000b5402,
7480x8d810000,
7490x000bb942,
7500x000a50c0,
7510x00200008,
7520x32f707f8,
7530xff060037,
7540x924d0000,
7550xff098200,
7560xd6e00000,
7570x000d68c0,
7580x020d6821,
7590x10000000,
7600xff05082c,
7610xf5a00000,
7620xff060038,
7630x8eec0000,
7640xff098200,
7650x2d810000,
7660xff098200,
7670x10000000,
7680xff05080e,
7690x00017023,
7700xff060039,
7710x8eec0000,
7720xff098200,
7730x2d810000,
7740xff098200,
7750x10000000,
7760xff05080e,
7770x242effff,
7780xff06003a,
7790x8e790000,
7800xff098200,
7810x2652fffc,
7820xae900000,
7830xff098200,
7840xafb20014,
7850x0320f809,
7860x02802021,
7870x10000000,
7880xff05080d,
7890x00000000,
7900xff06003b,
7910xff000000,
7920x8e790000,
7930xff098200,
7940x01602821,
7950x2652fffc,
7960xae900000,
7970xff098200,
7980xafb20014,
7990x0320f809,
8000x02802021,
8010x10000000,
8020xff05080d,
8030x00000000,
8040xff000000,
8050xff06003c,
8060x00c03821,
8070xff06003d,
8080x8e790000,
8090xff098200,
8100x316c00ff,
8110xae900000,
8120xff098200,
8130xafb20014,
8140x02e02821,
8150xafac0010,
8160x0320f809,
8170x02802021,
8180x10400000,
8190xff05082c,
8200x00000000,
8210xff060036,
8220x00506823,
8230xac520000,
8240xff098200,
8250x02007021,
8260x25b20000,
8270xff098200,
8280x00408021,
8290x10000000,
8300xff050824,
8310x24090010,
8320xff06003e,
8330xff000000,
8340x0080a821,
8350xff000000,
8360x8e790000,
8370xff098200,
8380xae900000,
8390xff098200,
8400xafb20014,
8410x0320f809,
8420x02802021,
8430xff000000,
8440x14400000,
8450xff050836,
8460x00000000,
8470x10000000,
8480xff05083f,
8490x02a02021,
8500xff000000,
8510x10000000,
8520xff050836,
8530x00000000,
8540xff000000,
8550xff060025,
8560x8e790000,
8570xff098200,
8580xae8e0000,
8590xff098200,
8600x2605fff8,
8610xafb20014,
8620x02093021,
8630x0120a821,
8640x0320f809,
8650x02802021,
8660x8e080000,
8670xff098200,
8680x26a90008,
8690xae120000,
8700xff098200,
8710x8d120000,
8720xff098200,
8730x8e4b0000,
8740x26520004,
8750x316d00ff,
8760x000bb942,
8770x000d6880,
8780x32f707f8,
8790x026d6021,
8800x8d8c0000,
8810x01800008,
8820x02f0b821,
8830xff060040,
8840x8e790000,
8850xff098200,
8860xae900000,
8870xff098200,
8880x26e5fff8,
8890xafb20014,
8900x02e93021,
8910x0120a821,
8920x0320f809,
8930x02802021,
8940x8e0d0000,
8950xff098200,
8960x8ee80000,
8970xff098200,
8980x10000000,
8990xff050841,
9000x26a90008,
9010xff060042,
9020x8e790000,
9030xff098200,
9040xae900000,
9050xff098200,
9060x02e02821,
9070xafb20014,
9080x0160a821,
9090x0320f809,
9100x02802021,
9110xff000000,
9120x32ac00ff,
9130x24010000,
9140xff098200,
9150xff000000,
9160x0015b942,
9170x00155402,
9180x32f707f8,
9190xff000000,
9200x11810000,
9210xff070800,
9220x000a50c0,
9230x10000000,
9240xff070800,
9250x00000000,
9260xff000000,
9270x10000000,
9280xff070800,
9290x000a50c0,
9300xff000000,
9310xff060043,
9320x11200000,
9330xff050844,
9340x8e060000,
9350xff098200,
9360x8e040000,
9370xff098200,
9380x2cc10000,
9390xff098200,
9400x10200000,
9410xff050844,
9420x2617fff8,
9430x8e120000,
9440xff098200,
9450x252a0008,
9460x02e97021,
9470xaee60000,
9480xff098200,
9490x260d0008,
9500x120e0000,
9510xff050845,
9520xaee40000,
9530xff098200,
9540xff06000b,
9550xd5a00000,
9560xf5a0fff8,
9570x15ae0000,
9580xff05080b,
9590x25ad0008,
9600x10000000,
9610xff050845,
9620x00000000,
9630xff060046,
9640x8e060000,
9650xff098200,
9660x240d0000,
9670xff098200,
9680x11200000,
9690xff050844,
9700x2ccc0000,
9710xff098200,
9720x00cc680a,
9730x01a06827,
9740x000d68c0,
9750x010d6821,
9760x10000000,
9770xff050847,
9780xd5a00000,
9790xff098200,
9800xff060048,
9810x11200000,
9820xff050844,
9830x8e060000,
9840xff098200,
9850xff000000,
9860x8e040000,
9870xff098200,
9880x24010000,
9890xff098200,
9900x14c10000,
9910xff050806,
9920x24010000,
9930xff098200,
9940xff06000b,
9950x8c840000,
9960xff098200,
9970xff06000c,
9980x8e690000,
9990xff098200,
10000x10800000,
10010xff050849,
10020x24060000,
10030xff098200,
10040x8c8c0000,
10050xff098200,
10060x24060000,
10070xff098200,
10080x8d2d0000,
10090xff098200,
10100x8c8e0000,
10110xff098200,
10120x01ac6824,
10130x000d6140,
10140x000d68c0,
10150x018d6823,
10160x01cd7021,
10170x24010000,
10180xff098200,
10190xff06000d,
10200x8dc70000,
10210xff098200,
10220x8dcc0000,
10230xff098200,
10240x8dcf0000,
10250xff098200,
10260x14e10000,
10270xff050804,
10280x8dc50000,
10290xff098200,
10300x11890000,
10310xff050805,
10320x8dcd0000,
10330xff098200,
10340xff06000e,
10350xff000000,
10360x11e00000,
10370xff050849,
10380x01e07021,
10390x10000000,
10400xff05080d,
10410x00000000,
10420xff06000f,
10430x10be0000,
10440xff050849,
10450x00000000,
10460x00a03021,
10470x10000000,
10480xff050849,
10490x01a02021,
10500xff060010,
10510x10c10000,
10520xff05080b,
10530x2ccc0000,
10540xff098200,
10550x240d0000,
10560xff098200,
10570x00cc680a,
10580x01a06827,
10590x000d6880,
10600x026d6821,
10610x10000000,
10620xff05080c,
10630x8da40000,
10640xff098200,
10650xff06004a,
10660x2d210010,
10670x8e060000,
10680xff098200,
10690x14200000,
10700xff050844,
10710x8e070000,
10720xff098200,
10730x8e040000,
10740xff098200,
10750x8e050000,
10760xff098200,
10770x24010000,
10780xff098200,
10790x14c10000,
10800xff050844,
10810x24e70000,
10820xff098200,
10830x8c8d0000,
10840xff098200,
10850x908f0000,
10860xff098200,
10870x00ed0825,
10880x14200000,
10890xff050844,
10900xff000000,
10910x31e10000,
10920xff090200,
10930x10200000,
10940xff050849,
10950xac850000,
10960xff098200,
10970x8e6c0000,
10980xff098200,
10990x31ef0000,
11000xff090200,
11010xae640000,
11020xff098200,
11030xa08f0000,
11040xff098200,
11050x10000000,
11060xff050849,
11070xac8c0000,
11080xff098200,
11090xff06004b,
11100x8e070000,
11110xff098200,
11120x2d210010,
11130x8e050000,
11140xff098200,
11150x8e790000,
11160xff098200,
11170x24e70000,
11180xff098200,
11190x00270825,
11200x14200000,
11210xff050844,
11220x26060008,
11230x0320f809,
11240x02802021,
11250x10000000,
11260xff050847,
11270xd4400000,
11280xff06004c,
11290x8e040000,
11300xff098200,
11310x39210008,
11320x2c840000,
11330xff098200,
11340x0001200b,
11350x10800000,
11360xff050844,
11370xd6000000,
11380x10000000,
11390xff050847,
11400x00000000,
11410xff06004d,
11420x11200000,
11430xff050844,
11440xff000000,
11450x8e060000,
11460xff098200,
11470x8e040000,
11480xff098200,
11490x24010000,
11500xff098200,
11510x10c10000,
11520xff050849,
11530x8e6d0000,
11540xff098200,
11550x2ccc0000,
11560xff098200,
11570x2dad0001,
11580x018d6024,
11590x11800000,
11600xff050844,
11610xae900000,
11620xff098200,
11630x8e6c0000,
11640xff098200,
11650x8e6d0000,
11660xff098200,
11670x018d0823,
11680x04310000,
11690xff05084e,
11700xafb20014,
11710x8e790000,
11720xff098200,
11730x02802021,
11740x0320f809,
11750x02002821,
11760x24060000,
11770xff098200,
11780x10000000,
11790xff050849,
11800x00402021,
11810xff06004f,
11820x8e040000,
11830xff098200,
11840x8e050000,
11850xff098200,
11860x11200000,
11870xff050844,
11880x02097021,
11890x24010000,
11900xff098200,
11910xadde0000,
11920xff098200,
11930x14810000,
11940xff050844,
11950x8e120000,
11960xff098200,
11970x8e790000,
11980xff098200,
11990xff000000,
12000xae900000,
12010xff098200,
12020xae900000,
12030xff098200,
12040x26060008,
12050xafb20014,
12060x0320f809,
12070x02802021,
12080x10400000,
12090xff050849,
12100x24060000,
12110xff098200,
12120xd6000008,
12130x2617fff8,
12140xd6020010,
12150x240a0000,
12160xff098200,
12170xf6e00000,
12180x10000000,
12190xff050845,
12200xf6e20008,
12210xff060050,
12220x11200000,
12230xff050844,
12240x8e060000,
12250xff098200,
12260x8e040000,
12270xff098200,
12280x24010000,
12290xff098200,
12300x14c10000,
12310xff050844,
12320x8e120000,
12330xff098200,
12340xff000000,
12350x8c8e0000,
12360xff098200,
12370xd5000000,
12380xff098200,
12390x15c00000,
12400xff050844,
12410xff000000,
12420xd5000000,
12430xff098200,
12440xff000000,
12450x2617fff8,
12460xae1e0000,
12470xff098200,
12480x240a0000,
12490xff098200,
12500x10000000,
12510xff050845,
12520xf6e00000,
12530xff060051,
12540x2d210010,
12550x8e060000,
12560xff098200,
12570x8e040000,
12580xff098200,
12590x8e070000,
12600xff098200,
12610x14200000,
12620xff050844,
12630xd60e0008,
12640x24c60000,
12650xff098200,
12660x2ce10000,
12670xff098200,
12680x240c0001,
12690x0006080b,
12700x448c6000,
12710x10200000,
12720xff050844,
12730x8e120000,
12740xff098200,
12750x46207024,
12760x46806321,
12770x8c8c0000,
12780xff098200,
12790x8c8d0000,
12800xff098200,
12810x440e0000,
12820x2617fff8,
12830x462c7380,
12840x25ce0001,
12850x01cc082b,
12860x000e78c0,
12870x01af7821,
12880x10200000,
12890xff050802,
12900xf6ee0000,
12910x8dee0000,
12920xff098200,
12930xd5e00000,
12940xff06000b,
12950x11de0000,
12960xff050845,
12970x240a0000,
12980xff098200,
12990x240a0000,
13000xff098200,
13010x10000000,
13020xff050845,
13030xf6e00008,
13040xff06000c,
13050x8c8c0000,
13060xff098200,
13070xff000000,
13080x8e790000,
13090xff098200,
13100x11800000,
13110xff050845,
13120x240a0000,
13130xff098200,
13140x0320f809,
13150x01c02821,
13160x10400000,
13170xff050845,
13180x240a0000,
13190xff098200,
13200x8c4e0000,
13210xff098200,
13220x10000000,
13230xff05080b,
13240xd4400000,
13250xff060052,
13260x11200000,
13270xff050844,
13280x8e060000,
13290xff098200,
13300x8e040000,
13310xff098200,
13320x24010000,
13330xff098200,
13340x14c10000,
13350xff050844,
13360x8e120000,
13370xff098200,
13380xff000000,
13390x8c8e0000,
13400xff098200,
13410xd5000000,
13420xff098200,
13430x15c00000,
13440xff050844,
13450xff000000,
13460xd5000000,
13470xff098200,
13480xff000000,
13490x2617fff8,
13500xae000000,
13510xff098200,
13520xae000000,
13530xff098200,
13540x240a0000,
13550xff098200,
13560x10000000,
13570xff050845,
13580xf6e00000,
13590xff060053,
13600x926f0000,
13610xff098200,
13620x11200000,
13630xff050844,
13640x02007021,
13650x26100008,
13660x000f7802,
13670xff0900a6,
13680x31ef0001,
13690x25f20000,
13700xff098200,
13710x10000000,
13720xff050824,
13730x2529fff8,
13740xff060054,
13750x2d210010,
13760x8e070000,
13770xff098200,
13780x14200000,
13790xff050844,
13800xd60e0008,
13810xd60c0000,
13820x926d0000,
13830xff098200,
13840x24010000,
13850xff098200,
13860x02007021,
13870x14e10000,
13880xff050844,
13890x26100010,
13900x000f7802,
13910xff0900a6,
13920xf5ce0000,
13930x31ef0001,
13940xf5cc0008,
13950x25f20000,
13960xff098200,
13970x10000000,
13980xff050824,
13990x2529fff0,
14000xff060055,
14010x11200000,
14020xff050844,
14030x8e060000,
14040xff098200,
14050x8e040000,
14060xff098200,
14070xff000000,
14080x24010000,
14090xff098200,
14100x14c10000,
14110xff050844,
14120x908c0000,
14130xff098200,
14140x8c8d0000,
14150xff098200,
14160x8c850000,
14170xff098200,
14180x8c8e0000,
14190xff098200,
14200x258f0000,
14210xff098200,
14220x1de00000,
14230xff050844,
14240x01c57026,
14250x15a00000,
14260xff050844,
14270x01cc0825,
14280x8c8c0000,
14290xff098200,
14300x10200000,
14310xff050844,
14320x8e120000,
14330xff098200,
14340x00a97021,
14350x018e082b,
14360x14200000,
14370xff050844,
14380xafb20014,
14390xae900000,
14400xff098200,
14410xff06000b,
14420x26100008,
14430x2529fff8,
14440x25cefff8,
14450xac8e0000,
14460xff098200,
14470x02096821,
14480x00a03021,
14490xae900000,
14500xff098200,
14510xff06000c,
14520xd6000000,
14530x020d082b,
14540x10200000,
14550xff050803,
14560x26100008,
14570xf4c00000,
14580x10000000,
14590xff05080c,
14600x24c60008,
14610xff06000d,
14620x04110000,
14630xff050821,
14640x0080b821,
14650xff06000e,
14660xff000000,
14670x8eee0000,
14680xff098200,
14690x2c410000,
14700xff098200,
14710x8eef0000,
14720xff098200,
14730x240c0000,
14740xff098200,
14750x8e900000,
14760xff098200,
14770xae6c0000,
14780xff098200,
14790x10200000,
14800xff050808,
14810x01ee5023,
14820x8e8c0000,
14830xff098200,
14840x11400000,
14850xff050806,
14860x020a6821,
14870x018d082b,
14880x14200000,
14890xff050809,
14900x01ca7821,
14910xaeee0000,
14920xff098200,
14930x02006821,
14940xff06000f,
14950xd5c00000,
14960x25ce0008,
14970x01cf082b,
14980xf5a00000,
14990x14200000,
15000xff05080f,
15010x25ad0008,
15020xff060010,
15030x324c0000,
15040xff090200,
15050x240d0000,
15060xff098200,
15070x2617fff8,
15080xae0d0000,
15090xff098200,
15100x254a0010,
15110xff060011,
15120xafb20014,
15130x11800000,
15140xff050817,
15150x0140a821,
15160x10000000,
15170xff050818,
15180x00000000,
15190xff060012,
15200x25effff8,
15210x240d0000,
15220xff098200,
15230xd5e00000,
15240xaeef0000,
15250xff098200,
15260xff000000,
15270x240a0000,
15280xff098200,
15290xae0d0000,
15300xff098200,
15310x2617fff8,
15320xf6000000,
15330x10000000,
15340xff050811,
15350x324c0000,
15360xff090200,
15370xff060013,
15380x8e790000,
15390xff098200,
15400x000a28c2,
15410x0320f809,
15420x02802021,
15430x10000000,
15440xff05080e,
15450x24020000,
15460xff060056,
15470x8d040000,
15480xff098200,
15490x908c0000,
15500xff098200,
15510x8c8d0000,
15520xff098200,
15530x8c850000,
15540xff098200,
15550x8c8e0000,
15560xff098200,
15570x258f0000,
15580xff098200,
15590x1de00000,
15600xff050844,
15610x01c57026,
15620x15a00000,
15630xff050844,
15640x01cc0825,
15650x8c8c0000,
15660xff098200,
15670x10200000,
15680xff050844,
15690x8e120000,
15700xff098200,
15710x00a97021,
15720x018e082b,
15730x14200000,
15740xff050844,
15750xafb20014,
15760xae900000,
15770xff098200,
15780xff06000b,
15790xac8e0000,
15800xff098200,
15810xff000000,
15820x02096821,
15830x00a03021,
15840xae900000,
15850xff098200,
15860xff06000c,
15870xd6000000,
15880x020d082b,
15890x10200000,
15900xff050803,
15910x26100008,
15920xf4c00000,
15930x10000000,
15940xff05080c,
15950x24c60008,
15960xff06000d,
15970x04110000,
15980xff050821,
15990x0080b821,
16000xff06000e,
16010x8eee0000,
16020xff098200,
16030x2c410000,
16040xff098200,
16050x8eef0000,
16060xff098200,
16070x240c0000,
16080xff098200,
16090x8e900000,
16100xff098200,
16110xae6c0000,
16120xff098200,
16130x10200000,
16140xff050808,
16150x01ee5023,
16160x8e8c0000,
16170xff098200,
16180x11400000,
16190xff050806,
16200x020a6821,
16210x018d082b,
16220x14200000,
16230xff050809,
16240x01ca7821,
16250xaeee0000,
16260xff098200,
16270x02006821,
16280xff06000f,
16290xd5c00000,
16300x25ce0008,
16310x01cf082b,
16320xf5a00000,
16330x14200000,
16340xff05080f,
16350x25ad0008,
16360xff060010,
16370x324c0000,
16380xff090200,
16390x0200b821,
16400x254a0008,
16410xff060011,
16420xff000000,
16430xafb20014,
16440x11800000,
16450xff050817,
16460x0140a821,
16470x10000000,
16480xff050818,
16490x00000000,
16500xff060012,
16510x8e790000,
16520xff098200,
16530x02e02821,
16540x0320f809,
16550x02802021,
16560xff060013,
16570x8e790000,
16580xff098200,
16590x000a28c2,
16600x0320f809,
16610x02802021,
16620x10000000,
16630xff05080e,
16640x24020000,
16650xff060057,
16660x8e8c0000,
16670xff098200,
16680x02096821,
16690xae900000,
16700xff098200,
16710x318c0000,
16720xff090200,
16730xae8d0000,
16740xff098200,
16750x11800000,
16760xff050844,
16770x24020000,
16780xff098200,
16790xae800000,
16800xff098200,
16810x10000000,
16820xff05081a,
16830xa2820000,
16840xff098200,
16850xff060058,
16860x8e060000,
16870xff098200,
16880x11200000,
16890xff050844,
16900xd60c0000,
16910x2cc10000,
16920xff098200,
16930x10200000,
16940xff050844,
16950x46206005,
16960xff060047,
16970xff000000,
16980x8e120000,
16990xff098200,
17000x2617fff8,
17010x10000000,
17020xff050859,
17030xf600fff8,
17040xff060049,
17050x8e120000,
17060xff098200,
17070xae060000,
17080xff098200,
17090x2617fff8,
17100xae040000,
17110xff098200,
17120xff060059,
17130x240a0000,
17140xff098200,
17150xff060045,
17160x324c0000,
17170xff090200,
17180x15800000,
17190xff050818,
17200x0140a821,
17210x8e4bfffc,
17220x000b4542,
17230x310807f8,
17240xff06000f,
17250x0148082b,
17260x14200000,
17270xff050806,
17280x000b6142,
17290x318c07f8,
17300x8e4b0000,
17310x26520004,
17320x02ec8023,
17330x316d00ff,
17340x000d6880,
17350x026d6021,
17360x000b5402,
17370x8d810000,
17380x000bb942,
17390x000a50c0,
17400x00200008,
17410x32f707f8,
17420xff060010,
17430x02ea6821,
17440x254a0008,
17450x10000000,
17460xff05080f,
17470xadbe0000,
17480xff098200,
17490xff06005a,
17500x8e060000,
17510xff098200,
17520x11200000,
17530xff050844,
17540xd60c0000,
17550x2cc10000,
17560xff098200,
17570x10200000,
17580xff050844,
17590x00000000,
17600x04110000,
17610xff05085b,
17620x00000000,
17630x10000000,
17640xff050847,
17650xff000000,
17660x00000000,
17670xff06005c,
17680x8e060000,
17690xff098200,
17700x11200000,
17710xff050844,
17720xd60c0000,
17730x2cc10000,
17740xff098200,
17750x10200000,
17760xff050844,
17770x00000000,
17780x04110000,
17790xff05085d,
17800x00000000,
17810x10000000,
17820xff050847,
17830x00000000,
17840xff06005e,
17850x8e060000,
17860xff098200,
17870x11200000,
17880xff050844,
17890x8e790000,
17900xff098200,
17910x2cc10000,
17920xff098200,
17930x10200000,
17940xff050844,
17950x00000000,
17960x0320f809,
17970xd60c0000,
17980x10000000,
17990xff050847,
18000x00000000,
18010xff06005f,
18020x8e060000,
18030xff098200,
18040x11200000,
18050xff050844,
18060x8e790000,
18070xff098200,
18080x2cc10000,
18090xff098200,
18100x10200000,
18110xff050844,
18120x00000000,
18130x0320f809,
18140xd60c0000,
18150x10000000,
18160xff050847,
18170x00000000,
18180xff060060,
18190x8e060000,
18200xff098200,
18210xff000000,
18220x11200000,
18230xff050844,
18240x8e790000,
18250xff098200,
18260x2cc10000,
18270xff098200,
18280x10200000,
18290xff050844,
18300x00000000,
18310x0320f809,
18320xd60c0000,
18330x10000000,
18340xff050847,
18350x00000000,
18360xff060061,
18370x8e060000,
18380xff098200,
18390x11200000,
18400xff050844,
18410x8e790000,
18420xff098200,
18430x2cc10000,
18440xff098200,
18450x10200000,
18460xff050844,
18470x00000000,
18480x0320f809,
18490xd60c0000,
18500x10000000,
18510xff050847,
18520x00000000,
18530xff060062,
18540x8e060000,
18550xff098200,
18560x11200000,
18570xff050844,
18580x8e790000,
18590xff098200,
18600x2cc10000,
18610xff098200,
18620x10200000,
18630xff050844,
18640x00000000,
18650x0320f809,
18660xd60c0000,
18670x10000000,
18680xff050847,
18690x00000000,
18700xff060063,
18710x8e060000,
18720xff098200,
18730x11200000,
18740xff050844,
18750x8e790000,
18760xff098200,
18770xff000000,
18780x2cc10000,
18790xff098200,
18800x10200000,
18810xff050844,
18820x00000000,
18830x0320f809,
18840xd60c0000,
18850x10000000,
18860xff050847,
18870x00000000,
18880xff060064,
18890x8e060000,
18900xff098200,
18910x11200000,
18920xff050844,
18930x8e790000,
18940xff098200,
18950x2cc10000,
18960xff098200,
18970x10200000,
18980xff050844,
18990x00000000,
19000x0320f809,
19010xd60c0000,
19020x10000000,
19030xff050847,
19040x00000000,
19050xff060065,
19060x8e060000,
19070xff098200,
19080x11200000,
19090xff050844,
19100x8e790000,
19110xff098200,
19120x2cc10000,
19130xff098200,
19140x10200000,
19150xff050844,
19160x00000000,
19170x0320f809,
19180xd60c0000,
19190x10000000,
19200xff050847,
19210x00000000,
19220xff060066,
19230x8e060000,
19240xff098200,
19250x11200000,
19260xff050844,
19270x8e790000,
19280xff098200,
19290x2cc10000,
19300xff098200,
19310x10200000,
19320xff050844,
19330xff000000,
19340x00000000,
19350x0320f809,
19360xd60c0000,
19370x10000000,
19380xff050847,
19390x00000000,
19400xff060067,
19410x8e060000,
19420xff098200,
19430x11200000,
19440xff050844,
19450x8e790000,
19460xff098200,
19470x2cc10000,
19480xff098200,
19490x10200000,
19500xff050844,
19510x00000000,
19520x0320f809,
19530xd60c0000,
19540x10000000,
19550xff050847,
19560x00000000,
19570xff060068,
19580x8e060000,
19590xff098200,
19600x11200000,
19610xff050844,
19620x8e790000,
19630xff098200,
19640x2cc10000,
19650xff098200,
19660x10200000,
19670xff050844,
19680x00000000,
19690x0320f809,
19700xd60c0000,
19710x10000000,
19720xff050847,
19730x00000000,
19740xff060069,
19750x8e060000,
19760xff098200,
19770x11200000,
19780xff050844,
19790x8e790000,
19800xff098200,
19810x2cc10000,
19820xff098200,
19830x10200000,
19840xff050844,
19850x00000000,
19860x0320f809,
19870xd60c0000,
19880x10000000,
19890xff050847,
19900x00000000,
19910xff06006a,
19920xff000000,
19930x2d210010,
19940x8e060000,
19950xff098200,
19960x14200000,
19970xff050844,
19980x8e070000,
19990xff098200,
20000xd60c0000,
20010xd60e0008,
20020x2ccc0000,
20030xff098200,
20040x2ced0000,
20050xff098200,
20060x018d6024,
20070x11800000,
20080xff050844,
20090x8e790000,
20100xff098200,
20110x0320f809,
20120x00000000,
20130x10000000,
20140xff050847,
20150x00000000,
20160xff06006b,
20170x2d210010,
20180x8e060000,
20190xff098200,
20200x14200000,
20210xff050844,
20220x8e070000,
20230xff098200,
20240xd60c0000,
20250xd60e0008,
20260x2ccc0000,
20270xff098200,
20280x2ced0000,
20290xff098200,
20300x018d6024,
20310x11800000,
20320xff050844,
20330x8e790000,
20340xff098200,
20350x0320f809,
20360x00000000,
20370x10000000,
20380xff050847,
20390x00000000,
20400xff06006c,
20410x2d210010,
20420x8e060000,
20430xff098200,
20440x14200000,
20450xff050844,
20460x8e070000,
20470xff098200,
20480xd60c0000,
20490xd60e0008,
20500x2ccc0000,
20510xff098200,
20520x2ced0000,
20530xff098200,
20540xff000000,
20550x018d6024,
20560x11800000,
20570xff050844,
20580x8e790000,
20590xff098200,
20600x0320f809,
20610x00000000,
20620x10000000,
20630xff050847,
20640x00000000,
20650xff06006d,
20660x8e060000,
20670xff098200,
20680x11200000,
20690xff050844,
20700xd60c0000,
20710x2cc10000,
20720xff098200,
20730x10200000,
20740xff050844,
20750x46206004,
20760x10000000,
20770xff050847,
20780x00000000,
20790xff06006e,
20800xff06006f,
20810x8e060000,
20820xff098200,
20830x11200000,
20840xff050844,
20850xd60c0000,
20860x2cc10000,
20870xff098200,
20880x10200000,
20890xff050844,
20900xd50e0000,
20910xff098200,
20920x10000000,
20930xff050847,
20940x462e6002,
20950xff060070,
20960x2d210010,
20970x8e060000,
20980xff098200,
20990x14200000,
21000xff050844,
21010x8e070000,
21020xff098200,
21030xd60c0000,
21040xd60e0008,
21050x2ccc0000,
21060xff098200,
21070x2ced0000,
21080xff098200,
21090xff000000,
21100x018d6024,
21110x11800000,
21120xff050844,
21130x462073a4,
21140x8e790000,
21150xff098200,
21160x44067000,
21170x0320f809,
21180x00000000,
21190x10000000,
21200xff050847,
21210x00000000,
21220xff060071,
21230x8e060000,
21240xff098200,
21250x11200000,
21260xff050844,
21270xd60c0000,
21280x2cc10000,
21290xff098200,
21300x10200000,
21310xff050844,
21320x8e790000,
21330xff098200,
21340x8e120000,
21350xff098200,
21360x0320f809,
21370x26660000,
21380xff098200,
21390x8e6d0000,
21400xff098200,
21410x2617fff8,
21420x448d7000,
21430xf6e00000,
21440x468073a1,
21450xf6ee0008,
21460x10000000,
21470xff050845,
21480x240a0000,
21490xff098200,
21500xff060072,
21510x8e060000,
21520xff098200,
21530x11200000,
21540xff050844,
21550xd60c0000,
21560x2cc10000,
21570xff098200,
21580x10200000,
21590xff050844,
21600x8e790000,
21610xff098200,
21620x8e120000,
21630xff098200,
21640x0320f809,
21650x2606fff8,
21660x2617fff8,
21670xf6000000,
21680x10000000,
21690xff050845,
21700x240a0000,
21710xff098200,
21720xff060073,
21730xff000000,
21740x8e060000,
21750xff098200,
21760x11200000,
21770xff050844,
21780xd6000000,
21790x2cc10000,
21800xff098200,
21810x10200000,
21820xff050844,
21830x02097021,
21840x260d0008,
21850x11ae0000,
21860xff050847,
21870xff06000b,
21880x8da60000,
21890xff098200,
21900xd5ac0000,
21910x25ad0008,
21920x2cc10000,
21930xff098200,
21940x10200000,
21950xff050844,
21960x462c0034,
21970x15ae0000,
21980xff05080b,
21990x46206011,
22000x10000000,
22010xff050847,
22020x00000000,
22030xff060074,
22040x8e060000,
22050xff098200,
22060x11200000,
22070xff050844,
22080xd6000000,
22090x2cc10000,
22100xff098200,
22110x10200000,
22120xff050844,
22130x02097021,
22140x260d0008,
22150x11ae0000,
22160xff050847,
22170xff06000b,
22180x8da60000,
22190xff098200,
22200xd5ac0000,
22210x25ad0008,
22220x2cc10000,
22230xff098200,
22240x10200000,
22250xff050844,
22260x46206034,
22270x15ae0000,
22280xff05080b,
22290x46206011,
22300x10000000,
22310xff050847,
22320xff000000,
22330x00000000,
22340xff060075,
22350x11200000,
22360xff050844,
22370x8e060000,
22380xff098200,
22390x8e040000,
22400xff098200,
22410x24010000,
22420xff098200,
22430x14c10000,
22440xff050844,
22450x00000000,
22460x10000000,
22470xff050876,
22480x8c820000,
22490xff098200,
22500xff060077,
22510x8e060000,
22520xff098200,
22530x8e040000,
22540xff098200,
22550x39210008,
22560x24c60000,
22570xff098200,
22580x00260825,
22590x14200000,
22600xff050844,
22610x00000000,
22620x8c8c0000,
22630xff098200,
22640x908d0000,
22650xff098200,
22660x2617fff8,
22670x000c502b,
22680x448d0000,
22690x254a0001,
22700x46800021,
22710x8e120000,
22720xff098200,
22730x000a50c0,
22740x10000000,
22750xff050845,
22760xf6e00000,
22770xff060078,
22780x8e6c0000,
22790xff098200,
22800x8e6d0000,
22810xff098200,
22820x018d0823,
22830x04310000,
22840xff05084e,
22850x8e060000,
22860xff098200,
22870xd60c0000,
22880x24010008,
22890x15210000,
22900xff050844,
22910xff000000,
22920x2cc10000,
22930xff098200,
22940x10200000,
22950xff050844,
22960x24060001,
22970x46206324,
22980x27a50010,
22990x2d810100,
23000x440c6000,
23010x10200000,
23020xff050844,
23030xafac0010,
23040xff060079,
23050x8e790000,
23060xff098200,
23070xae900000,
23080xff098200,
23090xafb20014,
23100x0320f809,
23110x02802021,
23120x8e900000,
23130xff098200,
23140x00402021,
23150x10000000,
23160xff050849,
23170x24060000,
23180xff098200,
23190xff06007a,
23200x8e6c0000,
23210xff098200,
23220x8e6d0000,
23230xff098200,
23240x018d0823,
23250x04310000,
23260xff05084e,
23270x2521fff0,
23280x8e060000,
23290xff098200,
23300xd6000010,
23310x8e0c0000,
23320xff098200,
23330x8e040000,
23340xff098200,
23350x04200000,
23360xff050844,
23370x8e050000,
23380xff098200,
23390xd6020008,
23400x10200000,
23410xff050801,
23420x2407ffff,
23430x46200024,
23440x2cc10000,
23450xff098200,
23460x10200000,
23470xff050844,
23480x44070000,
23490xff06000b,
23500x2ca10000,
23510xff098200,
23520xff000000,
23530x10200000,
23540xff050844,
23550x24010000,
23560xff098200,
23570x462010a4,
23580x15810000,
23590xff050844,
23600x8c850000,
23610xff098200,
23620x44061000,
23630x00e0082a,
23640x24ac0001,
23650x00ec6821,
23660x00c0782a,
23670x01a1380b,
23680x00cc6821,
23690x01af300b,
23700x240e0001,
23710x00e0082a,
23720x0006782a,
23730x0001380b,
23740x01cf300a,
23750x00a7082a,
23760x00a1380b,
23770x00862821,
23780x00e63023,
23790x24a50000,
23800xff098200,
23810x04c10000,
23820xff050879,
23830x24c60001,
23840xff06007b,
23850x26640000,
23860xff098200,
23870x10000000,
23880xff050849,
23890x24060000,
23900xff098200,
23910xff06007c,
23920x8e6c0000,
23930xff098200,
23940x8e6d0000,
23950xff098200,
23960x018d0823,
23970x04310000,
23980xff05084e,
23990x8e0c0000,
24000xff098200,
24010x2d210010,
24020x8e070000,
24030xff098200,
24040x8e040000,
24050xff098200,
24060x258c0000,
24070xff098200,
24080xd6000008,
24090x002c0825,
24100x14200000,
24110xff050844,
24120x2ce10000,
24130xff098200,
24140x46200024,
24150x10200000,
24160xff050844,
24170x8c8c0000,
24180xff098200,
24190x44060000,
24200x8e6d0000,
24210xff098200,
24220xff000000,
24230x24010001,
24240x18c00000,
24250xff05087b,
24260x002c082b,
24270x11800000,
24280xff05087b,
24290x01a6602b,
24300x002c0825,
24310x8e650000,
24320xff098200,
24330x14200000,
24340xff050844,
24350x908c0000,
24360xff098200,
24370x00a67021,
24380xff06000b,
24390x25ceffff,
24400x00ae082b,
24410x14200000,
24420xff05080b,
24430xa1cc0000,
24440x10000000,
24450xff050879,
24460x00000000,
24470xff06007d,
24480x8e6c0000,
24490xff098200,
24500x8e6d0000,
24510xff098200,
24520x018d0823,
24530x04310000,
24540xff05084e,
24550x8e060000,
24560xff098200,
24570x8e040000,
24580xff098200,
24590x11200000,
24600xff050844,
24610x24010000,
24620xff098200,
24630x14c10000,
24640xff050844,
24650x8e6d0000,
24660xff098200,
24670x8c860000,
24680xff098200,
24690x24840000,
24700xff098200,
24710x8e650000,
24720xff098200,
24730x01a6082b,
24740x14200000,
24750xff050844,
24760x00867821,
24770x00a63821,
24780xff06000b,
24790xff000000,
24800x908d0000,
24810x008f082b,
24820x10200000,
24830xff050879,
24840x24840001,
24850x24e7ffff,
24860x10000000,
24870xff05080b,
24880xa0ed0000,
24890xff06007e,
24900x8e6c0000,
24910xff098200,
24920x8e6d0000,
24930xff098200,
24940x018d0823,
24950x04310000,
24960xff05084e,
24970x8e060000,
24980xff098200,
24990x8e040000,
25000xff098200,
25010x11200000,
25020xff050844,
25030x24010000,
25040xff098200,
25050x14c10000,
25060xff050844,
25070x8e6d0000,
25080xff098200,
25090x8c860000,
25100xff098200,
25110x24840000,
25120xff098200,
25130x8e650000,
25140xff098200,
25150x01a6082b,
25160x14200000,
25170xff050844,
25180x00867821,
25190x00a03821,
25200xff06000b,
25210x908d0000,
25220x008f082b,
25230x10200000,
25240xff050879,
25250x25acffbf,
25260x39ae0020,
25270x2d81001a,
25280x01c1680b,
25290x24840001,
25300xa0ed0000,
25310x10000000,
25320xff05080b,
25330x24e70001,
25340xff06007f,
25350x8e6c0000,
25360xff098200,
25370x8e6d0000,
25380xff098200,
25390x018d0823,
25400x04310000,
25410xff05084e,
25420xff000000,
25430x8e060000,
25440xff098200,
25450x8e040000,
25460xff098200,
25470x11200000,
25480xff050844,
25490x24010000,
25500xff098200,
25510x14c10000,
25520xff050844,
25530x8e6d0000,
25540xff098200,
25550x8c860000,
25560xff098200,
25570x24840000,
25580xff098200,
25590x8e650000,
25600xff098200,
25610x01a6082b,
25620x14200000,
25630xff050844,
25640x00867821,
25650x00a03821,
25660xff06000b,
25670x908d0000,
25680x008f082b,
25690x10200000,
25700xff050879,
25710x25acff9f,
25720x39ae0020,
25730x2d81001a,
25740x01c1680b,
25750x24840001,
25760xa0ed0000,
25770x10000000,
25780xff05080b,
25790x24e70001,
25800xff060080,
25810x11200000,
25820xff050844,
25830x8e060000,
25840xff098200,
25850x8e040000,
25860xff098200,
25870x24010000,
25880xff098200,
25890x14c10000,
25900xff050844,
25910x8e790000,
25920xff098200,
25930x0320f809,
25940x00000000,
25950x10000000,
25960xff050876,
25970x00000000,
25980xff060081,
25990x8e060000,
26000xff098200,
26010xff000000,
26020x11200000,
26030xff050844,
26040xd60c0000,
26050x2cc10000,
26060xff098200,
26070x10200000,
26080xff050844,
26090x463e6300,
26100x44026000,
26110x260d0008,
26120x02097021,
26130xff06000b,
26140x8da70000,
26150xff098200,
26160x11ae0000,
26170xff050876,
26180xd5ac0000,
26190x2ce10000,
26200xff098200,
26210x10200000,
26220xff050844,
26230x463e6300,
26240x44056000,
26250x00451024,
26260x10000000,
26270xff05080b,
26280x25ad0008,
26290xff060082,
26300x8e060000,
26310xff098200,
26320x11200000,
26330xff050844,
26340xd60c0000,
26350x2cc10000,
26360xff098200,
26370x10200000,
26380xff050844,
26390x463e6300,
26400x44026000,
26410x260d0008,
26420x02097021,
26430xff06000b,
26440x8da70000,
26450xff098200,
26460x11ae0000,
26470xff050876,
26480xd5ac0000,
26490x2ce10000,
26500xff098200,
26510x10200000,
26520xff050844,
26530x463e6300,
26540x44056000,
26550x00451025,
26560x10000000,
26570xff05080b,
26580x25ad0008,
26590xff060083,
26600x8e060000,
26610xff098200,
26620x11200000,
26630xff050844,
26640xff000000,
26650xd60c0000,
26660x2cc10000,
26670xff098200,
26680x10200000,
26690xff050844,
26700x463e6300,
26710x44026000,
26720x260d0008,
26730x02097021,
26740xff06000b,
26750x8da70000,
26760xff098200,
26770x11ae0000,
26780xff050876,
26790xd5ac0000,
26800x2ce10000,
26810xff098200,
26820x10200000,
26830xff050844,
26840x463e6300,
26850x44056000,
26860x00451026,
26870x10000000,
26880xff05080b,
26890x25ad0008,
26900xff060084,
26910x8e060000,
26920xff098200,
26930x11200000,
26940xff050844,
26950xd60c0000,
26960x2cc10000,
26970xff098200,
26980x10200000,
26990xff050844,
27000x463e6300,
27010x44026000,
27020x00026602,
27030x00027202,
27040x00026e00,
27050x31ceff00,
27060x018d6025,
27070x3042ff00,
27080x018e6025,
27090x00021200,
27100x10000000,
27110xff050876,
27120x01821025,
27130xff060085,
27140x8e060000,
27150xff098200,
27160x11200000,
27170xff050844,
27180xd60c0000,
27190x2cc10000,
27200xff098200,
27210x10200000,
27220xff050844,
27230x463e6300,
27240x44026000,
27250x10000000,
27260xff050876,
27270x00401027,
27280xff060086,
27290x2d210010,
27300x8e060000,
27310xff098200,
27320x14200000,
27330xff050844,
27340xff000000,
27350x8e070000,
27360xff098200,
27370xd60c0000,
27380xd60e0008,
27390x2ccc0000,
27400xff098200,
27410x2ced0000,
27420xff098200,
27430x018d6024,
27440x11800000,
27450xff050844,
27460x463e6300,
27470x463e7380,
27480x44046000,
27490x44057000,
27500x10000000,
27510xff050876,
27520x00a41004,
27530xff060087,
27540x2d210010,
27550x8e060000,
27560xff098200,
27570x14200000,
27580xff050844,
27590x8e070000,
27600xff098200,
27610xd60c0000,
27620xd60e0008,
27630x2ccc0000,
27640xff098200,
27650x2ced0000,
27660xff098200,
27670x018d6024,
27680x11800000,
27690xff050844,
27700x463e6300,
27710x463e7380,
27720x44046000,
27730x44057000,
27740x10000000,
27750xff050876,
27760x00a41006,
27770xff060088,
27780x2d210010,
27790x8e060000,
27800xff098200,
27810x14200000,
27820xff050844,
27830x8e070000,
27840xff098200,
27850xd60c0000,
27860xd60e0008,
27870x2ccc0000,
27880xff098200,
27890x2ced0000,
27900xff098200,
27910x018d6024,
27920x11800000,
27930xff050844,
27940x463e6300,
27950x463e7380,
27960x44046000,
27970x44057000,
27980x10000000,
27990xff050876,
28000x00a41007,
28010xff060089,
28020x2d210010,
28030x8e060000,
28040xff098200,
28050xff000000,
28060x14200000,
28070xff050844,
28080x8e070000,
28090xff098200,
28100xd60c0000,
28110xd60e0008,
28120x2ccc0000,
28130xff098200,
28140x2ced0000,
28150xff098200,
28160x018d6024,
28170x11800000,
28180xff050844,
28190x463e6300,
28200x463e7380,
28210x44046000,
28220x44057000,
28230x24010020,
28240x00256023,
28250x00a42804,
28260x01842006,
28270x10000000,
28280xff050876,
28290x00851025,
28300xff06008a,
28310x2d210010,
28320x8e060000,
28330xff098200,
28340x14200000,
28350xff050844,
28360x8e070000,
28370xff098200,
28380xd60c0000,
28390xd60e0008,
28400x2ccc0000,
28410xff098200,
28420x2ced0000,
28430xff098200,
28440x018d6024,
28450x11800000,
28460xff050844,
28470x463e6300,
28480x463e7380,
28490x44046000,
28500x44057000,
28510x24010020,
28520x00256023,
28530x00a42806,
28540x01842004,
28550x10000000,
28560xff050876,
28570x00851025,
28580xff06008b,
28590x8e060000,
28600xff098200,
28610x11200000,
28620xff050844,
28630xd60c0000,
28640x2cc10000,
28650xff098200,
28660x10200000,
28670xff050844,
28680x463e6300,
28690x44026000,
28700xff060076,
28710x44820000,
28720x10000000,
28730xff050847,
28740x46800021,
28750xff060044,
28760x8d0f0000,
28770xff098200,
28780xff000000,
28790x02096821,
28800x8e120000,
28810xff098200,
28820x25ac0000,
28830xff098200,
28840x8e8e0000,
28850xff098200,
28860xafb20014,
28870x01cc082b,
28880xae900000,
28890xff098200,
28900xae8d0000,
28910xff098200,
28920x14200000,
28930xff050805,
28940x01e0c821,
28950x01e0f809,
28960x02802021,
28970x8e900000,
28980xff098200,
28990x000250c0,
29000x1c400000,
29010xff050845,
29020x2617fff8,
29030xff06000b,
29040x8e8c0000,
29050xff098200,
29060x8e080000,
29070xff098200,
29080x14400000,
29090xff050829,
29100x01904823,
29110x8d120000,
29120xff098200,
29130x8e4b0000,
29140x26520004,
29150x316d00ff,
29160x000bb942,
29170x000d6880,
29180x32f707f8,
29190x026d6021,
29200x8d8c0000,
29210x01800008,
29220x02f0b821,
29230xff060029,
29240x324c0000,
29250xff090200,
29260x2401fffc,
29270x15800000,
29280xff050803,
29290x02416824,
29300x924d0000,
29310xff098200,
29320x000d68c0,
29330xff06000d,
29340x10000000,
29350xff050824,
29360x020d7023,
29370xff06000f,
29380x8e790000,
29390xff098200,
29400x24050000,
29410xff098200,
29420x0320f809,
29430x02802021,
29440x8e900000,
29450xff098200,
29460xff000000,
29470x10000000,
29480xff05080b,
29490x24020000,
29500xff06004e,
29510x03e0a821,
29520x8e790000,
29530xff098200,
29540xae900000,
29550xff098200,
29560x02096021,
29570xafb20014,
29580xae8c0000,
29590xff098200,
29600x0320f809,
29610x02802021,
29620x8e900000,
29630xff098200,
29640x02a0f821,
29650x8e8c0000,
29660xff098200,
29670x8e080000,
29680xff098200,
29690x03e00008,
29700x01904823,
29710xff06008c,
29720xff000000,
29730x926f0000,
29740xff098200,
29750x31e10000,
29760xff090200,
29770x14200000,
29780xff050805,
29790x8e6e0000,
29800xff098200,
29810x31e10000,
29820xff090200,
29830x14200000,
29840xff050801,
29850x25ceffff,
29860x31e10000,
29870xff090200,
29880x10200000,
29890xff050801,
29900x00000000,
29910x10000000,
29920xff050801,
29930xae6e0000,
29940xff098200,
29950xff000000,
29960xff06008d,
29970x926f0000,
29980xff098200,
29990x31e10000,
30000xff090200,
30010x10200000,
30020xff050801,
30030xff06000f,
30040x8d810000,
30050xff098200,
30060x00200008,
30070x00000000,
30080xff06008e,
30090x926f0000,
30100xff098200,
30110x8e6e0000,
30120xff098200,
30130x31e10000,
30140xff090200,
30150x14200000,
30160xff05080f,
30170x31e10000,
30180xff090200,
30190x10200000,
30200xff05080f,
30210x25ceffff,
30220x11c00000,
30230xff050801,
30240xae6e0000,
30250xff098200,
30260x31e10000,
30270xff090200,
30280x10200000,
30290xff05080f,
30300xff06000b,
30310x8e790000,
30320xff098200,
30330xafb50010,
30340x02402821,
30350xae900000,
30360xff098200,
30370x0320f809,
30380x02802021,
30390xff06000d,
30400x8e900000,
30410xff098200,
30420xff06000e,
30430xff000000,
30440x8e4bfffc,
30450x316d00ff,
30460x000d6880,
30470x026d6021,
30480x000b5402,
30490x8d810000,
30500xff098200,
30510x000bb942,
30520x000a50c0,
30530x00200008,
30540x32f707f8,
30550xff06008f,
30560x26520004,
30570x10000000,
30580xff05080e,
30590x8d150000,
30600xff098200,
30610xff060090,
30620xff000000,
30630xf0f0f0f0,
30640xff000000,
30650xff060091,
30660xff000000,
30670x10000000,
30680xff050801,
30690xff000000,
30700x02402821,
30710xff060092,
30720xff000000,
30730x36450001,
30740xff06000b,
30750xff000000,
30760x8e790000,
30770xff098200,
30780x02096021,
30790xafb20014,
30800xae900000,
30810xff098200,
30820x02f0b823,
30830xae8c0000,
30840xff098200,
30850x0320f809,
30860x02802021,
30870x8e900000,
30880xff098200,
30890x8e8c0000,
30900xff098200,
30910xafa00014,
30920x01904823,
30930x0217b821,
30940x8e080000,
30950xff098200,
30960x00400008,
30970x8e4bfffc,
30980xff060093,
30990xff000000,
31000xf0f0f0f0,
31010xff000000,
31020xff060094,
31030xff000000,
31040xf0f0f0f0,
31050xff000000,
31060xff06005b,
31070x3c0c4330,
31080x44802000,
31090x448c2800,
31100x46206085,
31110x44016800,
31120x46241034,
31130x46241000,
31140x45000000,
31150xff050801,
31160x46240001,
31170x0020082a,
31180x3c0c3ff0,
31190x46200087,
31200x448c2800,
31210x46211013,
31220x46206034,
31230x46240081,
31240x03e00008,
31250x46211011,
31260xff06000b,
31270x03e00008,
31280x46206006,
31290xff06005d,
31300x3c0c4330,
31310x44802000,
31320x448c2800,
31330x46206085,
31340x44016800,
31350x46241034,
31360x46241000,
31370x45000000,
31380xff050801,
31390x46240001,
31400x0020082a,
31410x3c0cbff0,
31420x46200087,
31430x448c2800,
31440x46211013,
31450x462c0034,
31460x46240081,
31470x03e00008,
31480x46211011,
31490xff06000b,
31500x03e00008,
31510x46206006,
31520xff060095,
31530xff000000,
31540x3c0c4330,
31550x44802000,
31560x448c2800,
31570x46206085,
31580x44016800,
31590x46241034,
31600x46241000,
31610x45000000,
31620xff050801,
31630x46240001,
31640x0020082a,
31650x3c0c3ff0,
31660x448c2800,
31670x46201034,
31680x46240081,
31690x46211011,
31700x46200087,
31710x03e00008,
31720x46211013,
31730xff06000b,
31740x03e00008,
31750x46206006,
31760xff000000,
31770xff060096,
31780xff000000,
31790x27bdff90,
31800xafbf0000,
31810xff098200,
31820xafbe0000,
31830xff098200,
31840xf7be0000,
31850xff098200,
31860xafb70000,
31870xff098200,
31880xafb60000,
31890xff098200,
31900xf7bc0000,
31910xff098200,
31920xafb50000,
31930xff098200,
31940xafb40000,
31950xff098200,
31960xf7ba0000,
31970xff098200,
31980xafb30000,
31990xff098200,
32000xafb20000,
32010xff098200,
32020xf7b80000,
32030xff098200,
32040xafb10000,
32050xff098200,
32060xafb00000,
32070xff098200,
32080xf7b60000,
32090xff098200,
32100xf7b40000,
32110xff098200,
32120x8c520000,
32130xff098200,
32140x24530000,
32150xff098200,
32160x8e790000,
32170xff098200,
32180xae410000,
32190xff098200,
32200xae440000,
32210xff098200,
32220xae450000,
32230xff098200,
32240xf64c0000,
32250xff098200,
32260xff000000,
32270xae460000,
32280xff098200,
32290xae470000,
32300xff098200,
32310xf64e0000,
32320xff098200,
32330x27ac0000,
32340xff098200,
32350xae4c0000,
32360xff098200,
32370xafa00014,
32380x03a02821,
32390x0320f809,
32400x02402021,
32410x8c500000,
32420xff098200,
32430x8c490000,
32440xff098200,
32450x0040a021,
32460x3c0f59c0,
32470x8e080000,
32480xff098200,
32490x448ff000,
32500x240c0000,
32510xff098200,
32520x241e0000,
32530xff098200,
32540x01304823,
32550xae6c0000,
32560xff098200,
32570x4600f7a1,
32580x8d120000,
32590xff098200,
32600x8e4b0000,
32610x26520004,
32620x316d00ff,
32630x000bb942,
32640x000d6880,
32650x32f707f8,
32660x026d6021,
32670x8d8c0000,
32680x01800008,
32690x02f0b821,
32700xff000000,
32710xff060028,
32720xff000000,
32730x8e790000,
32740xff098200,
32750x8e720000,
32760xff098200,
32770xae900000,
32780xff098200,
32790xae880000,
32800xff098200,
32810xae540000,
32820xff098200,
32830x02e02821,
32840x0320f809,
32850x02402021,
32860x8e420000,
32870xff098200,
32880xd6400000,
32890xff098200,
32900x8e430000,
32910xff098200,
32920x10000000,
32930xff05081a,
32940xd6420000,
32950xff098200,
32960xff000000,
32970xff060097,
32980xff000000,
32990x8c8d0000,
33000xff098200,
33010x90850000,
33020xff098200,
33030x03a07021,
33040x03ade823,
33050xaddffffc,
33060x00052880,
33070xadd0fff8,
33080xadc4fff4,
33090x01c08021,
33100x248d0000,
33110xff098200,
33120x27ae0010,
33130x10a00000,
33140xff050802,
33150x01a57821,
33160xff06000b,
33170x8dac0000,
33180x25ad0004,
33190x01af082b,
33200xadcc0000,
33210x14200000,
33220xff05080b,
33230x25ce0004,
33240xff06000c,
33250x8c990000,
33260xff098200,
33270x8c850000,
33280xff098200,
33290x8c860000,
33300xff098200,
33310x8c870000,
33320xff098200,
33330xd48c0000,
33340xff098200,
33350xd48e0000,
33360xff098200,
33370x0320f809,
33380x8c840000,
33390xff098200,
33400x8e0dfff4,
33410x8e0efff8,
33420x8e1ffffc,
33430xada20000,
33440xff098200,
33450xada30000,
33460xff098200,
33470xf5a00000,
33480xff098200,
33490xf5a20000,
33500xff098200,
33510x0200e821,
33520x03e00008,
33530x01c08021,
33540xff000000,
33550xff080000,
33560xff000000,
33570x02172821,
33580x020a3021,
33590x8cac0000,
33600xff098200,
33610x8ccd0000,
33620xff098200,
33630xd4a00000,
33640xd4c20000,
33650x2d8c0000,
33660xff098200,
33670x2dad0000,
33680xff098200,
33690x964e0000,
33700xff098200,
33710x018d6024,
33720x26520004,
33730x11800000,
33740xff050835,
33750x3c0d0000,
33760xff090200,
33770x000e7080,
33780x01cd7021,
33790xff000000,
33800x46220034,
33810xff000000,
33820x46220036,
33830xff000000,
33840x00007001,
33850xff000000,
33860x00017001,
33870xff000000,
33880x024e9021,
33890xff06000b,
33900x8e4b0000,
33910x26520004,
33920x316d00ff,
33930x000d6880,
33940x026d6021,
33950x000b5402,
33960x8d810000,
33970x000bb942,
33980x000a50c0,
33990x00200008,
34000x32f707f8,
34010xff000000,
34020x0217b821,
34030x26520004,
34040x8eec0000,
34050xff098200,
34060xd6e00000,
34070x020a5021,
34080x964e0000,
34090xff098200,
34100x8d4d0000,
34110xff098200,
34120xd5420000,
34130x3c0f0000,
34140xff090200,
34150x2d810000,
34160xff098200,
34170x2da40000,
34180xff098200,
34190x000e7080,
34200x00240824,
34210x10200000,
34220xff050805,
34230x01cf7021,
34240x46220032,
34250xff000000,
34260x00007001,
34270xff000000,
34280x00017001,
34290xff000000,
34300xff06000b,
34310x024e9021,
34320x8e4b0000,
34330x26520004,
34340x316d00ff,
34350x000d6880,
34360x026d6021,
34370x000b5402,
34380x8d810000,
34390x000bb942,
34400x000a50c0,
34410x00200008,
34420x32f707f8,
34430xff06000f,
34440x8ee50000,
34450xff098200,
34460x8d460000,
34470xff098200,
34480xff000000,
34490x240f0000,
34500xff098200,
34510x118f0000,
34520xff05083b,
34530xff000000,
34540x2d810000,
34550xff098200,
34560xff000000,
34570x11af0000,
34580xff05083b,
34590xff000000,
34600x00a67826,
34610x01ac6826,
34620x2d840000,
34630xff098200,
34640x0001780a,
34650x000d200b,
34660x01af0825,
34670x0001200a,
34680x10800000,
34690xff05080b,
34700xff000000,
34710x0001700b,
34720xff000000,
34730x0001700a,
34740xff000000,
34750x8cad0000,
34760xff098200,
34770x11a00000,
34780xff05080b,
34790x00000000,
34800x91ad0000,
34810xff098200,
34820x31ad0000,
34830xff090200,
34840x15a00000,
34850xff05080b,
34860x00000000,
34870x10000000,
34880xff05083a,
34890x24070000,
34900xff098200,
34910xff000000,
34920x0217b821,
34930x26520004,
34940x8eec0000,
34950xff098200,
34960x000a5042,
34970x8eef0000,
34980xff098200,
34990x022a5023,
35000x964e0000,
35010xff098200,
35020xff000000,
35030x24010000,
35040xff098200,
35050x11810000,
35060xff05083b,
35070xff000000,
35080x8d4dfffc,
35090x258c0000,
35100xff098200,
35110x000e7080,
35120x01af6826,
35130x018d6025,
35140x3c0f0000,
35150xff090200,
35160x01cf7021,
35170xff000000,
35180x000c700b,
35190xff000000,
35200x000c700a,
35210xff000000,
35220x024e9021,
35230x8e4b0000,
35240x26520004,
35250x316d00ff,
35260x000d6880,
35270x026d6021,
35280x000b5402,
35290x8d810000,
35300x000bb942,
35310x000a50c0,
35320x00200008,
35330x32f707f8,
35340xff000000,
35350x0217b821,
35360x26520004,
35370x8eec0000,
35380xff098200,
35390xd6e00000,
35400x022a5021,
35410x964e0000,
35420xff098200,
35430xd5420000,
35440x3c0f0000,
35450xff090200,
35460x2d810000,
35470xff098200,
35480x000e7080,
35490xff000000,
35500x10200000,
35510xff050805,
35520xff000000,
35530x10200000,
35540xff050801,
35550xff000000,
35560x01cf7021,
35570x46220032,
35580xff000000,
35590x00007001,
35600x024e9021,
35610xff06000b,
35620xff000000,
35630x00017001,
35640xff06000b,
35650x024e9021,
35660xff000000,
35670x8e4b0000,
35680x26520004,
35690x316d00ff,
35700x000d6880,
35710x026d6021,
35720x000b5402,
35730x8d810000,
35740x000bb942,
35750x000a50c0,
35760x00200008,
35770x32f707f8,
35780xff000000,
35790xff06000f,
35800x24010000,
35810xff098200,
35820x11810000,
35830xff05083b,
35840x00000000,
35850x10000000,
35860xff05080b,
35870x00000000,
35880xff000000,
35890x0217b821,
35900x000a68c2,
35910x8eec0000,
35920xff098200,
35930x964e0000,
35940xff098200,
35950x01a06827,
35960x26520004,
35970xff000000,
35980x24010000,
35990xff098200,
36000x11810000,
36010xff05083b,
36020xff000000,
36030x018d6026,
36040x000e7080,
36050x3c0f0000,
36060xff090200,
36070x01cf7021,
36080xff000000,
36090x000c700b,
36100xff000000,
36110x000c700a,
36120xff000000,
36130x024e9021,
36140x8e4b0000,
36150x26520004,
36160x316d00ff,
36170x000d6880,
36180x026d6021,
36190x000b5402,
36200x8d810000,
36210x000bb942,
36220x000a50c0,
36230x00200008,
36240x32f707f8,
36250xff000000,
36260x020a5021,
36270x964e0000,
36280xff098200,
36290x8d4c0000,
36300xff098200,
36310x26520004,
36320xff000000,
36330x2d8c0000,
36340xff098200,
36350x000e7080,
36360x3c0f0000,
36370xff090200,
36380x01cf7021,
36390xff000000,
36400x000c700a,
36410xff000000,
36420x000c700b,
36430xff000000,
36440x024e9021,
36450xff000000,
36460x2d8c0000,
36470xff098200,
36480xd5400000,
36490xff000000,
36500x11800000,
36510xff050801,
36520xff000000,
36530x15800000,
36540xff050801,
36550xff000000,
36560x0217b821,
36570x000e7080,
36580x3c0f0000,
36590xff090200,
36600x01cf7021,
36610xf6e00000,
36620x024e9021,
36630xff06000b,
36640xff000000,
36650x8e4b0000,
36660x26520004,
36670x316d00ff,
36680x000d6880,
36690x026d6021,
36700x000b5402,
36710x8d810000,
36720x000bb942,
36730x000a50c0,
36740x00200008,
36750x32f707f8,
36760xff000000,
36770x020a5021,
36780x0217b821,
36790xd5400000,
36800x8e4b0000,
36810x26520004,
36820xf6e00000,
36830x316d00ff,
36840x000d6880,
36850x026d6021,
36860x000b5402,
36870x8d810000,
36880x000bb942,
36890x000a50c0,
36900x00200008,
36910x32f707f8,
36920xff000000,
36930x020a5021,
36940x0217b821,
36950x8d4c0000,
36960xff098200,
36970x240d0000,
36980xff098200,
36990x2d8c0000,
37000xff098200,
37010x258d0000,
37020xff098200,
37030x8e4b0000,
37040x26520004,
37050xaeed0000,
37060xff098200,
37070x316d00ff,
37080x000d6880,
37090x026d6021,
37100x000b5402,
37110x8d810000,
37120x000bb942,
37130x000a50c0,
37140x00200008,
37150x32f707f8,
37160xff000000,
37170x020a3021,
37180x0217b821,
37190x8ccc0000,
37200xff098200,
37210xd4c00000,
37220x2d810000,
37230xff098200,
37240x10200000,
37250xff05083c,
37260x46200007,
37270x8e4b0000,
37280x26520004,
37290xf6e00000,
37300x316d00ff,
37310x000d6880,
37320x026d6021,
37330x000b5402,
37340x8d810000,
37350x000bb942,
37360x000a50c0,
37370x00200008,
37380x32f707f8,
37390xff000000,
37400x020a2821,
37410x0217b821,
37420x8cac0000,
37430xff098200,
37440x8ca40000,
37450xff098200,
37460x24010000,
37470xff098200,
37480x15810000,
37490xff050802,
37500x24010000,
37510xff098200,
37520x8c820000,
37530xff098200,
37540xff06000b,
37550x44820000,
37560x46800021,
37570x8e4b0000,
37580x26520004,
37590xf6e00000,
37600x316d00ff,
37610x000d6880,
37620x026d6021,
37630x000b5402,
37640x8d810000,
37650x000bb942,
37660x000a50c0,
37670x00200008,
37680x32f707f8,
37690xff06000c,
37700x15810000,
37710xff05083e,
37720x00000000,
37730xff000000,
37740x8c8e0000,
37750xff098200,
37760x15c00000,
37770xff050809,
37780x00000000,
37790xff06000d,
37800xff000000,
37810xff06003f,
37820x8e790000,
37830xff098200,
37840x0320f809,
37850x00000000,
37860x10000000,
37870xff05080b,
37880x00000000,
37890xff000000,
37900xff060013,
37910x91cc0000,
37920xff098200,
37930x318c0000,
37940xff090200,
37950x15800000,
37960xff05080d,
37970x00000000,
37980x10000000,
37990xff05083e,
38000x00000000,
38010xff000000,
38020x000b4542,
38030x310807f8,
38040x314907f8,
38050xff000000,
38060x02083021,
38070x02293821,
38080x8ccd0000,
38090xff098200,
38100xd4d40000,
38110xd4f60000,
38120x2da10000,
38130xff098200,
38140xff000000,
38150x02083821,
38160x02293021,
38170x8ced0000,
38180xff098200,
38190xd4f60000,
38200xd4d40000,
38210x2da10000,
38220xff098200,
38230xff000000,
38240x02083021,
38250x02093821,
38260x8ccd0000,
38270xff098200,
38280x8cee0000,
38290xff098200,
38300xd4d40000,
38310xd4f60000,
38320x2da10000,
38330xff098200,
38340x2dcc0000,
38350xff098200,
38360x002c0824,
38370xff000000,
38380x10200000,
38390xff05083d,
38400x0217b821,
38410x4636a000,
38420x8e4b0000,
38430x26520004,
38440xf6e00000,
38450x316d00ff,
38460x000d6880,
38470x026d6021,
38480x000b5402,
38490x8d810000,
38500x000bb942,
38510x000a50c0,
38520x00200008,
38530x32f707f8,
38540xff000000,
38550x000b4542,
38560x310807f8,
38570x314907f8,
38580xff000000,
38590x02083021,
38600x02293821,
38610x8ccd0000,
38620xff098200,
38630xd4d40000,
38640xd4f60000,
38650x2da10000,
38660xff098200,
38670xff000000,
38680x02083821,
38690x02293021,
38700x8ced0000,
38710xff098200,
38720xd4f60000,
38730xd4d40000,
38740x2da10000,
38750xff098200,
38760xff000000,
38770x02083021,
38780x02093821,
38790x8ccd0000,
38800xff098200,
38810x8cee0000,
38820xff098200,
38830xd4d40000,
38840xd4f60000,
38850x2da10000,
38860xff098200,
38870x2dcc0000,
38880xff098200,
38890x002c0824,
38900xff000000,
38910x10200000,
38920xff05083d,
38930x0217b821,
38940x4636a001,
38950x8e4b0000,
38960x26520004,
38970xf6e00000,
38980x316d00ff,
38990x000d6880,
39000x026d6021,
39010x000b5402,
39020x8d810000,
39030x000bb942,
39040x000a50c0,
39050x00200008,
39060x32f707f8,
39070xff000000,
39080x000b4542,
39090x310807f8,
39100x314907f8,
39110xff000000,
39120x02083021,
39130x02293821,
39140x8ccd0000,
39150xff098200,
39160xd4d40000,
39170xd4f60000,
39180x2da10000,
39190xff098200,
39200xff000000,
39210x02083821,
39220x02293021,
39230x8ced0000,
39240xff098200,
39250xd4f60000,
39260xd4d40000,
39270x2da10000,
39280xff098200,
39290xff000000,
39300x02083021,
39310x02093821,
39320x8ccd0000,
39330xff098200,
39340x8cee0000,
39350xff098200,
39360xd4d40000,
39370xd4f60000,
39380x2da10000,
39390xff098200,
39400x2dcc0000,
39410xff098200,
39420x002c0824,
39430xff000000,
39440x10200000,
39450xff05083d,
39460x0217b821,
39470x4636a002,
39480x8e4b0000,
39490x26520004,
39500xf6e00000,
39510x316d00ff,
39520x000d6880,
39530x026d6021,
39540x000b5402,
39550x8d810000,
39560x000bb942,
39570x000a50c0,
39580x00200008,
39590x32f707f8,
39600xff000000,
39610x000b4542,
39620x310807f8,
39630x314907f8,
39640xff000000,
39650x02083021,
39660x02293821,
39670x8ccd0000,
39680xff098200,
39690xd4d40000,
39700xd4f60000,
39710x2da10000,
39720xff098200,
39730xff000000,
39740x02083821,
39750x02293021,
39760x8ced0000,
39770xff098200,
39780xd4f60000,
39790xd4d40000,
39800x2da10000,
39810xff098200,
39820xff000000,
39830x02083021,
39840x02093821,
39850x8ccd0000,
39860xff098200,
39870x8cee0000,
39880xff098200,
39890xd4d40000,
39900xd4f60000,
39910x2da10000,
39920xff098200,
39930x2dcc0000,
39940xff098200,
39950x002c0824,
39960xff000000,
39970x10200000,
39980xff05083d,
39990x0217b821,
40000x4636a003,
40010x8e4b0000,
40020x26520004,
40030xf6e00000,
40040x316d00ff,
40050x000d6880,
40060x026d6021,
40070x000b5402,
40080x8d810000,
40090x000bb942,
40100x000a50c0,
40110x00200008,
40120x32f707f8,
40130xff000000,
40140x000b4542,
40150x310807f8,
40160x314907f8,
40170xff000000,
40180x02083021,
40190x02293821,
40200x8ccd0000,
40210xff098200,
40220xd4d40000,
40230xd4f60000,
40240x2da10000,
40250xff098200,
40260xff000000,
40270x02083821,
40280x02293021,
40290x8ced0000,
40300xff098200,
40310xd4f60000,
40320xd4d40000,
40330x2da10000,
40340xff098200,
40350xff000000,
40360x02083021,
40370x02093821,
40380x8ccd0000,
40390xff098200,
40400x8cee0000,
40410xff098200,
40420xd4d40000,
40430xd4f60000,
40440x2da10000,
40450xff098200,
40460x2dcc0000,
40470xff098200,
40480x002c0824,
40490xff000000,
40500x10200000,
40510xff05083d,
40520x0217b821,
40530xff060098,
40540x04110000,
40550xff05085b,
40560x4636a303,
40570x46360002,
40580x4620a001,
40590x8e4b0000,
40600x26520004,
40610xf6e00000,
40620x316d00ff,
40630x000d6880,
40640x026d6021,
40650x000b5402,
40660x8d810000,
40670x000bb942,
40680x000a50c0,
40690x00200008,
40700x32f707f8,
40710xff000000,
40720x000b4542,
40730x310807f8,
40740x314907f8,
40750xff000000,
40760x02083021,
40770x02293821,
40780x8ccd0000,
40790xff098200,
40800xd4d40000,
40810xd4f60000,
40820x2da10000,
40830xff098200,
40840xff000000,
40850x02083821,
40860x02293021,
40870x8ced0000,
40880xff098200,
40890xd4f60000,
40900xd4d40000,
40910x2da10000,
40920xff098200,
40930xff000000,
40940x02083021,
40950x02093821,
40960x8ccd0000,
40970xff098200,
40980x8cee0000,
40990xff098200,
41000xd4d40000,
41010xd4f60000,
41020x2da10000,
41030xff098200,
41040x2dcc0000,
41050xff098200,
41060x002c0824,
41070xff000000,
41080x10200000,
41090xff05083d,
41100x0217b821,
41110x10000000,
41120xff050898,
41130x00000000,
41140xff000000,
41150x000b4542,
41160x310807f8,
41170x314907f8,
41180x02083021,
41190x02093821,
41200x8ccd0000,
41210xff098200,
41220x8cee0000,
41230xff098200,
41240xd4cc0000,
41250xd4ee0000,
41260x2da10000,
41270xff098200,
41280x2dcc0000,
41290xff098200,
41300x002c0824,
41310x8e790000,
41320xff098200,
41330x10200000,
41340xff05083d,
41350x0217b821,
41360x0320f809,
41370x00000000,
41380x8e4b0000,
41390x26520004,
41400xf6e00000,
41410x316d00ff,
41420x000d6880,
41430x026d6021,
41440x000b5402,
41450x8d810000,
41460x000bb942,
41470x000a50c0,
41480x00200008,
41490x32f707f8,
41500xff000000,
41510x000b4542,
41520x310807f8,
41530x314907f8,
41540x01283023,
41550xae900000,
41560xff098200,
41570x02092821,
41580x0100a821,
41590xff06002b,
41600x8e790000,
41610xff098200,
41620x000630c2,
41630xafb20014,
41640x0320f809,
41650x02802021,
41660x14400000,
41670xff050836,
41680x8e900000,
41690xff098200,
41700x02154021,
41710xd5000000,
41720x0217b821,
41730x8e4b0000,
41740x26520004,
41750xf6e00000,
41760x316d00ff,
41770x000d6880,
41780x026d6021,
41790x000b5402,
41800x8d810000,
41810x000bb942,
41820x000a50c0,
41830x00200008,
41840x32f707f8,
41850xff000000,
41860x000a6842,
41870x022d6823,
41880x8e4b0000,
41890x26520004,
41900x8dacfffc,
41910x0217b821,
41920x240e0000,
41930xff098200,
41940xaeec0000,
41950xff098200,
41960xaeee0000,
41970xff098200,
41980x316d00ff,
41990x000d6880,
42000x026d6021,
42010x000b5402,
42020x8d810000,
42030x000bb942,
42040x000a50c0,
42050x00200008,
42060x32f707f8,
42070xff000000,
42080x000a6842,
42090x022d6823,
42100x8e4b0000,
42110x26520004,
42120x8dacfffc,
42130x0217b821,
42140x240e0000,
42150xff098200,
42160xaeec0000,
42170xff098200,
42180xaeee0000,
42190xff098200,
42200x316d00ff,
42210x000d6880,
42220x026d6021,
42230x000b5402,
42240x8d810000,
42250x000bb942,
42260x000a50c0,
42270x00200008,
42280x32f707f8,
42290xff000000,
42300x000b5403,
42310x448a0000,
42320x0217b821,
42330x46800021,
42340x8e4b0000,
42350x26520004,
42360xf6e00000,
42370x316d00ff,
42380x000d6880,
42390x026d6021,
42400x000b5402,
42410x8d810000,
42420x000bb942,
42430x000a50c0,
42440x00200008,
42450x32f707f8,
42460xff000000,
42470x022a5021,
42480x0217b821,
42490xd5400000,
42500x8e4b0000,
42510x26520004,
42520xf6e00000,
42530x316d00ff,
42540x000d6880,
42550x026d6021,
42560x000b5402,
42570x8d810000,
42580x000bb942,
42590x000a50c0,
42600x00200008,
42610x32f707f8,
42620xff000000,
42630x000a68c2,
42640x0217b821,
42650x01a06027,
42660x8e4b0000,
42670x26520004,
42680xaeec0000,
42690xff098200,
42700x316d00ff,
42710x000d6880,
42720x026d6021,
42730x000b5402,
42740x8d810000,
42750x000bb942,
42760x000a50c0,
42770x00200008,
42780x32f707f8,
42790xff000000,
42800x0217b821,
42810xaefe0000,
42820xff098200,
42830x26f70008,
42840x020a5021,
42850xff06000b,
42860xaefe0000,
42870xff098200,
42880x02ea082a,
42890x14200000,
42900xff05080b,
42910x26f70008,
42920x8e4b0000,
42930x26520004,
42940x316d00ff,
42950x000d6880,
42960x026d6021,
42970x000b5402,
42980x8d810000,
42990x000bb942,
43000x000a50c0,
43010x00200008,
43020x32f707f8,
43030xff000000,
43040x8e080000,
43050xff098200,
43060x000a5042,
43070x01485021,
43080x8d480000,
43090xff098200,
43100x8e4b0000,
43110x26520004,
43120x8d0d0000,
43130xff098200,
43140xd5a00000,
43150x0217b821,
43160xf6e00000,
43170x316d00ff,
43180x000d6880,
43190x026d6021,
43200x000b5402,
43210x8d810000,
43220x000bb942,
43230x000a50c0,
43240x00200008,
43250x32f707f8,
43260xff000000,
43270x8e080000,
43280xff098200,
43290x0017b842,
43300x020a5021,
43310x02e8b821,
43320xd5400000,
43330x8ee80000,
43340xff098200,
43350x910f0000,
43360xff098200,
43370x8d050000,
43380xff098200,
43390x31ef0000,
43400xff090200,
43410x910c0000,
43420xff098200,
43430x8d4e0000,
43440xff098200,
43450xf4a00000,
43460x24010000,
43470xff098200,
43480x01ec7825,
43490x11e10000,
43500xff050802,
43510x25ce0000,
43520xff098200,
43530xff06000b,
43540x8e4b0000,
43550x26520004,
43560x316d00ff,
43570x000d6880,
43580x026d6021,
43590x000b5402,
43600x8d810000,
43610x000bb942,
43620x000a50c0,
43630x00200008,
43640x32f707f8,
43650xff06000c,
43660x2dc10000,
43670xff098200,
43680x10200000,
43690xff05080b,
43700x8d4d0000,
43710xff098200,
43720x91af0000,
43730xff098200,
43740x31ef0000,
43750xff090200,
43760x11e00000,
43770xff05080b,
43780x8e790000,
43790xff098200,
43800x0320f809,
43810x26640000,
43820xff098200,
43830x10000000,
43840xff05080b,
43850x00000000,
43860xff000000,
43870x8e080000,
43880xff098200,
43890x0017b842,
43900x000a6842,
43910x02e8b821,
43920x022d6823,
43930x8ee80000,
43940xff098200,
43950x8dadfffc,
43960x910e0000,
43970xff098200,
43980x8d050000,
43990xff098200,
44000x91af0000,
44010xff098200,
44020x31c10000,
44030xff090200,
44040x910e0000,
44050xff098200,
44060x240c0000,
44070xff098200,
44080xacad0000,
44090xff098200,
44100x14200000,
44110xff050802,
44120xacac0000,
44130xff098200,
44140xff06000b,
44150x8e4b0000,
44160x26520004,
44170x316d00ff,
44180x000d6880,
44190x026d6021,
44200x000b5402,
44210x8d810000,
44220x000bb942,
44230x000a50c0,
44240x00200008,
44250x32f707f8,
44260xff06000c,
44270x11c00000,
44280xff05080b,
44290x31e10000,
44300xff090200,
44310x10200000,
44320xff05080b,
44330x8e790000,
44340xff098200,
44350x0320f809,
44360x26640000,
44370xff098200,
44380x10000000,
44390xff05080b,
44400x00000000,
44410xff000000,
44420x8e080000,
44430xff098200,
44440x0017b842,
44450x022a5021,
44460x02e8b821,
44470xd5400000,
44480x8ee80000,
44490xff098200,
44500x8e4b0000,
44510x26520004,
44520x8d0d0000,
44530xff098200,
44540xf5a00000,
44550x316d00ff,
44560x000d6880,
44570x026d6021,
44580x000b5402,
44590x8d810000,
44600x000bb942,
44610x000a50c0,
44620x00200008,
44630x32f707f8,
44640xff000000,
44650x8e080000,
44660xff098200,
44670x0017b842,
44680x000a60c2,
44690x02e8b821,
44700x01806027,
44710x8ee80000,
44720xff098200,
44730x8e4b0000,
44740x26520004,
44750x8d0d0000,
44760xff098200,
44770xadac0000,
44780xff098200,
44790x316d00ff,
44800x000d6880,
44810x026d6021,
44820x000b5402,
44830x8d810000,
44840x000bb942,
44850x000a50c0,
44860x00200008,
44870x32f707f8,
44880xff000000,
44890x8e8e0000,
44900xff098200,
44910x000a6042,
44920x3c010000,
44930xff090200,
44940x01816021,
44950x024c9021,
44960x8e790000,
44970xff098200,
44980xae900000,
44990xff098200,
45000x11c00000,
45010xff050801,
45020x02802021,
45030x0320f809,
45040x02172821,
45050x8e900000,
45060xff098200,
45070xff06000b,
45080x8e4b0000,
45090x26520004,
45100x316d00ff,
45110x000d6880,
45120x026d6021,
45130x000b5402,
45140x8d810000,
45150x000bb942,
45160x000a50c0,
45170x00200008,
45180x32f707f8,
45190xff000000,
45200x000a6842,
45210x8e790000,
45220xff098200,
45230x022d6823,
45240x8e060000,
45250xff098200,
45260x8da5fffc,
45270xae900000,
45280xff098200,
45290xafb20014,
45300x0320f809,
45310x02802021,
45320x8e900000,
45330xff098200,
45340x240c0000,
45350xff098200,
45360x8e4b0000,
45370x26520004,
45380x0217b821,
45390xaeec0000,
45400xff098200,
45410xaee20000,
45420xff098200,
45430x316d00ff,
45440x000d6880,
45450x026d6021,
45460x000b5402,
45470x8d810000,
45480x000bb942,
45490x000a50c0,
45500x00200008,
45510x32f707f8,
45520xff000000,
45530x8e6c0000,
45540xff098200,
45550x8e6d0000,
45560xff098200,
45570xae900000,
45580xff098200,
45590xafb20014,
45600x018d082b,
45610x10200000,
45620xff050805,
45630xff06000b,
45640xff000000,
45650x8e790000,
45660xff098200,
45670x000a28c2,
45680x30a507ff,
45690x240c0801,
45700x24a1f801,
45710x000a3382,
45720x0181280a,
45730x0320f809,
45740x02802021,
45750xff000000,
45760x8e790000,
45770xff098200,
45780x000a6842,
45790x022d6823,
45800x02802021,
45810x0320f809,
45820x8da5fffc,
45830xff000000,
45840x8e900000,
45850xff098200,
45860x8e4b0000,
45870x26520004,
45880x0217b821,
45890x240c0000,
45900xff098200,
45910xaee20000,
45920xff098200,
45930xaeec0000,
45940xff098200,
45950x316d00ff,
45960x000d6880,
45970x026d6021,
45980x000b5402,
45990x8d810000,
46000x000bb942,
46010x000a50c0,
46020x00200008,
46030x32f707f8,
46040xff06000f,
46050x8e790000,
46060xff098200,
46070x0140a821,
46080x0320f809,
46090x02802021,
46100x10000000,
46110xff05080b,
46120x02a05021,
46130xff000000,
46140x8e0e0000,
46150xff098200,
46160x000a6842,
46170x022d6823,
46180x8dc80000,
46190xff098200,
46200x8da9fffc,
46210xff000000,
46220x10000000,
46230xff050899,
46240xff000000,
46250x10000000,
46260xff05089a,
46270xff000000,
46280x0217b821,
46290xff000000,
46300x000b4542,
46310x310807f8,
46320x314907f8,
46330x02082821,
46340x02093021,
46350x8cad0000,
46360xff098200,
46370x8cce0000,
46380xff098200,
46390x8ca80000,
46400xff098200,
46410x24010000,
46420xff098200,
46430xd4c00000,
46440x15a10000,
46450xff050830,
46460x0217b821,
46470x2dc10000,
46480xff098200,
46490x10200000,
46500xff050805,
46510x24010000,
46520xff098200,
46530x462000a4,
46540x8d0c0000,
46550xff098200,
46560x440e1000,
46570x46801121,
46580x8d0d0000,
46590xff098200,
46600x46240032,
46610x01cc082b,
46620x00000801,
46630x000e70c0,
46640x10200000,
46650xff050830,
46660x01ae7021,
46670x8dcc0000,
46680xff098200,
46690x119e0000,
46700xff050802,
46710xd5c00000,
46720xff06000b,
46730x8e4b0000,
46740x26520004,
46750xf6e00000,
46760x316d00ff,
46770x000d6880,
46780x026d6021,
46790x000b5402,
46800x8d810000,
46810x000bb942,
46820x000a50c0,
46830x00200008,
46840x32f707f8,
46850xff06000c,
46860x8d0e0000,
46870xff098200,
46880x11c00000,
46890xff05080b,
46900x00000000,
46910x91cc0000,
46920xff098200,
46930x318c0000,
46940xff090200,
46950x15800000,
46960xff05080b,
46970x00000000,
46980x10000000,
46990xff050830,
47000x00000000,
47010xff06000f,
47020x15c10000,
47030xff050830,
47040xff000000,
47050x8cc90000,
47060xff098200,
47070x10000000,
47080xff050899,
47090x00000000,
47100xff000000,
47110x000b4542,
47120x310807f8,
47130x02082821,
47140x000b4b82,
47150x8cac0000,
47160xff098200,
47170x312903fc,
47180x24010000,
47190xff098200,
47200x8ca80000,
47210xff098200,
47220x02293023,
47230x8cc9fffc,
47240x15810000,
47250xff05082d,
47260x0217b821,
47270xff060099,
47280x8d0c0000,
47290xff098200,
47300x8d2d0000,
47310xff098200,
47320x8d0e0000,
47330xff098200,
47340x01ac6824,
47350x000d6140,
47360x000d68c0,
47370x018d6823,
47380x01cd7021,
47390xff06000b,
47400x8dc40000,
47410xff098200,
47420x8dcc0000,
47430xff098200,
47440x8dcd0000,
47450xff098200,
47460x8dc50000,
47470xff098200,
47480x24840000,
47490xff098200,
47500x01896026,
47510x008c0825,
47520x14200000,
47530xff050804,
47540x8d0f0000,
47550xff098200,
47560x10be0000,
47570xff050805,
47580x8dc40000,
47590xff098200,
47600xff06000d,
47610x8e4b0000,
47620x26520004,
47630xaee50000,
47640xff098200,
47650xaee40000,
47660xff098200,
47670x316d00ff,
47680x000d6880,
47690x026d6021,
47700x000b5402,
47710x8d810000,
47720x000bb942,
47730x000a50c0,
47740x00200008,
47750x32f707f8,
47760xff06000e,
47770x15a00000,
47780xff05080b,
47790xff000000,
47800x01a07021,
47810xff06000f,
47820x11e00000,
47830xff05080d,
47840x24050000,
47850xff098200,
47860x91ec0000,
47870xff098200,
47880x318c0000,
47890xff090200,
47900x15800000,
47910xff05080d,
47920x00000000,
47930x10000000,
47940xff05082e,
47950x00000000,
47960xff000000,
47970x000b4542,
47980x310807f8,
47990x02082821,
48000x314907f8,
48010x8ca40000,
48020xff098200,
48030x24010000,
48040xff098200,
48050x8ca80000,
48060xff098200,
48070x0217b821,
48080x14810000,
48090xff05082f,
48100x000960c2,
48110x8d0d0000,
48120xff098200,
48130x8d0e0000,
48140xff098200,
48150x018d082b,
48160x10200000,
48170xff05082f,
48180x01c94821,
48190x8d2d0000,
48200xff098200,
48210x11be0000,
48220xff050805,
48230xd5200000,
48240xff06000b,
48250x8e4b0000,
48260x26520004,
48270xf6e00000,
48280x316d00ff,
48290x000d6880,
48300x026d6021,
48310x000b5402,
48320x8d810000,
48330x000bb942,
48340x000a50c0,
48350x00200008,
48360x32f707f8,
48370xff06000f,
48380x8d0e0000,
48390xff098200,
48400x11c00000,
48410xff05080b,
48420x00000000,
48430x91cd0000,
48440xff098200,
48450x31ad0000,
48460xff090200,
48470x15a00000,
48480xff05080b,
48490x00000000,
48500x10000000,
48510xff05082f,
48520x00000000,
48530xff000000,
48540x000b4542,
48550x310807f8,
48560x314907f8,
48570x02082821,
48580x02093021,
48590x8cad0000,
48600xff098200,
48610x8cce0000,
48620xff098200,
48630x8ca80000,
48640xff098200,
48650x24010000,
48660xff098200,
48670xd4c00000,
48680x15a10000,
48690xff050834,
48700x0217b821,
48710x2dc10000,
48720xff098200,
48730x10200000,
48740xff050805,
48750x24010000,
48760xff098200,
48770x462000a4,
48780x8d0c0000,
48790xff098200,
48800x440e1000,
48810x46801121,
48820x8d0d0000,
48830xff098200,
48840x46240032,
48850x01cc082b,
48860x00000801,
48870x000e70c0,
48880x10200000,
48890xff050834,
48900x01ae6821,
48910x910f0000,
48920xff098200,
48930x8dac0000,
48940xff098200,
48950x119e0000,
48960xff050803,
48970xd6e00000,
48980xff06000b,
48990x31e10000,
49000xff090200,
49010x14200000,
49020xff050807,
49030xf5a00000,
49040xff06000c,
49050x8e4b0000,
49060x26520004,
49070x316d00ff,
49080x000d6880,
49090x026d6021,
49100x000b5402,
49110x8d810000,
49120x000bb942,
49130x000a50c0,
49140x00200008,
49150x32f707f8,
49160xff06000d,
49170x8d0e0000,
49180xff098200,
49190x11c00000,
49200xff05080b,
49210x00000000,
49220x91ce0000,
49230xff098200,
49240x31ce0000,
49250xff090200,
49260xff000000,
49270x15c00000,
49280xff05080b,
49290x00000000,
49300x10000000,
49310xff050834,
49320x00000000,
49330xff06000f,
49340x15c10000,
49350xff050834,
49360x8cc90000,
49370xff098200,
49380x10000000,
49390xff05089a,
49400x00000000,
49410xff060011,
49420x8e6c0000,
49430xff098200,
49440x31ef0000,
49450xff090200,
49460xae680000,
49470xff098200,
49480xa10f0000,
49490xff098200,
49500x10000000,
49510xff05080c,
49520xad0c0000,
49530xff098200,
49540xff000000,
49550x000b4542,
49560x310807f8,
49570x02082821,
49580x000b4b82,
49590x8cac0000,
49600xff098200,
49610x312903fc,
49620x24010000,
49630xff098200,
49640x02293023,
49650x8ca80000,
49660xff098200,
49670x8cc9fffc,
49680x15810000,
49690xff050831,
49700x0217b821,
49710xff06009a,
49720x8d0c0000,
49730xff098200,
49740x8d2d0000,
49750xff098200,
49760x8d0e0000,
49770xff098200,
49780xa1000000,
49790xff098200,
49800x01ac6824,
49810x000d6140,
49820x000d68c0,
49830x018d6823,
49840x01cd7021,
49850xd6f40000,
49860xff06000b,
49870x8dc40000,
49880xff098200,
49890x8dcc0000,
49900xff098200,
49910x24010000,
49920xff098200,
49930x8dcd0000,
49940xff098200,
49950x14810000,
49960xff050805,
49970x8dc50000,
49980xff098200,
49990x15890000,
50000xff050805,
50010x910f0000,
50020xff098200,
50030x10be0000,
50040xff050804,
50050x8d0c0000,
50060xff098200,
50070xff06000c,
50080x31e10000,
50090xff090200,
50100x14200000,
50110xff050807,
50120xff000000,
50130xf5d40000,
50140xff098200,
50150xff06000d,
50160x8e4b0000,
50170x26520004,
50180x316d00ff,
50190x000d6880,
50200x026d6021,
50210x000b5402,
50220x8d810000,
50230x000bb942,
50240x000a50c0,
50250x00200008,
50260x32f707f8,
50270xff06000e,
50280x11800000,
50290xff05080c,
50300x00000000,
50310x918c0000,
50320xff098200,
50330x318c0000,
50340xff090200,
50350x15800000,
50360xff05080c,
50370x00000000,
50380x10000000,
50390xff050832,
50400x00000000,
50410xff06000f,
50420x15a00000,
50430xff05080b,
50440x01a07021,
50450x8d0e0000,
50460xff098200,
50470x11c00000,
50480xff050806,
50490x26660000,
50500xff098200,
50510x91cc0000,
50520xff098200,
50530x318c0000,
50540xff090200,
50550x11800000,
50560xff050832,
50570x24010000,
50580xff098200,
50590xff060010,
50600x8e790000,
50610xff098200,
50620xacc90000,
50630xff098200,
50640xacc10000,
50650xff098200,
50660xae900000,
50670xff098200,
50680x01002821,
50690xafb20014,
50700x0320f809,
50710x02802021,
50720x8e900000,
50730xff098200,
50740xff000000,
50750x10000000,
50760xff05080d,
50770xf4540000,
50780xff060011,
50790x8e6c0000,
50800xff098200,
50810x31ef0000,
50820xff090200,
50830xae680000,
50840xff098200,
50850xa10f0000,
50860xff098200,
50870x10000000,
50880xff05080d,
50890xad0c0000,
50900xff098200,
50910xff000000,
50920x000b4542,
50930x310807f8,
50940x02082821,
50950x314907f8,
50960x8ca40000,
50970xff098200,
50980x24010000,
50990xff098200,
51000x8ca80000,
51010xff098200,
51020x0217b821,
51030x14810000,
51040xff050833,
51050x000960c2,
51060x8d0d0000,
51070xff098200,
51080x8d0e0000,
51090xff098200,
51100x018d082b,
51110x10200000,
51120xff050833,
51130x01c94821,
51140x8d2d0000,
51150xff098200,
51160x910f0000,
51170xff098200,
51180x11be0000,
51190xff050805,
51200xd6e00000,
51210xff06000b,
51220x31e10000,
51230xff090200,
51240x14200000,
51250xff050807,
51260xf5200000,
51270xff06000c,
51280x8e4b0000,
51290x26520004,
51300x316d00ff,
51310x000d6880,
51320x026d6021,
51330x000b5402,
51340x8d810000,
51350x000bb942,
51360x000a50c0,
51370x00200008,
51380x32f707f8,
51390xff06000f,
51400x8d0e0000,
51410xff098200,
51420x11c00000,
51430xff05080b,
51440x00000000,
51450x91cd0000,
51460xff098200,
51470x31ad0000,
51480xff090200,
51490x15a00000,
51500xff05080b,
51510x00000000,
51520x10000000,
51530xff050833,
51540x00000000,
51550xff060011,
51560x8e6c0000,
51570xff098200,
51580xff000000,
51590x31ef0000,
51600xff090200,
51610xae680000,
51620xff098200,
51630xa10f0000,
51640xff098200,
51650x10000000,
51660xff05080c,
51670xad0c0000,
51680xff098200,
51690xff000000,
51700x0217b821,
51710xff06000b,
51720x022a7821,
51730x8ee50000,
51740xff098200,
51750x26acfff8,
51760x8def0000,
51770xff098200,
51780x11800000,
51790xff050804,
51800x000c30c2,
51810x00cf3021,
51820x8cae0000,
51830xff098200,
51840x000f68c0,
51850x90af0000,
51860xff098200,
51870x8ca40000,
51880xff098200,
51890x01c6082b,
51900x14200000,
51910xff050805,
51920x02ec7021,
51930x01a46821,
51940x31ec0000,
51950xff090200,
51960xff06000d,
51970xd6e00000,
51980x26f70008,
51990x02ee082b,
52000xf5a00000,
52010x14200000,
52020xff05080d,
52030x25ad0008,
52040x15800000,
52050xff050807,
52060x00000000,
52070xff06000e,
52080x8e4b0000,
52090x26520004,
52100x316d00ff,
52110x000d6880,
52120x026d6021,
52130x000b5402,
52140x8d810000,
52150x000bb942,
52160x000a50c0,
52170x00200008,
52180x32f707f8,
52190xff06000f,
52200x8e790000,
52210xff098200,
52220xae900000,
52230xff098200,
52240xafb20014,
52250x01408021,
52260x0320f809,
52270x02802021,
52280x02005021,
52290x10000000,
52300xff05080b,
52310x8e900000,
52320xff098200,
52330xff060011,
52340x8e6c0000,
52350xff098200,
52360x31ef0000,
52370xff090200,
52380xae650000,
52390xff098200,
52400xa0af0000,
52410xff098200,
52420xff000000,
52430x10000000,
52440xff05080e,
52450xacac0000,
52460xff098200,
52470xff000000,
52480x314907f8,
52490x10000000,
52500xff05089b,
52510x01354821,
52520xff000000,
52530x314907f8,
52540xff06009b,
52550x02007021,
52560x02178021,
52570x24010000,
52580xff098200,
52590x8e0c0000,
52600xff098200,
52610x8e080000,
52620xff098200,
52630x26100008,
52640x15810000,
52650xff050825,
52660x2529fff8,
52670xae120000,
52680xff098200,
52690x8d120000,
52700xff098200,
52710x8e4b0000,
52720x26520004,
52730x316d00ff,
52740x000bb942,
52750x000d6880,
52760x32f707f8,
52770x026d6021,
52780x8d8c0000,
52790x01800008,
52800x02f0b821,
52810xff000000,
52820x01555021,
52830xff000000,
52840x0217b821,
52850x24010000,
52860xff098200,
52870x8eec0000,
52880xff098200,
52890x8ee80000,
52900xff098200,
52910x01404821,
52920x8e0d0000,
52930xff098200,
52940x26f70008,
52950x15810000,
52960xff050840,
52970x2529fff8,
52980xff060041,
52990x31ac0000,
53000xff090200,
53010x910f0000,
53020xff098200,
53030x15800000,
53040xff050807,
53050x39ae0000,
53060xff090200,
53070xff06000b,
53080xae080000,
53090xff098200,
53100x2de10002,
53110x02007021,
53120x11200000,
53130xff050803,
53140x01207821,
53150xff06000c,
53160xd6e00000,
53170x26f70008,
53180x25effff8,
53190xf5c00000,
53200x15e00000,
53210xff05080c,
53220x25ce0008,
53230xff06000d,
53240x01816025,
53250x11800000,
53260xff050805,
53270x00000000,
53280xff06000e,
53290x8d120000,
53300xff098200,
53310x8e4b0000,
53320x26520004,
53330x316d00ff,
53340x000bb942,
53350x000d6880,
53360x32f707f8,
53370x026d6021,
53380x8d8c0000,
53390x01800008,
53400x02f0b821,
53410xff06000f,
53420x8dabfffc,
53430x000bb942,
53440x32f707f8,
53450x02176823,
53460x8dad0000,
53470xff098200,
53480x8dad0000,
53490xff098200,
53500x10000000,
53510xff05080e,
53520xff000000,
53530x8db10000,
53540xff098200,
53550xff060011,
53560x31c10000,
53570xff090200,
53580x14200000,
53590xff05080b,
53600x020e7023,
53610x01c08021,
53620x8dcd0000,
53630xff098200,
53640x10000000,
53650xff05080b,
53660x31ac0000,
53670xff090200,
53680xff000000,
53690x02007021,
53700x02178021,
53710x24010000,
53720xff098200,
53730x8e0d0000,
53740xff098200,
53750x8e080000,
53760xff098200,
53770xd602fff8,
53780xd600fff0,
53790xae0d0000,
53800xff098200,
53810xae080000,
53820xff098200,
53830xf6020010,
53840xf6000008,
53850x26100008,
53860x15a10000,
53870xff050825,
53880x24090010,
53890xae120000,
53900xff098200,
53910x8d120000,
53920xff098200,
53930x8e4b0000,
53940x26520004,
53950x316d00ff,
53960x000bb942,
53970x000d6880,
53980x32f707f8,
53990x026d6021,
54000x8d8c0000,
54010x01800008,
54020x02f0b821,
54030xff000000,
54040x0217b821,
54050x8ee80000,
54060xff098200,
54070x8ee90000,
54080xff098200,
54090x8d0c0000,
54100xff098200,
54110x8d0d0000,
54120xff098200,
54130x26520004,
54140xff06000b,
54150x012c082b,
54160x10200000,
54170xff050805,
54180x000978c0,
54190x01af7821,
54200x8dee0000,
54210xff098200,
54220xd5e00000,
54230x44891000,
54240x964a0000,
54250xff098200,
54260x11de0000,
54270xff05080b,
54280x25290001,
54290x468010a1,
54300x3c0f0000,
54310xff090200,
54320xf6e00008,
54330x000a5080,
54340x014f5021,
54350xaee90000,
54360xff098200,
54370x024a9021,
54380xf6e20000,
54390xff06000d,
54400x8e4b0000,
54410x26520004,
54420x316d00ff,
54430x000d6880,
54440x026d6021,
54450x000b5402,
54460x8d810000,
54470x000bb942,
54480x000a50c0,
54490x00200008,
54500x32f707f8,
54510xff06000f,
54520x8d0d0000,
54530xff098200,
54540x012c4823,
54550x8d0e0000,
54560xff098200,
54570xff060010,
54580x01a9082b,
54590x14200000,
54600xff05080d,
54610x00097940,
54620x000940c0,
54630x01e87823,
54640x01ee7821,
54650x8de80000,
54660xff098200,
54670xd5e00000,
54680x964a0000,
54690xff098200,
54700x111e0000,
54710xff050810,
54720x25290001,
54730xd5e20000,
54740xff098200,
54750x3c0f0000,
54760xff090200,
54770xf6e00008,
54780x012c4821,
54790x000a5080,
54800x014f5021,
54810xf6e20000,
54820x024a9021,
54830x10000000,
54840xff05080d,
54850xff000000,
54860xaee90000,
54870xff098200,
54880xff000000,
54890x0217b821,
54900x8eec0000,
54910xff098200,
54920x8eed0000,
54930xff098200,
54940x8eee0000,
54950xff098200,
54960x8eef0000,
54970xff098200,
54980x24010000,
54990xff098200,
55000x15810000,
55010xff050805,
55020x25ce0000,
55030xff098200,
55040x91ad0000,
55050xff098200,
55060x25ef0000,
55070xff098200,
55080x000a6042,
55090x01cf7025,
55100x25ad0000,
55110xff098200,
55120x024c6021,
55130x01ae6825,
55140x15a00000,
55150xff050805,
55160x3c0e0000,
55170xff090200,
55180x018e9021,
55190xaee00000,
55200xff098200,
55210xff06000b,
55220x8e4b0000,
55230x26520004,
55240x316d00ff,
55250x000d6880,
55260x026d6021,
55270x000b5402,
55280x8d810000,
55290x000bb942,
55300x000a50c0,
55310x00200008,
55320x32f707f8,
55330xff06000f,
55340x240f0000,
55350xff098200,
55360x240d0000,
55370xff098200,
55380xa24f0000,
55390xff098200,
55400x018e9021,
55410x10000000,
55420xff05080b,
55430xa24d0000,
55440xff098200,
55450xff000000,
55460x8e0c0000,
55470xff098200,
55480x314907f8,
55490x000b4542,
55500x02094821,
55510x310807f8,
55520x0217b821,
55530x25290000,
55540xff098200,
55550x02e87021,
55560x260ffff8,
55570x012c4823,
55580x11000000,
55590xff050805,
55600x01e96823,
55610x25cefff0,
55620xff06000b,
55630x8d240000,
55640xff098200,
55650x012f082b,
55660x8d250000,
55670xff098200,
55680x25290008,
55690x03c1200a,
55700xaee40000,
55710xff098200,
55720xaee50000,
55730xff098200,
55740x02ee082b,
55750x14200000,
55760xff05080b,
55770x26f70008,
55780xff06000d,
55790x8e4b0000,
55800x26520004,
55810x316d00ff,
55820x000d6880,
55830x026d6021,
55840x000b5402,
55850x8d810000,
55860x000bb942,
55870x000a50c0,
55880x00200008,
55890x32f707f8,
55900xff06000f,
55910x8e8c0000,
55920xff098200,
55930x19a00000,
55940xff05080d,
55950x24150008,
55960x02ed7021,
55970x018e082b,
55980x14200000,
55990xff050807,
56000x25b50008,
56010xff060010,
56020xd5200000,
56030x25290008,
56040xf6e00000,
56050x012f082b,
56060x14200000,
56070xff050810,
56080x26f70008,
56090x10000000,
56100xff05080d,
56110x00000000,
56120xff060011,
56130x8e790000,
56140xff098200,
56150xae970000,
56160xff098200,
56170x02f0b823,
56180xae900000,
56190xff098200,
56200x01308023,
56210xafb20014,
56220x000d28c2,
56230x0320f809,
56240x02802021,
56250x02004821,
56260x8e900000,
56270xff098200,
56280x0217b821,
56290x02094821,
56300x10000000,
56310xff050810,
56320xff000000,
56330x260ffff8,
56340xff000000,
56350x01555021,
56360xff000000,
56370x8e120000,
56380xff098200,
56390x0217b821,
56400x0140a821,
56410xff06000b,
56420x324c0000,
56430xff090200,
56440x15800000,
56450xff05089c,
56460x3a4d0000,
56470xff090200,
56480xff060017,
56490x8e4bfffc,
56500x260efff8,
56510x2549fff8,
56520x000b6142,
56530x000b4542,
56540x318c07f8,
56550x310807f8,
56560x01c87821,
56570x11200000,
56580xff050803,
56590x01cc8023,
56600xff06000c,
56610xd6e00000,
56620x26f70008,
56630x2529fff8,
56640xf5c00000,
56650x15200000,
56660xff05080c,
56670x25ce0008,
56680xff06000d,
56690x25effff8,
56700xff06000f,
56710x01cf082b,
56720x14200000,
56730xff050806,
56740x8e0d0000,
56750xff098200,
56760x8e4b0000,
56770x26520004,
56780x8dad0000,
56790xff098200,
56800x8db10000,
56810xff098200,
56820x316d00ff,
56830x000d6880,
56840x026d6021,
56850x000b5402,
56860x8d810000,
56870x000bb942,
56880x000a50c0,
56890x00200008,
56900x32f707f8,
56910xff060010,
56920xadde0000,
56930xff098200,
56940x10000000,
56950xff05080f,
56960x25ce0008,
56970xff06009c,
56980x31ae0000,
56990xff090200,
57000x15c00000,
57010xff050818,
57020x00000000,
57030x020d8023,
57040x10000000,
57050xff05080b,
57060x8e120000,
57070xff098200,
57080xff000000,
57090x8e120000,
57100xff098200,
57110x0217b821,
57120x0140a821,
57130x324c0000,
57140xff090200,
57150x15800000,
57160xff05089c,
57170x3a4d0000,
57180xff090200,
57190x8e4bfffc,
57200x260efff8,
57210xff000000,
57220xd6e00000,
57230xff000000,
57240x000b4542,
57250x000bb942,
57260x310807f8,
57270x32f707f8,
57280xff000000,
57290xf5c00000,
57300xff000000,
57310x01d78023,
57320xff06000f,
57330x0148082b,
57340x14200000,
57350xff050806,
57360x8e0d0000,
57370xff098200,
57380x8e4b0000,
57390x26520004,
57400x8dad0000,
57410xff098200,
57420x8db10000,
57430xff098200,
57440x316d00ff,
57450x000d6880,
57460x026d6021,
57470x000b5402,
57480x8d810000,
57490x000bb942,
57500x000a50c0,
57510x00200008,
57520x32f707f8,
57530xff060010,
57540x25ce0008,
57550x254a0008,
57560x10000000,
57570xff05080f,
57580xff000000,
57590xadde0000,
57600xff098200,
57610xff000000,
57620xadde0000,
57630xff098200,
57640xff000000,
57650xf0f0f0f0,
57660xff000000,
57670x0217b821,
57680xff000000,
57690xd6e00000,
57700xff098200,
57710xd6e40000,
57720xff098200,
57730xd6e20000,
57740xff098200,
57750x8eef0000,
57760xff098200,
57770x46240000,
57780xf6e00000,
57790xff098200,
57800xff000000,
57810x8eed0000,
57820xff098200,
57830x8eef0000,
57840xff098200,
57850x8eee0000,
57860xff098200,
57870x2dad0000,
57880xff098200,
57890x2dec0000,
57900xff098200,
57910x2dce0000,
57920xff098200,
57930x01ac6824,
57940x01ae6824,
57950xd6e00000,
57960xff098200,
57970x11a00000,
57980xff050842,
57990xd6e20000,
58000xff098200,
58010xff000000,
58020x000a5042,
58030x3c0c0000,
58040xff090200,
58050xff000000,
58060x4622003e,
58070x4620113e,
58080xf6e00000,
58090xff098200,
58100xff000000,
58110x240d0001,
58120x240e0001,
58130x8e4bfffc,
58140x01e0782a,
58150x00016801,
58160x00057001,
58170x014c9021,
58180x01cf680b,
58190x000b5402,
58200x15a00000,
58210xff070800,
58220x000a50c0,
58230xff000000,
58240x240d0001,
58250x240e0001,
58260x01e0782a,
58270x00006801,
58280x00047001,
58290x01cf680b,
58300x15a00000,
58310xff070800,
58320x00000000,
58330xff000000,
58340x014c6821,
58350x01e0782a,
58360x01a07021,
58370xff000000,
58380x00016801,
58390x00057001,
58400xff000000,
58410x00006801,
58420x00047001,
58430xff000000,
58440x01cf680b,
58450x024d9021,
58460xff000000,
58470x8e4b0000,
58480x26520004,
58490x316d00ff,
58500x000d6880,
58510x026d6021,
58520x000b5402,
58530x8d810000,
58540x000bb942,
58550x000a50c0,
58560x00200008,
58570x32f707f8,
58580xff000000,
58590xf0f0f0f0,
58600xff000000,
58610x0217b821,
58620x8eed0000,
58630xff098200,
58640x11be0000,
58650xff050801,
58660x8eee0000,
58670xff098200,
58680xff000000,
58690xaeed0000,
58700xff098200,
58710x10000000,
58720xff070800,
58730xaeee0000,
58740xff098200,
58750xff000000,
58760x000a6042,
58770x3c010000,
58780xff090200,
58790x01816021,
58800x024c9021,
58810xaeed0000,
58820xff098200,
58830xaeee0000,
58840xff098200,
58850xff000000,
58860xff06000b,
58870x8e4b0000,
58880x26520004,
58890x316d00ff,
58900x000d6880,
58910x026d6021,
58920x000b5402,
58930x8d810000,
58940x000bb942,
58950x000a50c0,
58960x00200008,
58970x32f707f8,
58980xff000000,
58990xf0f0f0f0,
59000xff000000,
59010x8e4b0000,
59020x26520004,
59030x316d00ff,
59040x000d6880,
59050x026d6021,
59060x000b5402,
59070x8d810000,
59080x000bb942,
59090x000a50c0,
59100x00200008,
59110x32f707f8,
59120xff000000,
59130x8e6d0000,
59140xff098200,
59150x000a5042,
59160x24010000,
59170x01aa6821,
59180xae610000,
59190xff098200,
59200x8dae0000,
59210xae700000,
59220xff098200,
59230xae740000,
59240xff098200,
59250x8dce0000,
59260xff098200,
59270x01c00008,
59280x267e0000,
59290xff098200,
59300xff000000,
59310x000a6042,
59320x3c010000,
59330xff090200,
59340x01816021,
59350x024c9021,
59360x8e4b0000,
59370x26520004,
59380x316d00ff,
59390x000d6880,
59400x026d6021,
59410x000b5402,
59420x8d810000,
59430x000bb942,
59440x000a50c0,
59450x00200008,
59460x32f707f8,
59470xff000000,
59480xf0f0f0f0,
59490xff000000,
59500x8e8e0000,
59510xff098200,
59520x924d0000,
59530xff098200,
59540x8e510000,
59550xff098200,
59560x01d7082b,
59570x14200000,
59580xff050820,
59590x000d68c0,
59600xff000000,
59610x8e4b0000,
59620x26520004,
59630xff000000,
59640xff06000c,
59650x012d082b,
59660x14200000,
59670xff050803,
59680x02090821,
59690xff000000,
59700x000b5402,
59710x10000000,
59720xff070800,
59730x000a50c0,
59740xff000000,
59750x316d00ff,
59760x000d6880,
59770x026d6021,
59780x000b5402,
59790x8d810000,
59800x000bb942,
59810x000a50c0,
59820x00200008,
59830x32f707f8,
59840xff000000,
59850xff06000d,
59860xac3e0000,
59870xff098200,
59880x10000000,
59890xff05080c,
59900x25290008,
59910xff000000,
59920xf0f0f0f0,
59930xff000000,
59940x02096821,
59950x8e8e0000,
59960xff098200,
59970x02e96021,
59980xada80000,
59990xff098200,
60000x252f0000,
60010xff098200,
60020x018e082b,
60030x8e510000,
60040xff098200,
60050x10200000,
60060xff050820,
60070xadaf0000,
60080xff098200,
60090x924e0000,
60100xff098200,
60110x0200b821,
60120x01a04821,
60130x8e4b0000,
60140x26520004,
60150x11c00000,
60160xff050803,
60170x25b00008,
60180xff06000b,
60190x8eec0000,
60200xff098200,
60210x8eef0000,
60220xff098200,
60230x02e9082b,
60240x01802021,
60250x03c1600a,
60260x03c1200b,
60270xadaf0000,
60280xff098200,
60290x25ceffff,
60300xadac0000,
60310xff098200,
60320x25ad0008,
60330xaee40000,
60340xff098200,
60350x15c00000,
60360xff05080b,
60370x26f70008,
60380xff06000d,
60390x316d00ff,
60400x000d6880,
60410x026d6021,
60420x000b5402,
60430x8d810000,
60440x000bb942,
60450x000a50c0,
60460x00200008,
60470x32f707f8,
60480xff000000,
60490x8d190000,
60500xff098200,
60510xff000000,
60520x8e790000,
60530xff098200,
60540xff000000,
60550x02e96821,
60560x8e8e0000,
60570xff098200,
60580x02094821,
60590xae900000,
60600xff098200,
60610x01cd082b,
60620xae890000,
60630xff098200,
60640x240c0000,
60650xff098200,
60660xff000000,
60670x8d050000,
60680xff098200,
60690xff000000,
60700x14200000,
60710xff05081f,
60720x02802021,
60730x0320f809,
60740xae6c0000,
60750xff098200,
60760x8e900000,
60770xff098200,
60780x000250c0,
60790x8e8d0000,
60800xff098200,
60810x240c0000,
60820xff098200,
60830x8e120000,
60840xff098200,
60850x01aab823,
60860x10000000,
60870xff050816,
60880xae6c0000,
60890xff098200,
60900xff000000,
60910xff010000
6092};
6093
6094enum {
6095 GLOB_vm_returnp,
6096 GLOB_cont_dispatch,
6097 GLOB_vm_returnc,
6098 GLOB_BC_RET_Z,
6099 GLOB_vm_return,
6100 GLOB_vm_leave_cp,
6101 GLOB_vm_leave_unw,
6102 GLOB_vm_unwind_c,
6103 GLOB_vm_unwind_c_eh,
6104 GLOB_vm_unwind_ff,
6105 GLOB_vm_unwind_ff_eh,
6106 GLOB_vm_growstack_c,
6107 GLOB_vm_growstack_l,
6108 GLOB_vm_resume,
6109 GLOB_vm_pcall,
6110 GLOB_vm_call,
6111 GLOB_vm_call_dispatch,
6112 GLOB_vmeta_call,
6113 GLOB_vm_call_dispatch_f,
6114 GLOB_vm_cpcall,
6115 GLOB_cont_ffi_callback,
6116 GLOB_vm_call_tail,
6117 GLOB_cont_cat,
6118 GLOB_BC_CAT_Z,
6119 GLOB_cont_nop,
6120 GLOB_vmeta_tgets1,
6121 GLOB_vmeta_tgets,
6122 GLOB_vmeta_tgetb,
6123 GLOB_vmeta_tgetv,
6124 GLOB_vmeta_tsets1,
6125 GLOB_vmeta_tsets,
6126 GLOB_vmeta_tsetb,
6127 GLOB_vmeta_tsetv,
6128 GLOB_vmeta_comp,
6129 GLOB_vmeta_binop,
6130 GLOB_cont_ra,
6131 GLOB_cont_condt,
6132 GLOB_cont_condf,
6133 GLOB_vmeta_equal,
6134 GLOB_vmeta_equal_cd,
6135 GLOB_vmeta_unm,
6136 GLOB_vmeta_arith,
6137 GLOB_vmeta_len,
6138 GLOB_BC_LEN_Z,
6139 GLOB_vmeta_callt,
6140 GLOB_BC_CALLT_Z,
6141 GLOB_vmeta_for,
6142 GLOB_ff_assert,
6143 GLOB_fff_fallback,
6144 GLOB_fff_res,
6145 GLOB_ff_type,
6146 GLOB_fff_resn,
6147 GLOB_ff_getmetatable,
6148 GLOB_fff_restv,
6149 GLOB_ff_setmetatable,
6150 GLOB_ff_rawget,
6151 GLOB_ff_tonumber,
6152 GLOB_ff_tostring,
6153 GLOB_fff_gcstep,
6154 GLOB_ff_next,
6155 GLOB_ff_pairs,
6156 GLOB_ff_ipairs_aux,
6157 GLOB_ff_ipairs,
6158 GLOB_ff_pcall,
6159 GLOB_ff_xpcall,
6160 GLOB_ff_coroutine_resume,
6161 GLOB_ff_coroutine_wrap_aux,
6162 GLOB_ff_coroutine_yield,
6163 GLOB_ff_math_abs,
6164 GLOB_fff_res1,
6165 GLOB_ff_math_floor,
6166 GLOB_vm_floor,
6167 GLOB_ff_math_ceil,
6168 GLOB_vm_ceil,
6169 GLOB_ff_math_log,
6170 GLOB_ff_math_log10,
6171 GLOB_ff_math_exp,
6172 GLOB_ff_math_sin,
6173 GLOB_ff_math_cos,
6174 GLOB_ff_math_tan,
6175 GLOB_ff_math_asin,
6176 GLOB_ff_math_acos,
6177 GLOB_ff_math_atan,
6178 GLOB_ff_math_sinh,
6179 GLOB_ff_math_cosh,
6180 GLOB_ff_math_tanh,
6181 GLOB_ff_math_pow,
6182 GLOB_ff_math_atan2,
6183 GLOB_ff_math_fmod,
6184 GLOB_ff_math_sqrt,
6185 GLOB_ff_math_deg,
6186 GLOB_ff_math_rad,
6187 GLOB_ff_math_ldexp,
6188 GLOB_ff_math_frexp,
6189 GLOB_ff_math_modf,
6190 GLOB_ff_math_min,
6191 GLOB_ff_math_max,
6192 GLOB_ff_string_len,
6193 GLOB_fff_resi,
6194 GLOB_ff_string_byte,
6195 GLOB_ff_string_char,
6196 GLOB_fff_newstr,
6197 GLOB_ff_string_sub,
6198 GLOB_fff_emptystr,
6199 GLOB_ff_string_rep,
6200 GLOB_ff_string_reverse,
6201 GLOB_ff_string_lower,
6202 GLOB_ff_string_upper,
6203 GLOB_ff_table_getn,
6204 GLOB_ff_bit_band,
6205 GLOB_ff_bit_bor,
6206 GLOB_ff_bit_bxor,
6207 GLOB_ff_bit_bswap,
6208 GLOB_ff_bit_bnot,
6209 GLOB_ff_bit_lshift,
6210 GLOB_ff_bit_rshift,
6211 GLOB_ff_bit_arshift,
6212 GLOB_ff_bit_rol,
6213 GLOB_ff_bit_ror,
6214 GLOB_ff_bit_tobit,
6215 GLOB_vm_record,
6216 GLOB_vm_rethook,
6217 GLOB_vm_inshook,
6218 GLOB_cont_hook,
6219 GLOB_vm_hotloop,
6220 GLOB_vm_callhook,
6221 GLOB_vm_hotcall,
6222 GLOB_vm_exit_handler,
6223 GLOB_vm_exit_interp,
6224 GLOB_vm_trunc,
6225 GLOB_vm_ffi_callback,
6226 GLOB_vm_ffi_call,
6227 GLOB_BC_MODVN_Z,
6228 GLOB_BC_TGETS_Z,
6229 GLOB_BC_TSETS_Z,
6230 GLOB_BC_CALL_Z,
6231 GLOB_BC_RETV_Z,
6232 GLOB__MAX
6233};
6234static const char *const globnames[] = {
6235 "vm_returnp",
6236 "cont_dispatch",
6237 "vm_returnc",
6238 "BC_RET_Z",
6239 "vm_return",
6240 "vm_leave_cp",
6241 "vm_leave_unw",
6242 "vm_unwind_c",
6243 "vm_unwind_c_eh",
6244 "vm_unwind_ff",
6245 "vm_unwind_ff_eh",
6246 "vm_growstack_c",
6247 "vm_growstack_l",
6248 "vm_resume",
6249 "vm_pcall",
6250 "vm_call",
6251 "vm_call_dispatch",
6252 "vmeta_call",
6253 "vm_call_dispatch_f",
6254 "vm_cpcall",
6255 "cont_ffi_callback",
6256 "vm_call_tail",
6257 "cont_cat",
6258 "BC_CAT_Z",
6259 "cont_nop",
6260 "vmeta_tgets1",
6261 "vmeta_tgets",
6262 "vmeta_tgetb",
6263 "vmeta_tgetv",
6264 "vmeta_tsets1",
6265 "vmeta_tsets",
6266 "vmeta_tsetb",
6267 "vmeta_tsetv",
6268 "vmeta_comp",
6269 "vmeta_binop",
6270 "cont_ra",
6271 "cont_condt",
6272 "cont_condf",
6273 "vmeta_equal",
6274 "vmeta_equal_cd",
6275 "vmeta_unm",
6276 "vmeta_arith",
6277 "vmeta_len",
6278 "BC_LEN_Z",
6279 "vmeta_callt",
6280 "BC_CALLT_Z",
6281 "vmeta_for",
6282 "ff_assert",
6283 "fff_fallback",
6284 "fff_res",
6285 "ff_type",
6286 "fff_resn",
6287 "ff_getmetatable",
6288 "fff_restv",
6289 "ff_setmetatable",
6290 "ff_rawget",
6291 "ff_tonumber",
6292 "ff_tostring",
6293 "fff_gcstep",
6294 "ff_next",
6295 "ff_pairs",
6296 "ff_ipairs_aux",
6297 "ff_ipairs",
6298 "ff_pcall",
6299 "ff_xpcall",
6300 "ff_coroutine_resume",
6301 "ff_coroutine_wrap_aux",
6302 "ff_coroutine_yield",
6303 "ff_math_abs",
6304 "fff_res1",
6305 "ff_math_floor",
6306 "vm_floor",
6307 "ff_math_ceil",
6308 "vm_ceil",
6309 "ff_math_log",
6310 "ff_math_log10",
6311 "ff_math_exp",
6312 "ff_math_sin",
6313 "ff_math_cos",
6314 "ff_math_tan",
6315 "ff_math_asin",
6316 "ff_math_acos",
6317 "ff_math_atan",
6318 "ff_math_sinh",
6319 "ff_math_cosh",
6320 "ff_math_tanh",
6321 "ff_math_pow",
6322 "ff_math_atan2",
6323 "ff_math_fmod",
6324 "ff_math_sqrt",
6325 "ff_math_deg",
6326 "ff_math_rad",
6327 "ff_math_ldexp",
6328 "ff_math_frexp",
6329 "ff_math_modf",
6330 "ff_math_min",
6331 "ff_math_max",
6332 "ff_string_len",
6333 "fff_resi",
6334 "ff_string_byte",
6335 "ff_string_char",
6336 "fff_newstr",
6337 "ff_string_sub",
6338 "fff_emptystr",
6339 "ff_string_rep",
6340 "ff_string_reverse",
6341 "ff_string_lower",
6342 "ff_string_upper",
6343 "ff_table_getn",
6344 "ff_bit_band",
6345 "ff_bit_bor",
6346 "ff_bit_bxor",
6347 "ff_bit_bswap",
6348 "ff_bit_bnot",
6349 "ff_bit_lshift",
6350 "ff_bit_rshift",
6351 "ff_bit_arshift",
6352 "ff_bit_rol",
6353 "ff_bit_ror",
6354 "ff_bit_tobit",
6355 "vm_record",
6356 "vm_rethook",
6357 "vm_inshook",
6358 "cont_hook",
6359 "vm_hotloop",
6360 "vm_callhook",
6361 "vm_hotcall",
6362 "vm_exit_handler",
6363 "vm_exit_interp",
6364 "vm_trunc",
6365 "vm_ffi_callback",
6366 "vm_ffi_call",
6367 "BC_MODVN_Z",
6368 "BC_TGETS_Z",
6369 "BC_TSETS_Z",
6370 "BC_CALL_Z",
6371 "BC_RETV_Z",
6372 (const char *)0
6373};
6374static const char *const extnames[] = {
6375 (const char *)0
6376};
6377#define Dt1(_V) (int)(ptrdiff_t)&(((lua_State *)0)_V)
6378#define Dt2(_V) (int)(ptrdiff_t)&(((global_State *)0)_V)
6379#define Dt3(_V) (int)(ptrdiff_t)&(((TValue *)0)_V)
6380#define Dt4(_V) (int)(ptrdiff_t)&(((GCobj *)0)_V)
6381#define Dt5(_V) (int)(ptrdiff_t)&(((GCstr *)0)_V)
6382#define Dt6(_V) (int)(ptrdiff_t)&(((GCtab *)0)_V)
6383#define Dt7(_V) (int)(ptrdiff_t)&(((GCfuncL *)0)_V)
6384#define Dt8(_V) (int)(ptrdiff_t)&(((GCfuncC *)0)_V)
6385#define Dt9(_V) (int)(ptrdiff_t)&(((GCproto *)0)_V)
6386#define DtA(_V) (int)(ptrdiff_t)&(((GCupval *)0)_V)
6387#define DtB(_V) (int)(ptrdiff_t)&(((Node *)0)_V)
6388#define DtC(_V) (int)(ptrdiff_t)&(((int *)0)_V)
6389#define DtD(_V) (int)(ptrdiff_t)&(((GCtrace *)0)_V)
6390#define DISPATCH_GL(field) (GG_DISP2G + (int)offsetof(global_State, field))
6391#define DISPATCH_J(field) (GG_DISP2J + (int)offsetof(jit_State, field))
6392#define GG_DISP2GOT (GG_OFS(got) - GG_OFS(dispatch))
6393#define DISPATCH_GOT(name) (GG_DISP2GOT + 4*LJ_GOT_##name)
6394#define PC2PROTO(field) ((int)offsetof(GCproto, field)-(int)sizeof(GCproto))
6395
6396/* Generate subroutines used by opcodes and other parts of the VM. */
6397/* The .code_sub section should be last to help static branch prediction. */
6398static void build_subroutines(BuildCtx *ctx)
6399{
6400 dasm_put(Dst, 0);
6401 dasm_put(Dst, 1, FRAME_P, LJ_TTRUE, LJ_ENDIAN_SELECT(-4,-8), LJ_ENDIAN_SELECT(-4,-8), FRAME_TYPE, FRAME_C, Dt1(->base), ~LJ_VMST_C, DISPATCH_GL(vmstate), Dt1(->top));
6402 dasm_put(Dst, 57, Dt1(->cframe), 72+9*4, 72+8*4, 24+5*8, 72+7*4, 72+6*4, 24+4*8, 72+5*4, 72+4*4, 24+3*8, 72+3*4, 72+2*4, 24+2*8, 72+1*4, 72+0*4, 24+1*8, 24+0*8, Dt1(->maxstack), LJ_ENDIAN_SELECT(4,0));
6403 dasm_put(Dst, 109, DISPATCH_GOT(lj_state_growstack), Dt1(->top), ~LJ_VMST_C, Dt1(->glref), Dt2(->vmstate), LJ_TNIL, Dt1(->base), Dt1(->glref), LJ_TFALSE, ~LJ_VMST_INTERP, LJ_ENDIAN_SELECT(-4,-8), GG_G2DISP, LJ_ENDIAN_SELECT(4,0));
6404 dasm_put(Dst, 172, DISPATCH_GL(vmstate), LUA_MINSTACK, Dt1(->base), Dt1(->top), DISPATCH_GOT(lj_state_growstack), Dt1(->base), Dt1(->top), LJ_ENDIAN_SELECT(-8,-4), Dt7(->pc), 72+9*4, 72+8*4, 24+5*8, 72+7*4, 72+6*4, 24+4*8, 72+5*4, 72+4*4);
6405 dasm_put(Dst, 235, 24+3*8, 72+3*4, 72+2*4, 24+2*8, 72+1*4, 72+0*4, 24+1*8, 24+0*8, Dt1(->glref), Dt1(->status), FRAME_CP, CFRAME_RESUME, GG_G2DISP, Dt1(->cframe), Dt1(->base), Dt1(->top), LJ_ENDIAN_SELECT(-4,-8), Dt1(->status), ~LJ_VMST_INTERP, DISPATCH_GL(vmstate), FRAME_TYPE);
6406 dasm_put(Dst, 296, LJ_TNIL, 72+9*4, 72+8*4, 24+5*8, 72+7*4, 72+6*4, 24+4*8, 72+5*4, 72+4*4, 24+3*8, 72+3*4, 72+2*4, 24+2*8, 72+1*4, 72+0*4, 24+1*8, 24+0*8, FRAME_CP, 72+9*4);
6407 dasm_put(Dst, 345, 72+8*4, 24+5*8, 72+7*4, 72+6*4, 24+4*8, 72+5*4, 72+4*4, 24+3*8, 72+3*4, 72+2*4, 24+2*8, 72+1*4, 72+0*4, 24+1*8, 24+0*8, FRAME_C, Dt1(->cframe), Dt1(->cframe), Dt1(->glref), GG_G2DISP, Dt1(->base));
6408 dasm_put(Dst, 396, Dt1(->top), ~LJ_VMST_INTERP, LJ_TNIL, DISPATCH_GL(vmstate), LJ_ENDIAN_SELECT(-4,-8), LJ_TFUNC, LJ_ENDIAN_SELECT(-8,-4), LJ_ENDIAN_SELECT(-4,-8), Dt7(->pc), 72+9*4, 72+8*4, 24+5*8, 72+7*4, 72+6*4, 24+4*8, 72+5*4, 72+4*4, 24+3*8, 72+3*4);
6409 dasm_put(Dst, 457, 72+2*4, 24+2*8, 72+1*4, 72+0*4, 24+1*8, 24+0*8, Dt1(->stack), Dt1(->top), Dt1(->cframe), Dt1(->cframe), Dt1(->glref), FRAME_CP, GG_G2DISP, -16+LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(-8,-4));
6410#if LJ_HASFFI
6411 dasm_put(Dst, 506);
6412#endif
6413 dasm_put(Dst, 508, -16+LJ_ENDIAN_SELECT(4,0), Dt7(->pc));
6414#if LJ_HASFFI
6415 dasm_put(Dst, 514);
6416#endif
6417 dasm_put(Dst, 517, -8+LJ_ENDIAN_SELECT(4,0), PC2PROTO(k));
6418#if LJ_HASFFI
6419 dasm_put(Dst, 523);
6420#endif
6421 dasm_put(Dst, 531, Dt1(->base), DISPATCH_GL(tmptv), LJ_TSTR, LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0), DISPATCH_GL(tmptv), LJ_TTAB, LJ_ENDIAN_SELECT(0,4), DISPATCH_GL(tmptv2), LJ_ENDIAN_SELECT(4,0), LJ_TSTR, LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0), DISPATCH_GL(tmptv));
6422 dasm_put(Dst, 589, DISPATCH_GOT(lj_meta_tget), Dt1(->base), -FRAME_CONT, Dt1(->top), -16+LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(-8,-4), DISPATCH_GL(tmptv), LJ_TSTR, LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0), DISPATCH_GL(tmptv), LJ_TTAB, LJ_ENDIAN_SELECT(0,4), DISPATCH_GL(tmptv2), LJ_ENDIAN_SELECT(4,0), LJ_TSTR, LJ_ENDIAN_SELECT(0,4));
6423 dasm_put(Dst, 651, LJ_ENDIAN_SELECT(4,0), DISPATCH_GL(tmptv), DISPATCH_GOT(lj_meta_tset), Dt1(->base), -FRAME_CONT, Dt1(->top), -16+LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(-8,-4), DISPATCH_GOT(lj_meta_comp), Dt1(->base), LJ_ENDIAN_SELECT(2,0), (-(BCBIAS_J*4 >> 16) & 65535));
6424 dasm_put(Dst, 721, -4+LJ_ENDIAN_SELECT(1,2), LJ_ENDIAN_SELECT(4,0), LJ_TISTRUECOND, LJ_ENDIAN_SELECT(4,0), LJ_TISTRUECOND, DISPATCH_GOT(lj_meta_equal), Dt1(->base));
6425#if LJ_HASFFI
6426 dasm_put(Dst, 776, DISPATCH_GOT(lj_meta_equal_cd), Dt1(->base));
6427#endif
6428 dasm_put(Dst, 789, DISPATCH_GOT(lj_meta_arith), Dt1(->base), -16+LJ_ENDIAN_SELECT(4,0), FRAME_CONT);
6429#ifdef LUAJIT_ENABLE_LUA52COMPAT
6430 dasm_put(Dst, 818);
6431#endif
6432 dasm_put(Dst, 820, DISPATCH_GOT(lj_meta_len), Dt1(->base));
6433#ifdef LUAJIT_ENABLE_LUA52COMPAT
6434 dasm_put(Dst, 828);
6435#else
6436 dasm_put(Dst, 835);
6437#endif
6438 dasm_put(Dst, 839, DISPATCH_GOT(lj_meta_call), Dt1(->base), LJ_ENDIAN_SELECT(-8,-4), LJ_ENDIAN_SELECT(-4,-8), Dt7(->pc), DISPATCH_GOT(lj_meta_call), Dt1(->base), LJ_ENDIAN_SELECT(-4,-8), LJ_ENDIAN_SELECT(-8,-4), DISPATCH_GOT(lj_meta_for), Dt1(->base));
6439#if LJ_HASJIT
6440 dasm_put(Dst, 896, BC_JFORI);
6441#endif
6442 dasm_put(Dst, 900);
6443#if LJ_HASJIT
6444 dasm_put(Dst, 904, BC_JFORI, BC_FORI);
6445#else
6446 dasm_put(Dst, 911, BC_FORI);
6447#endif
6448 dasm_put(Dst, 915, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TISTRUECOND, LJ_ENDIAN_SELECT(-4,-8), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM, Dt8(->upvalue), LJ_ENDIAN_SELECT(4,0));
6449 dasm_put(Dst, 970, LJ_ENDIAN_SELECT(0,4), LJ_TTAB, LJ_TUDATA, Dt6(->metatable), DISPATCH_GL(gcroot[GCROOT_MMNAME+MM_metatable]), LJ_TNIL, Dt6(->hmask), LJ_TTAB, Dt5(->hash), Dt6(->node), LJ_TSTR, offsetof(Node, key)+LJ_ENDIAN_SELECT(4,0), offsetof(Node, key)+LJ_ENDIAN_SELECT(0,4), DtB(->next), offsetof(Node, val)+LJ_ENDIAN_SELECT(4,0), offsetof(Node, val)+LJ_ENDIAN_SELECT(0,4));
6450 dasm_put(Dst, 1020, LJ_TISNUM, LJ_TISNUM, DISPATCH_GL(gcroot[GCROOT_BASEMT]), LJ_ENDIAN_SELECT(4,0), 8+LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), 8+LJ_ENDIAN_SELECT(0,4), LJ_TTAB, -LJ_TTAB, Dt6(->metatable), Dt6(->marked));
6451 dasm_put(Dst, 1075, LJ_GC_BLACK, Dt6(->metatable), DISPATCH_GL(gc.grayagain), ~LJ_GC_BLACK & 255, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), DISPATCH_GOT(lj_tab_get), -LJ_TTAB, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6452 dasm_put(Dst, 1129, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TSTR, DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM]), LJ_TISNUM, Dt1(->base), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), DISPATCH_GOT(lj_str_fromnum), LJ_TSTR, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TTAB, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(-4,-8), DISPATCH_GOT(lj_tab_next));
6453 dasm_put(Dst, 1184, Dt1(->base), Dt1(->top), LJ_TNIL, (2+1)*8, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TTAB, LJ_ENDIAN_SELECT(-4,-8));
6454#ifdef LUAJIT_ENABLE_LUA52COMPAT
6455 dasm_put(Dst, 1219, Dt6(->metatable), Dt8(->upvalue[0]));
6456#else
6457 dasm_put(Dst, 1226, Dt8(->upvalue[0]));
6458#endif
6459 dasm_put(Dst, 1229, 8+LJ_ENDIAN_SELECT(4,0), (3+1)*8, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), 8+LJ_ENDIAN_SELECT(4,0), -LJ_TTAB, LJ_TISNUM, LJ_ENDIAN_SELECT(-4,-8), Dt6(->asize), Dt6(->array), LJ_ENDIAN_SELECT(4,0), (0+1)*8, (2+1)*8, Dt6(->hmask));
6460 dasm_put(Dst, 1292, DISPATCH_GOT(lj_tab_getinth), (0+1)*8, (0+1)*8, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TTAB, LJ_ENDIAN_SELECT(-4,-8));
6461#ifdef LUAJIT_ENABLE_LUA52COMPAT
6462 dasm_put(Dst, 1323, Dt6(->metatable), Dt8(->upvalue[0]));
6463#else
6464 dasm_put(Dst, 1330, Dt8(->upvalue[0]));
6465#endif
6466 dasm_put(Dst, 1333, 8+LJ_ENDIAN_SELECT(4,0), 8+LJ_ENDIAN_SELECT(0,4), (3+1)*8, DISPATCH_GL(hookmask), HOOK_ACTIVE_SHIFT, 8+FRAME_PCALL, 8+LJ_ENDIAN_SELECT(4,0), DISPATCH_GL(hookmask), LJ_TFUNC, HOOK_ACTIVE_SHIFT, 16+FRAME_PCALL, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4));
6467 dasm_put(Dst, 1392, LJ_TTHREAD, Dt1(->status), Dt1(->cframe), Dt1(->top), Dt1(->base), -LUA_YIELD, Dt1(->maxstack), LJ_ENDIAN_SELECT(-4,-8), Dt1(->base), Dt1(->top), Dt1(->top));
6468 dasm_put(Dst, 1451, Dt1(->base), LUA_YIELD+1, Dt1(->top), ~LJ_VMST_INTERP, Dt1(->base), DISPATCH_GL(vmstate), Dt1(->maxstack), Dt1(->top), FRAME_TYPE, LJ_TTRUE, -8+LJ_ENDIAN_SELECT(4,0), LJ_TFALSE, Dt1(->top));
6469 dasm_put(Dst, 1511, (2+1)*8, -8+LJ_ENDIAN_SELECT(4,0), FRAME_TYPE, DISPATCH_GOT(lj_state_growstack), Dt8(->upvalue[0].gcr), Dt1(->status), Dt1(->cframe), Dt1(->top), Dt1(->base), -LUA_YIELD, Dt1(->maxstack), LJ_ENDIAN_SELECT(-4,-8), Dt1(->base), Dt1(->top));
6470 dasm_put(Dst, 1566, Dt1(->top), Dt1(->base), LUA_YIELD+1, Dt1(->top), ~LJ_VMST_INTERP, Dt1(->base), DISPATCH_GL(vmstate), Dt1(->maxstack), Dt1(->top), FRAME_TYPE);
6471 dasm_put(Dst, 1627, DISPATCH_GOT(lj_ffh_coroutine_wrap_err), DISPATCH_GOT(lj_state_growstack), Dt1(->cframe), Dt1(->base), CFRAME_RESUME, Dt1(->top), LUA_YIELD, Dt1(->cframe), Dt1(->status), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6472 dasm_put(Dst, 1682, LJ_ENDIAN_SELECT(-4,-8), LJ_ENDIAN_SELECT(-4,-8), -8+LJ_ENDIAN_SELECT(4,0), -8+LJ_ENDIAN_SELECT(0,4), (1+1)*8, FRAME_TYPE, -8+LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6473 dasm_put(Dst, 1750, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(log), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(log10), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0));
6474 dasm_put(Dst, 1806, DISPATCH_GOT(exp), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(sin), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(cos), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(tan));
6475 dasm_put(Dst, 1862, LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(asin), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(acos), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(atan), LJ_TISNUM);
6476 dasm_put(Dst, 1918, LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(sinh), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(cosh), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(tanh), LJ_TISNUM);
6477 dasm_put(Dst, 1977, LJ_ENDIAN_SELECT(4,0), 8+LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM, DISPATCH_GOT(pow), LJ_ENDIAN_SELECT(4,0), 8+LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM, DISPATCH_GOT(atan2), LJ_ENDIAN_SELECT(4,0), 8+LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM);
6478 dasm_put(Dst, 2039, DISPATCH_GOT(fmod), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, Dt8(->upvalue[0]), LJ_ENDIAN_SELECT(4,0), 8+LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM);
6479 dasm_put(Dst, 2094, DISPATCH_GOT(ldexp), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, DISPATCH_GOT(frexp), LJ_ENDIAN_SELECT(-4,-8), DISPATCH_GL(tmptv), DISPATCH_GL(tmptv), (2+1)*8, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, DISPATCH_GOT(modf), LJ_ENDIAN_SELECT(-4,-8), (2+1)*8);
6480 dasm_put(Dst, 2158, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6481 dasm_put(Dst, 2217, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TSTR, Dt5(->len), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), -LJ_TSTR, Dt5(->len), Dt5([1]), LJ_ENDIAN_SELECT(-4,-8), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), LJ_ENDIAN_SELECT(4,0));
6482 dasm_put(Dst, 2276, LJ_TISNUM, DISPATCH_GOT(lj_str_new), Dt1(->base), Dt1(->base), LJ_TSTR, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), 16+LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), 8+LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM);
6483 dasm_put(Dst, 2337, LJ_TSTR, Dt5(->len), sizeof(GCstr)-1, DISPATCH_GL(strempty), LJ_TSTR, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), LJ_ENDIAN_SELECT(4,0), 8+LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), -LJ_TSTR, LJ_TISNUM, Dt5(->len), DISPATCH_GL(tmpbuf.sz));
6484 dasm_put(Dst, 2407, DISPATCH_GL(tmpbuf.buf), Dt5([1]), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TSTR, DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf));
6485 dasm_put(Dst, 2464, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TSTR, DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf), DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold));
6486 dasm_put(Dst, 2527, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TSTR, DISPATCH_GL(tmpbuf.sz), Dt5(->len), sizeof(GCstr), DISPATCH_GL(tmpbuf.buf), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TTAB, DISPATCH_GOT(lj_tab_len), LJ_ENDIAN_SELECT(4,0));
6487 dasm_put(Dst, 2586, LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0));
6488 dasm_put(Dst, 2649, LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_ENDIAN_SELECT(4,0));
6489 dasm_put(Dst, 2719, 8+LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), 8+LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), 8+LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM, LJ_ENDIAN_SELECT(4,0));
6490 dasm_put(Dst, 2790, 8+LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), 8+LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, Dt8(->f));
6491 dasm_put(Dst, 2863, LJ_ENDIAN_SELECT(-4,-8), 8*LUA_MINSTACK, Dt1(->maxstack), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top), LJ_ENDIAN_SELECT(-8,-4), Dt7(->pc), FRAME_TYPE, LJ_ENDIAN_SELECT(1,2), DISPATCH_GOT(lj_state_growstack), LUA_MINSTACK, Dt1(->base));
6492 dasm_put(Dst, 2931, DISPATCH_GOT(lj_gc_step), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top), LJ_ENDIAN_SELECT(-8,-4));
6493#if LJ_HASJIT
6494 dasm_put(Dst, 2957, DISPATCH_GL(hookmask), HOOK_VMEVENT, DISPATCH_GL(hookcount), HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount));
6495#endif
6496 dasm_put(Dst, 2980, DISPATCH_GL(hookmask), HOOK_ACTIVE, GG_DISP2STATIC, DISPATCH_GL(hookmask), DISPATCH_GL(hookcount), HOOK_ACTIVE, LUA_MASKLINE|LUA_MASKCOUNT, DISPATCH_GL(hookcount), LUA_MASKLINE, DISPATCH_GOT(lj_dispatch_ins), Dt1(->base), Dt1(->base));
6497 dasm_put(Dst, 3028, GG_DISP2STATIC, -24+LJ_ENDIAN_SELECT(0,4));
6498#if LJ_HASJIT
6499 dasm_put(Dst, 3047);
6500#endif
6501 dasm_put(Dst, 3049);
6502#if LJ_HASJIT
6503 dasm_put(Dst, 3051);
6504#endif
6505 dasm_put(Dst, 3054);
6506#if LJ_HASJIT
6507 dasm_put(Dst, 3057);
6508#endif
6509 dasm_put(Dst, 3060, DISPATCH_GOT(lj_dispatch_call), Dt1(->base), Dt1(->top), Dt1(->base), Dt1(->top), LJ_ENDIAN_SELECT(-8,-4));
6510#if LJ_HASJIT
6511 dasm_put(Dst, 3084);
6512#endif
6513 dasm_put(Dst, 3086);
6514#if LJ_HASJIT
6515 dasm_put(Dst, 3088);
6516#endif
6517 dasm_put(Dst, 3090);
6518#if LJ_HASJIT
6519 dasm_put(Dst, 3138);
6520#endif
6521 dasm_put(Dst, 3161);
6522#if LJ_HASFFI
6523#define DtE(_V) (int)(ptrdiff_t)&(((CTState *)0)_V)
6524 dasm_put(Dst, 3163, 72+9*4, 72+8*4, 24+5*8, 72+7*4, 72+6*4, 24+4*8, 72+5*4, 72+4*4, 24+3*8, 72+3*4, 72+2*4, 24+2*8, 72+1*4, 72+0*4, 24+1*8, 24+0*8, Dt2(->ctype_state), GG_G2DISP, DISPATCH_GOT(lj_ccallback_enter), DtE(->cb.slot), DtE(->cb.gpr[0]), DtE(->cb.gpr[1]), DtE(->cb.fpr[0]));
6525 dasm_put(Dst, 3211, DtE(->cb.gpr[2]), DtE(->cb.gpr[3]), DtE(->cb.fpr[1]), 112+16, DtE(->cb.stack), Dt1(->base), Dt1(->top), LJ_ENDIAN_SELECT(-8,-4), ~LJ_VMST_INTERP, LJ_TNIL, DISPATCH_GL(vmstate), Dt7(->pc));
6526#endif
6527 dasm_put(Dst, 3255);
6528#if LJ_HASFFI
6529 dasm_put(Dst, 3257, DISPATCH_GOT(lj_ccallback_leave), DISPATCH_GL(ctype_state), Dt1(->base), Dt1(->top), DtE(->L), DtE(->cb.gpr[0]), DtE(->cb.fpr[0]), DtE(->cb.gpr[1]), DtE(->cb.fpr[1]));
6530#endif
6531 dasm_put(Dst, 3281);
6532#if LJ_HASFFI
6533#define DtF(_V) (int)(ptrdiff_t)&(((CCallState *)0)_V)
6534 dasm_put(Dst, 3283, DtF(->spadj), DtF(->nsp), offsetof(CCallState, stack), DtF(->func), DtF(->gpr[1]), DtF(->gpr[2]), DtF(->gpr[3]), DtF(->fpr[0]), DtF(->fpr[1]), DtF(->gpr[0]), DtF(->gpr[0]), DtF(->gpr[1]), DtF(->fpr[0]), DtF(->fpr[1]));
6535#endif
6536}
6537
6538/* Generate the code for a single instruction. */
6539static void build_ins(BuildCtx *ctx, BCOp op, int defop)
6540{
6541 int vk = 0;
6542 dasm_put(Dst, 3339, defop);
6543
6544 switch (op) {
6545
6546 /* -- Comparison ops ---------------------------------------------------- */
6547
6548 /* Remember: all ops branch for a true comparison, fall through otherwise. */
6549
6550 case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
6551 dasm_put(Dst, 3341, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM, LJ_ENDIAN_SELECT(2,0), (-(BCBIAS_J*4 >> 16) & 65535));
6552 if (op == BC_ISLT || op == BC_ISGE) {
6553 dasm_put(Dst, 3364);
6554 } else {
6555 dasm_put(Dst, 3366);
6556 }
6557 if (op == BC_ISLT || op == BC_ISLE) {
6558 dasm_put(Dst, 3368);
6559 } else {
6560 dasm_put(Dst, 3370);
6561 }
6562 dasm_put(Dst, 3372);
6563 break;
6564
6565 case BC_ISEQV: case BC_ISNEV:
6566 vk = op == BC_ISEQV;
6567 dasm_put(Dst, 3386, LJ_ENDIAN_SELECT(4,0), -4+LJ_ENDIAN_SELECT(2,0), LJ_ENDIAN_SELECT(4,0), (-(BCBIAS_J*4 >> 16) & 65535), LJ_TISNUM, LJ_TISNUM);
6568 if (vk) {
6569 dasm_put(Dst, 3410);
6570 } else {
6571 dasm_put(Dst, 3412);
6572 }
6573 dasm_put(Dst, 3414, LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(0,4));
6574 if (LJ_HASFFI) {
6575 dasm_put(Dst, 3433, LJ_TCDATA);
6576 }
6577 dasm_put(Dst, 3438, LJ_TISPRI);
6578 if (LJ_HASFFI) {
6579 dasm_put(Dst, 3441);
6580 }
6581 dasm_put(Dst, 3444, LJ_TISTABUD+1);
6582 if (vk) {
6583 dasm_put(Dst, 3455);
6584 } else {
6585 dasm_put(Dst, 3457);
6586 }
6587 dasm_put(Dst, 3459, Dt6(->metatable), Dt6(->nomm), 1<<MM_eq, 1-vk);
6588 break;
6589
6590 case BC_ISEQS: case BC_ISNES:
6591 vk = op == BC_ISEQS;
6592 dasm_put(Dst, 3476, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), -4+LJ_ENDIAN_SELECT(2,0));
6593 if (LJ_HASFFI) {
6594 dasm_put(Dst, 3487, LJ_TCDATA);
6595 }
6596 dasm_put(Dst, 3492, -LJ_TSTR, (-(BCBIAS_J*4 >> 16) & 65535));
6597 if (vk) {
6598 dasm_put(Dst, 3502);
6599 } else {
6600 dasm_put(Dst, 3504);
6601 }
6602 dasm_put(Dst, 3506);
6603 break;
6604
6605 case BC_ISEQN: case BC_ISNEN:
6606 vk = op == BC_ISEQN;
6607 dasm_put(Dst, 3519, LJ_ENDIAN_SELECT(4,0), -4+LJ_ENDIAN_SELECT(2,0), (-(BCBIAS_J*4 >> 16) & 65535), LJ_TISNUM);
6608 if (LJ_HASFFI) {
6609 dasm_put(Dst, 3534);
6610 } else {
6611 dasm_put(Dst, 3537);
6612 }
6613 dasm_put(Dst, 3540);
6614 if (vk) {
6615 dasm_put(Dst, 3543);
6616 } else {
6617 dasm_put(Dst, 3547);
6618 }
6619 dasm_put(Dst, 3551);
6620 if (LJ_HASFFI) {
6621 dasm_put(Dst, 3563, LJ_TCDATA);
6622 }
6623 break;
6624
6625 case BC_ISEQP: case BC_ISNEP:
6626 vk = op == BC_ISEQP;
6627 dasm_put(Dst, 3573, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(2,0));
6628 if (LJ_HASFFI) {
6629 dasm_put(Dst, 3582, LJ_TCDATA);
6630 }
6631 dasm_put(Dst, 3587, (-(BCBIAS_J*4 >> 16) & 65535));
6632 if (vk) {
6633 dasm_put(Dst, 3593);
6634 } else {
6635 dasm_put(Dst, 3595);
6636 }
6637 dasm_put(Dst, 3597);
6638 break;
6639
6640 /* -- Unary test and copy ops ------------------------------------------- */
6641
6642 case BC_ISTC: case BC_ISFC: case BC_IST: case BC_ISF:
6643 dasm_put(Dst, 3610, LJ_ENDIAN_SELECT(2,0), LJ_ENDIAN_SELECT(4,0));
6644 if (op == BC_IST || op == BC_ISF) {
6645 dasm_put(Dst, 3617, LJ_TISTRUECOND, (-(BCBIAS_J*4 >> 16) & 65535));
6646 if (op == BC_IST) {
6647 dasm_put(Dst, 3624);
6648 } else {
6649 dasm_put(Dst, 3626);
6650 }
6651 dasm_put(Dst, 3628);
6652 } else {
6653 dasm_put(Dst, 3630, LJ_TISTRUECOND);
6654 if (op == BC_ISTC) {
6655 dasm_put(Dst, 3634);
6656 } else {
6657 dasm_put(Dst, 3637);
6658 }
6659 dasm_put(Dst, 3640, (-(BCBIAS_J*4 >> 16) & 65535));
6660 }
6661 dasm_put(Dst, 3649);
6662 break;
6663
6664 /* -- Unary ops --------------------------------------------------------- */
6665
6666 case BC_MOV:
6667 dasm_put(Dst, 3661);
6668 break;
6669 case BC_NOT:
6670 dasm_put(Dst, 3677, LJ_ENDIAN_SELECT(4,0), LJ_TFALSE, LJ_TISTRUECOND, LJ_TTRUE, LJ_ENDIAN_SELECT(4,0));
6671 break;
6672 case BC_UNM:
6673 dasm_put(Dst, 3701, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6674 break;
6675 case BC_LEN:
6676 dasm_put(Dst, 3724, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TSTR, LJ_TTAB, Dt5(->len));
6677#ifdef LUAJIT_ENABLE_LUA52COMPAT
6678 dasm_put(Dst, 3758, Dt6(->metatable));
6679#endif
6680 dasm_put(Dst, 3765, DISPATCH_GOT(lj_tab_len));
6681#ifdef LUAJIT_ENABLE_LUA52COMPAT
6682 dasm_put(Dst, 3774, Dt6(->nomm), 1<<MM_len);
6683#endif
6684 break;
6685
6686 /* -- Binary ops -------------------------------------------------------- */
6687
6688
6689 case BC_ADDVN: case BC_ADDNV: case BC_ADDVV:
6690 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6691 dasm_put(Dst, 3786);
6692 switch (vk) {
6693 case 0:
6694 dasm_put(Dst, 3790, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6695 break;
6696 case 1:
6697 dasm_put(Dst, 3799, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6698 break;
6699 default:
6700 dasm_put(Dst, 3808, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM);
6701 break;
6702 }
6703 dasm_put(Dst, 3822);
6704 break;
6705 case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
6706 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6707 dasm_put(Dst, 3839);
6708 switch (vk) {
6709 case 0:
6710 dasm_put(Dst, 3843, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6711 break;
6712 case 1:
6713 dasm_put(Dst, 3852, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6714 break;
6715 default:
6716 dasm_put(Dst, 3861, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM);
6717 break;
6718 }
6719 dasm_put(Dst, 3875);
6720 break;
6721 case BC_MULVN: case BC_MULNV: case BC_MULVV:
6722 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6723 dasm_put(Dst, 3892);
6724 switch (vk) {
6725 case 0:
6726 dasm_put(Dst, 3896, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6727 break;
6728 case 1:
6729 dasm_put(Dst, 3905, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6730 break;
6731 default:
6732 dasm_put(Dst, 3914, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM);
6733 break;
6734 }
6735 dasm_put(Dst, 3928);
6736 break;
6737 case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
6738 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6739 dasm_put(Dst, 3945);
6740 switch (vk) {
6741 case 0:
6742 dasm_put(Dst, 3949, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6743 break;
6744 case 1:
6745 dasm_put(Dst, 3958, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6746 break;
6747 default:
6748 dasm_put(Dst, 3967, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM);
6749 break;
6750 }
6751 dasm_put(Dst, 3981);
6752 break;
6753 case BC_MODVN:
6754 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6755 dasm_put(Dst, 3998);
6756 switch (vk) {
6757 case 0:
6758 dasm_put(Dst, 4002, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6759 break;
6760 case 1:
6761 dasm_put(Dst, 4011, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6762 break;
6763 default:
6764 dasm_put(Dst, 4020, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM);
6765 break;
6766 }
6767 dasm_put(Dst, 4034);
6768 break;
6769 case BC_MODNV: case BC_MODVV:
6770 vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
6771 dasm_put(Dst, 4056);
6772 switch (vk) {
6773 case 0:
6774 dasm_put(Dst, 4060, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6775 break;
6776 case 1:
6777 dasm_put(Dst, 4069, LJ_ENDIAN_SELECT(4,0), LJ_TISNUM);
6778 break;
6779 default:
6780 dasm_put(Dst, 4078, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM);
6781 break;
6782 }
6783 dasm_put(Dst, 4092);
6784 break;
6785 case BC_POW:
6786 dasm_put(Dst, 4099, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM, DISPATCH_GOT(pow));
6787 break;
6788
6789 case BC_CAT:
6790 dasm_put(Dst, 4135, Dt1(->base), DISPATCH_GOT(lj_meta_cat), Dt1(->base));
6791 break;
6792
6793 /* -- Constant ops ------------------------------------------------------ */
6794
6795 case BC_KSTR:
6796 dasm_put(Dst, 4170, LJ_TSTR, LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0));
6797 break;
6798 case BC_KCDATA:
6799#if LJ_HASFFI
6800 dasm_put(Dst, 4192, LJ_TCDATA, LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0));
6801#endif
6802 break;
6803 case BC_KSHORT:
6804 dasm_put(Dst, 4214);
6805 break;
6806 case BC_KNUM:
6807 dasm_put(Dst, 4231);
6808 break;
6809 case BC_KPRI:
6810 dasm_put(Dst, 4247, LJ_ENDIAN_SELECT(4,0));
6811 break;
6812 case BC_KNIL:
6813 dasm_put(Dst, 4264, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0));
6814 break;
6815
6816 /* -- Upvalue and function ops ------------------------------------------ */
6817
6818 case BC_UGET:
6819 dasm_put(Dst, 4288, LJ_ENDIAN_SELECT(-8,-4), Dt7(->uvptr), DtA(->v));
6820 break;
6821 case BC_USETV:
6822 dasm_put(Dst, 4311, LJ_ENDIAN_SELECT(-8,-4), Dt7(->uvptr), DtA(->marked), DtA(->v), LJ_GC_BLACK, DtA(->closed), LJ_ENDIAN_SELECT(4,0), LJ_GC_BLACK|1, -(LJ_TISNUM+1), LJ_TISGCV - (LJ_TISNUM+1), LJ_ENDIAN_SELECT(0,4), Dt4(->gch.marked), LJ_GC_WHITES, DISPATCH_GOT(lj_gc_barrieruv), GG_DISP2G);
6823 break;
6824 case BC_USETS:
6825 dasm_put(Dst, 4371, LJ_ENDIAN_SELECT(-8,-4), Dt7(->uvptr), DtA(->marked), DtA(->v), Dt5(->marked), LJ_GC_BLACK, DtA(->closed), LJ_TSTR, LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0), LJ_GC_WHITES, DISPATCH_GOT(lj_gc_barrieruv), GG_DISP2G);
6826 break;
6827 case BC_USETN:
6828 dasm_put(Dst, 4426, LJ_ENDIAN_SELECT(-8,-4), Dt7(->uvptr), DtA(->v));
6829 break;
6830 case BC_USETP:
6831 dasm_put(Dst, 4449, LJ_ENDIAN_SELECT(-8,-4), Dt7(->uvptr), DtA(->v), LJ_ENDIAN_SELECT(4,0));
6832 break;
6833
6834 case BC_UCLO:
6835 dasm_put(Dst, 4473, Dt1(->openupval), (-(BCBIAS_J*4 >> 16) & 65535), DISPATCH_GOT(lj_func_closeuv), Dt1(->base), Dt1(->base));
6836 break;
6837
6838 case BC_FNEW:
6839 dasm_put(Dst, 4504, DISPATCH_GOT(lj_func_newL_gc), LJ_ENDIAN_SELECT(-8,-4), Dt1(->base), Dt1(->base), LJ_TFUNC, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4));
6840 break;
6841
6842 /* -- Table ops --------------------------------------------------------- */
6843
6844 case BC_TNEW:
6845 case BC_TDUP:
6846 dasm_put(Dst, 4537, DISPATCH_GL(gc.total), DISPATCH_GL(gc.threshold), Dt1(->base));
6847 if (op == BC_TNEW) {
6848 dasm_put(Dst, 4549, DISPATCH_GOT(lj_tab_new));
6849 } else {
6850 dasm_put(Dst, 4560, DISPATCH_GOT(lj_tab_dup));
6851 }
6852 dasm_put(Dst, 4568, Dt1(->base), LJ_TTAB, LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0), DISPATCH_GOT(lj_gc_step_fixtop));
6853 break;
6854
6855 case BC_GGET:
6856 case BC_GSET:
6857 dasm_put(Dst, 4598, LJ_ENDIAN_SELECT(-8,-4), Dt7(->env));
6858 if (op == BC_GGET) {
6859 dasm_put(Dst, 4606);
6860 } else {
6861 dasm_put(Dst, 4609);
6862 }
6863 dasm_put(Dst, 4612);
6864 break;
6865
6866 case BC_TGETV:
6867 dasm_put(Dst, 4614, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TTAB, LJ_TISNUM, LJ_TSTR, Dt6(->asize), Dt6(->array), LJ_ENDIAN_SELECT(4,0), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
6868 dasm_put(Dst, 4689, LJ_ENDIAN_SELECT(0,4));
6869 break;
6870 case BC_TGETS:
6871 dasm_put(Dst, 4695, LJ_ENDIAN_SELECT(4,0), LJ_TTAB, LJ_ENDIAN_SELECT(0,4), Dt6(->hmask), Dt5(->hash), Dt6(->node), offsetof(Node, key)+LJ_ENDIAN_SELECT(4,0), offsetof(Node, key)+LJ_ENDIAN_SELECT(0,4), DtB(->next), offsetof(Node, val)+LJ_ENDIAN_SELECT(4,0), -LJ_TSTR, Dt6(->metatable), offsetof(Node, val)+LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4));
6872 dasm_put(Dst, 4764, LJ_TNIL, Dt6(->nomm), 1<<MM_index);
6873 break;
6874 case BC_TGETB:
6875 dasm_put(Dst, 4781, LJ_ENDIAN_SELECT(4,0), LJ_TTAB, LJ_ENDIAN_SELECT(0,4), Dt6(->asize), Dt6(->array), LJ_ENDIAN_SELECT(4,0), Dt6(->metatable), Dt6(->nomm), 1<<MM_index);
6876 break;
6877
6878 case BC_TSETV:
6879 dasm_put(Dst, 4838, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_TTAB, LJ_TISNUM, LJ_TSTR, Dt6(->asize), Dt6(->array), Dt6(->marked), LJ_ENDIAN_SELECT(4,0), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex);
6880 dasm_put(Dst, 4911, LJ_ENDIAN_SELECT(0,4), DISPATCH_GL(gc.grayagain), ~LJ_GC_BLACK & 255, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
6881 break;
6882 case BC_TSETS:
6883 dasm_put(Dst, 4939, LJ_ENDIAN_SELECT(4,0), LJ_TTAB, LJ_ENDIAN_SELECT(0,4), Dt6(->hmask), Dt5(->hash), Dt6(->node), Dt6(->nomm), offsetof(Node, key)+LJ_ENDIAN_SELECT(4,0), offsetof(Node, key)+LJ_ENDIAN_SELECT(0,4), LJ_TSTR, DtB(->next), offsetof(Node, val)+LJ_ENDIAN_SELECT(4,0), Dt6(->marked), Dt6(->metatable), LJ_GC_BLACK);
6884 dasm_put(Dst, 4997, DtB(->val), Dt6(->nomm), 1<<MM_newindex, Dt6(->metatable), DISPATCH_GL(tmptv), Dt6(->nomm), 1<<MM_newindex, LJ_TSTR, DISPATCH_GOT(lj_tab_newkey), LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0), Dt1(->base), Dt1(->base));
6885 dasm_put(Dst, 5059, DISPATCH_GL(gc.grayagain), ~LJ_GC_BLACK & 255, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
6886 break;
6887 case BC_TSETB:
6888 dasm_put(Dst, 5076, LJ_ENDIAN_SELECT(4,0), LJ_TTAB, LJ_ENDIAN_SELECT(0,4), Dt6(->asize), Dt6(->array), LJ_ENDIAN_SELECT(4,0), Dt6(->marked), LJ_GC_BLACK, Dt6(->metatable), Dt6(->nomm), 1<<MM_newindex, DISPATCH_GL(gc.grayagain));
6889 dasm_put(Dst, 5143, ~LJ_GC_BLACK & 255, DISPATCH_GL(gc.grayagain), Dt6(->marked), Dt6(->gclist));
6890 break;
6891
6892 case BC_TSETM:
6893 dasm_put(Dst, 5154, -8+LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(0,4), Dt6(->asize), Dt6(->marked), Dt6(->array), LJ_GC_BLACK, DISPATCH_GOT(lj_tab_reasize), Dt1(->base), Dt1(->base), DISPATCH_GL(gc.grayagain), ~LJ_GC_BLACK & 255, DISPATCH_GL(gc.grayagain), Dt6(->marked));
6894 dasm_put(Dst, 5227, Dt6(->gclist));
6895 break;
6896
6897 /* -- Calls and vararg handling ----------------------------------------- */
6898
6899 case BC_CALLM:
6900 dasm_put(Dst, 5232);
6901 break;
6902 case BC_CALL:
6903 dasm_put(Dst, 5237, LJ_TFUNC, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(-4,-8), Dt7(->pc));
6904 break;
6905
6906 case BC_CALLMT:
6907 dasm_put(Dst, 5266);
6908 break;
6909 case BC_CALLT:
6910 dasm_put(Dst, 5268, LJ_TFUNC, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(-4,-8), FRAME_TYPE, Dt7(->ffid), FRAME_VARG, LJ_ENDIAN_SELECT(-8,-4), Dt7(->pc), -8+LJ_ENDIAN_SELECT(-8,-4), Dt7(->pc));
6911 dasm_put(Dst, 5337, PC2PROTO(k), FRAME_TYPEP, LJ_ENDIAN_SELECT(-4,-8), FRAME_TYPE);
6912 break;
6913
6914 case BC_ITERC:
6915 dasm_put(Dst, 5353, LJ_TFUNC, -24+LJ_ENDIAN_SELECT(4,0), -24+LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(-4,-8), Dt7(->pc));
6916 break;
6917
6918 case BC_ITERN:
6919#if LJ_HASJIT
6920#endif
6921 dasm_put(Dst, 5388, -16+LJ_ENDIAN_SELECT(0,4), -8+LJ_ENDIAN_SELECT(0,4), Dt6(->asize), Dt6(->array), LJ_ENDIAN_SELECT(4,0), -4+LJ_ENDIAN_SELECT(2,0), (-(BCBIAS_J*4 >> 16) & 65535), -8+LJ_ENDIAN_SELECT(0,4), Dt6(->hmask), Dt6(->node), LJ_ENDIAN_SELECT(4,0), -4+LJ_ENDIAN_SELECT(2,0), DtB(->key), (-(BCBIAS_J*4 >> 16) & 65535));
6922 dasm_put(Dst, 5470, -8+LJ_ENDIAN_SELECT(0,4));
6923 break;
6924
6925 case BC_ISNEXT:
6926 dasm_put(Dst, 5473, -24+LJ_ENDIAN_SELECT(4,0), -24+LJ_ENDIAN_SELECT(0,4), -16+LJ_ENDIAN_SELECT(4,0), -8+LJ_ENDIAN_SELECT(4,0), LJ_TFUNC, -LJ_TTAB, Dt8(->ffid), -LJ_TNIL, -FF_next_N, (-(BCBIAS_J*4 >> 16) & 65535), -8+LJ_ENDIAN_SELECT(0,4), BC_JMP, BC_ITERC, -4+LJ_ENDIAN_SELECT(0,3), LJ_ENDIAN_SELECT(0,3));
6927 break;
6928
6929 case BC_VARG:
6930 dasm_put(Dst, 5530, LJ_ENDIAN_SELECT(-4,-8), FRAME_VARG, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), Dt1(->maxstack), DISPATCH_GOT(lj_state_growstack), Dt1(->top), Dt1(->base), Dt1(->base));
6931 dasm_put(Dst, 5617);
6932 break;
6933
6934 /* -- Returns ----------------------------------------------------------- */
6935
6936 case BC_RETM:
6937 dasm_put(Dst, 5619);
6938 break;
6939
6940 case BC_RET:
6941 dasm_put(Dst, 5621, LJ_ENDIAN_SELECT(-4,-8), FRAME_TYPE, FRAME_VARG, LJ_ENDIAN_SELECT(-8,-4), Dt7(->pc), PC2PROTO(k), LJ_ENDIAN_SELECT(4,0), FRAME_TYPEP, LJ_ENDIAN_SELECT(-4,-8));
6942 break;
6943
6944 case BC_RET0: case BC_RET1:
6945 dasm_put(Dst, 5693, LJ_ENDIAN_SELECT(-4,-8), FRAME_TYPE, FRAME_VARG);
6946 if (op == BC_RET1) {
6947 dasm_put(Dst, 5706);
6948 }
6949 dasm_put(Dst, 5708);
6950 if (op == BC_RET1) {
6951 dasm_put(Dst, 5713);
6952 }
6953 dasm_put(Dst, 5715, LJ_ENDIAN_SELECT(-8,-4), Dt7(->pc), PC2PROTO(k));
6954 if (op == BC_RET1) {
6955 dasm_put(Dst, 5743, LJ_ENDIAN_SELECT(4,0));
6956 } else {
6957 dasm_put(Dst, 5746, -8+LJ_ENDIAN_SELECT(4,0));
6958 }
6959 break;
6960
6961 /* -- Loops and branches ------------------------------------------------ */
6962
6963 case BC_FORL:
6964#if LJ_HASJIT
6965 dasm_put(Dst, 5749);
6966#endif
6967 break;
6968
6969 case BC_JFORI:
6970 case BC_JFORL:
6971#if !LJ_HASJIT
6972 break;
6973#endif
6974 case BC_FORI:
6975 case BC_IFORL:
6976 vk = (op == BC_IFORL || op == BC_JFORL);
6977 dasm_put(Dst, 5751);
6978 if (vk) {
6979 dasm_put(Dst, 5753, FORL_IDX*8, FORL_STEP*8, FORL_STOP*8, FORL_STEP*8+LJ_ENDIAN_SELECT(4,0), FORL_IDX*8);
6980 } else {
6981 dasm_put(Dst, 5765, FORL_IDX*8+LJ_ENDIAN_SELECT(4,0), FORL_STEP*8+LJ_ENDIAN_SELECT(4,0), FORL_STOP*8+LJ_ENDIAN_SELECT(4,0), LJ_TISNUM, LJ_TISNUM, LJ_TISNUM, FORL_IDX*8, FORL_STOP*8);
6982 }
6983 if (op != BC_JFORL) {
6984 dasm_put(Dst, 5786, (-(BCBIAS_J*4 >> 16) & 65535));
6985 }
6986 dasm_put(Dst, 5790, FORL_EXT*8);
6987 if (op == BC_JFORI) {
6988 dasm_put(Dst, 5795, BC_JLOOP);
6989 } else if (op == BC_JFORL) {
6990 dasm_put(Dst, 5808, BC_JLOOP);
6991 } else {
6992 dasm_put(Dst, 5818);
6993 if (op == BC_FORI) {
6994 dasm_put(Dst, 5822);
6995 } else {
6996 dasm_put(Dst, 5825);
6997 }
6998 dasm_put(Dst, 5828);
6999 }
7000 dasm_put(Dst, 5831);
7001 break;
7002
7003 case BC_ITERL:
7004#if LJ_HASJIT
7005 dasm_put(Dst, 5843);
7006#endif
7007 break;
7008
7009 case BC_JITERL:
7010#if !LJ_HASJIT
7011 break;
7012#endif
7013 case BC_IITERL:
7014 dasm_put(Dst, 5845, LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4));
7015 if (op == BC_JITERL) {
7016 dasm_put(Dst, 5853, -8+LJ_ENDIAN_SELECT(4,0), BC_JLOOP, -8+LJ_ENDIAN_SELECT(0,4));
7017 } else {
7018 dasm_put(Dst, 5860, (-(BCBIAS_J*4 >> 16) & 65535), -8+LJ_ENDIAN_SELECT(4,0), -8+LJ_ENDIAN_SELECT(0,4));
7019 }
7020 dasm_put(Dst, 5870);
7021 break;
7022
7023 case BC_LOOP:
7024#if LJ_HASJIT
7025 dasm_put(Dst, 5883);
7026#endif
7027 break;
7028
7029 case BC_ILOOP:
7030 dasm_put(Dst, 5885);
7031 break;
7032
7033 case BC_JLOOP:
7034#if LJ_HASJIT
7035 dasm_put(Dst, 5897, DISPATCH_J(trace), DISPATCH_GL(vmstate), DISPATCH_GL(jit_base), DISPATCH_GL(jit_L), DtD(->mcode), GG_DISP2G+32768);
7036#endif
7037 break;
7038
7039 case BC_JMP:
7040 dasm_put(Dst, 5915, (-(BCBIAS_J*4 >> 16) & 65535));
7041 break;
7042
7043 /* -- Function headers -------------------------------------------------- */
7044
7045 case BC_FUNCF:
7046#if LJ_HASJIT
7047 dasm_put(Dst, 5932);
7048#endif
7049 case BC_FUNCV: /* NYI: compiled vararg functions. */
7050 break;
7051
7052 case BC_JFUNCF:
7053#if !LJ_HASJIT
7054 break;
7055#endif
7056 case BC_IFUNCF:
7057 dasm_put(Dst, 5934, Dt1(->maxstack), -4+PC2PROTO(numparams), -4+PC2PROTO(k));
7058 if (op != BC_JFUNCF) {
7059 dasm_put(Dst, 5945);
7060 }
7061 dasm_put(Dst, 5948);
7062 if (op == BC_JFUNCF) {
7063 dasm_put(Dst, 5954, BC_JLOOP);
7064 } else {
7065 dasm_put(Dst, 5959);
7066 }
7067 dasm_put(Dst, 5969, LJ_ENDIAN_SELECT(4,0));
7068 break;
7069
7070 case BC_JFUNCV:
7071#if !LJ_HASJIT
7072 break;
7073#endif
7074 dasm_put(Dst, 5976);
7075 break; /* NYI: compiled vararg functions. */
7076
7077 case BC_IFUNCV:
7078 dasm_put(Dst, 5978, Dt1(->maxstack), LJ_ENDIAN_SELECT(0,4), 8+FRAME_VARG, -4+PC2PROTO(k), LJ_ENDIAN_SELECT(4,0), -4+PC2PROTO(numparams), LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(0,4), 8+LJ_ENDIAN_SELECT(0,4), 8+LJ_ENDIAN_SELECT(4,0), LJ_ENDIAN_SELECT(4,0));
7079 break;
7080
7081 case BC_FUNCC:
7082 case BC_FUNCCW:
7083 if (op == BC_FUNCC) {
7084 dasm_put(Dst, 6033, Dt8(->f));
7085 } else {
7086 dasm_put(Dst, 6036, DISPATCH_GL(wrapf));
7087 }
7088 dasm_put(Dst, 6039, Dt1(->maxstack), Dt1(->base), Dt1(->top), ~LJ_VMST_C);
7089 if (op == BC_FUNCCW) {
7090 dasm_put(Dst, 6051, Dt8(->f));
7091 }
7092 dasm_put(Dst, 6054, DISPATCH_GL(vmstate), Dt1(->base), Dt1(->top), ~LJ_VMST_INTERP, LJ_ENDIAN_SELECT(-4,-8), DISPATCH_GL(vmstate));
7093 break;
7094
7095 /* ---------------------------------------------------------------------- */
7096
7097 default:
7098 fprintf(stderr, "Error: undefined opcode BC_%s\n", bc_names[op]);
7099 exit(2);
7100 break;
7101 }
7102}
7103
7104static int build_backend(BuildCtx *ctx)
7105{
7106 int op;
7107
7108 dasm_growpc(Dst, BC__MAX);
7109
7110 build_subroutines(ctx);
7111
7112 dasm_put(Dst, 6075);
7113 for (op = 0; op < BC__MAX; op++)
7114 build_ins(ctx, (BCOp)op, op);
7115
7116 return BC__MAX;
7117}
7118
7119/* Emit pseudo frame-info for all assembler functions. */
7120static void emit_asm_debug(BuildCtx *ctx)
7121{
7122 int fcofs = (int)((uint8_t *)ctx->glob[GLOB_vm_ffi_call] - ctx->code);
7123 int i;
7124 switch (ctx->mode) {
7125 case BUILD_elfasm:
7126 fprintf(ctx->fp, "\t.section .debug_frame,\"\",@progbits\n");
7127 fprintf(ctx->fp,
7128 ".Lframe0:\n"
7129 "\t.4byte .LECIE0-.LSCIE0\n"
7130 ".LSCIE0:\n"
7131 "\t.4byte 0xffffffff\n"
7132 "\t.byte 0x1\n"
7133 "\t.string \"\"\n"
7134 "\t.uleb128 0x1\n"
7135 "\t.sleb128 -4\n"
7136 "\t.byte 31\n"
7137 "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 0\n"
7138 "\t.align 2\n"
7139 ".LECIE0:\n\n");
7140 fprintf(ctx->fp,
7141 ".LSFDE0:\n"
7142 "\t.4byte .LEFDE0-.LASFDE0\n"
7143 ".LASFDE0:\n"
7144 "\t.4byte .Lframe0\n"
7145 "\t.4byte .Lbegin\n"
7146 "\t.4byte %d\n"
7147 "\t.byte 0xe\n\t.uleb128 %d\n"
7148 "\t.byte 0x9f\n\t.sleb128 1\n"
7149 "\t.byte 0x9e\n\t.sleb128 2\n",
7150 fcofs, CFRAME_SIZE);
7151 for (i = 23; i >= 16; i--)
7152 fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+i, 26-i);
7153 for (i = 30; i >= 20; i -= 2)
7154 fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+32+i, 42-i);
7155 fprintf(ctx->fp,
7156 "\t.align 2\n"
7157 ".LEFDE0:\n\n");
7158#if LJ_HASFFI
7159 fprintf(ctx->fp,
7160 ".LSFDE1:\n"
7161 "\t.4byte .LEFDE1-.LASFDE1\n"
7162 ".LASFDE1:\n"
7163 "\t.4byte .Lframe0\n"
7164 "\t.4byte lj_vm_ffi_call\n"
7165 "\t.4byte %d\n"
7166 "\t.byte 0x9f\n\t.uleb128 1\n"
7167 "\t.byte 0x90\n\t.uleb128 2\n"
7168 "\t.byte 0xd\n\t.uleb128 0x10\n"
7169 "\t.align 2\n"
7170 ".LEFDE1:\n\n", (int)ctx->codesz - fcofs);
7171#endif
7172 fprintf(ctx->fp, "\t.section .eh_frame,\"aw\",@progbits\n");
7173 fprintf(ctx->fp,
7174 "\t.globl lj_err_unwind_dwarf\n"
7175 ".Lframe1:\n"
7176 "\t.4byte .LECIE1-.LSCIE1\n"
7177 ".LSCIE1:\n"
7178 "\t.4byte 0\n"
7179 "\t.byte 0x1\n"
7180 "\t.string \"zPR\"\n"
7181 "\t.uleb128 0x1\n"
7182 "\t.sleb128 -4\n"
7183 "\t.byte 31\n"
7184 "\t.uleb128 6\n" /* augmentation length */
7185 "\t.byte 0\n"
7186 "\t.4byte lj_err_unwind_dwarf\n"
7187 "\t.byte 0\n"
7188 "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 0\n"
7189 "\t.align 2\n"
7190 ".LECIE1:\n\n");
7191 fprintf(ctx->fp,
7192 ".LSFDE2:\n"
7193 "\t.4byte .LEFDE2-.LASFDE2\n"
7194 ".LASFDE2:\n"
7195 "\t.4byte .LASFDE2-.Lframe1\n"
7196 "\t.4byte .Lbegin\n"
7197 "\t.4byte %d\n"
7198 "\t.uleb128 0\n" /* augmentation length */
7199 "\t.byte 0xe\n\t.uleb128 %d\n"
7200 "\t.byte 0x9f\n\t.sleb128 1\n"
7201 "\t.byte 0x9e\n\t.sleb128 2\n",
7202 fcofs, CFRAME_SIZE);
7203 for (i = 23; i >= 16; i--)
7204 fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+i, 26-i);
7205 for (i = 30; i >= 20; i -= 2)
7206 fprintf(ctx->fp, "\t.byte %d\n\t.uleb128 %d\n", 0x80+32+i, 42-i);
7207 fprintf(ctx->fp,
7208 "\t.align 2\n"
7209 ".LEFDE2:\n\n");
7210#if LJ_HASFFI
7211 fprintf(ctx->fp,
7212 ".Lframe2:\n"
7213 "\t.4byte .LECIE2-.LSCIE2\n"
7214 ".LSCIE2:\n"
7215 "\t.4byte 0\n"
7216 "\t.byte 0x1\n"
7217 "\t.string \"zR\"\n"
7218 "\t.uleb128 0x1\n"
7219 "\t.sleb128 -4\n"
7220 "\t.byte 31\n"
7221 "\t.uleb128 1\n" /* augmentation length */
7222 "\t.byte 0\n"
7223 "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 0\n"
7224 "\t.align 2\n"
7225 ".LECIE2:\n\n");
7226 fprintf(ctx->fp,
7227 ".LSFDE3:\n"
7228 "\t.4byte .LEFDE3-.LASFDE3\n"
7229 ".LASFDE3:\n"
7230 "\t.4byte .LASFDE3-.Lframe2\n"
7231 "\t.4byte lj_vm_ffi_call\n"
7232 "\t.4byte %d\n"
7233 "\t.uleb128 0\n" /* augmentation length */
7234 "\t.byte 0x9f\n\t.uleb128 1\n"
7235 "\t.byte 0x90\n\t.uleb128 2\n"
7236 "\t.byte 0xd\n\t.uleb128 0x10\n"
7237 "\t.align 2\n"
7238 ".LEFDE3:\n\n", (int)ctx->codesz - fcofs);
7239#endif
7240 break;
7241 default:
7242 break;
7243 }
7244}
7245
diff --git a/src/lib_base.c b/src/lib_base.c
index f8975986..1f8bb5fd 100644
--- a/src/lib_base.c
+++ b/src/lib_base.c
@@ -591,8 +591,10 @@ LJLIB_NOREG LJLIB_ASM(coroutine_wrap_aux)
591 591
592/* Inline declarations. */ 592/* Inline declarations. */
593LJ_ASMF void lj_ff_coroutine_wrap_aux(void); 593LJ_ASMF void lj_ff_coroutine_wrap_aux(void);
594#if !(LJ_TARGET_MIPS && defined(ljamalg_c))
594LJ_FUNCA_NORET void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L, 595LJ_FUNCA_NORET void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L,
595 lua_State *co); 596 lua_State *co);
597#endif
596 598
597/* Error handler, called from assembler VM. */ 599/* Error handler, called from assembler VM. */
598void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L, lua_State *co) 600void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L, lua_State *co)
diff --git a/src/lj_arch.h b/src/lj_arch.h
index 3a52c212..4b680306 100644
--- a/src/lj_arch.h
+++ b/src/lj_arch.h
@@ -188,13 +188,14 @@
188 188
189#elif LUAJIT_TARGET == LUAJIT_ARCH_MIPS 189#elif LUAJIT_TARGET == LUAJIT_ARCH_MIPS
190 190
191#define LJ_ARCH_NAME "mips"
192#define LJ_ARCH_BITS 32
193#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) 191#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL)
192#define LJ_ARCH_NAME "mipsel"
194#define LJ_ARCH_ENDIAN LUAJIT_LE 193#define LJ_ARCH_ENDIAN LUAJIT_LE
195#else 194#else
195#define LJ_ARCH_NAME "mips"
196#define LJ_ARCH_ENDIAN LUAJIT_BE 196#define LJ_ARCH_ENDIAN LUAJIT_BE
197#endif 197#endif
198#define LJ_ARCH_BITS 32
198#define LJ_ARCH_HASFPU 1 199#define LJ_ARCH_HASFPU 1
199#define LJ_TARGET_MIPS 1 200#define LJ_TARGET_MIPS 1
200#define LJ_TARGET_EHRETREG 4 201#define LJ_TARGET_EHRETREG 4
@@ -203,7 +204,6 @@
203#define LJ_TARGET_MASKROT 1 204#define LJ_TARGET_MASKROT 1
204#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */ 205#define LJ_TARGET_UNIFYROT 2 /* Want only IR_BROR. */
205#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE 206#define LJ_ARCH_NUMMODE LJ_NUMMODE_SINGLE
206#define LJ_ARCH_NOFFI 1
207#define LJ_ARCH_NOJIT 1 207#define LJ_ARCH_NOJIT 1
208 208
209#else 209#else
diff --git a/src/lj_ccall.c b/src/lj_ccall.c
index 5ed1bf5b..97ad4f02 100644
--- a/src/lj_ccall.c
+++ b/src/lj_ccall.c
@@ -290,6 +290,59 @@
290 goto done; \ 290 goto done; \
291 } 291 }
292 292
293#elif LJ_TARGET_MIPS
294/* -- MIPS calling conventions -------------------------------------------- */
295
296#define CCALL_HANDLE_STRUCTRET \
297 cc->retref = 1; /* Return all structs by reference. */ \
298 cc->gpr[ngpr++] = (GPRArg)dp;
299
300#define CCALL_HANDLE_COMPLEXRET \
301 /* Complex values are returned in 1 or 2 FPRs. */ \
302 cc->retref = 0;
303
304#define CCALL_HANDLE_COMPLEXRET2 \
305 if (ctr->size == 2*sizeof(float)) { /* Copy complex float from FPRs. */ \
306 ((float *)dp)[0] = cc->fpr[0].f; \
307 ((float *)dp)[1] = cc->fpr[1].f; \
308 } else { /* Copy complex double from FPRs. */ \
309 ((double *)dp)[0] = cc->fpr[0].d; \
310 ((double *)dp)[1] = cc->fpr[1].d; \
311 }
312
313#define CCALL_HANDLE_STRUCTARG \
314 /* Pass all structs by value in registers and/or on the stack. */
315
316#define CCALL_HANDLE_COMPLEXARG \
317 /* Pass complex by value in 2 or 4 GPRs. */
318
319#define CCALL_HANDLE_REGARG \
320 if (isfp && nfpr < CCALL_NARG_FPR && !(ct->info & CTF_VARARG)) { \
321 /* Try to pass argument in FPRs. */ \
322 dp = n == 1 ? (void *)&cc->fpr[nfpr].f : (void *)&cc->fpr[nfpr].d; \
323 nfpr++; ngpr += n; \
324 goto done; \
325 } else { /* Try to pass argument in GPRs. */ \
326 nfpr = CCALL_NARG_FPR; \
327 if ((d->info & CTF_ALIGN) > CTALIGN_PTR) \
328 ngpr = (ngpr + 1u) & ~1u; /* Align to regpair. */ \
329 if (ngpr < maxgpr) { \
330 dp = &cc->gpr[ngpr]; \
331 if (ngpr + n > maxgpr) { \
332 nsp += ngpr + n - maxgpr; /* Assumes contiguous gpr/stack fields. */ \
333 if (nsp > CCALL_MAXSTACK) goto err_nyi; /* Too many arguments. */ \
334 ngpr = maxgpr; \
335 } else { \
336 ngpr += n; \
337 } \
338 goto done; \
339 } \
340 }
341
342#define CCALL_HANDLE_RET \
343 if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \
344 sp = (uint8_t *)&cc->fpr[0].f;
345
293#else 346#else
294#error "Missing calling convention definitions for this architecture" 347#error "Missing calling convention definitions for this architecture"
295#endif 348#endif
@@ -622,13 +675,13 @@ static int ccall_get_results(lua_State *L, CTState *cts, CType *ct,
622 } 675 }
623 if (LJ_BE && ctype_isinteger_or_bool(ctr->info) && ctr->size < CTSIZE_PTR) 676 if (LJ_BE && ctype_isinteger_or_bool(ctr->info) && ctr->size < CTSIZE_PTR)
624 sp += (CTSIZE_PTR - ctr->size); 677 sp += (CTSIZE_PTR - ctr->size);
625#ifdef CCALL_HANDLE_RET
626 CCALL_HANDLE_RET
627#endif
628#if CCALL_NUM_FPR 678#if CCALL_NUM_FPR
629 if (ctype_isfp(ctr->info) || ctype_isvector(ctr->info)) 679 if (ctype_isfp(ctr->info) || ctype_isvector(ctr->info))
630 sp = (uint8_t *)&cc->fpr[0]; 680 sp = (uint8_t *)&cc->fpr[0];
631#endif 681#endif
682#ifdef CCALL_HANDLE_RET
683 CCALL_HANDLE_RET
684#endif
632 /* No reference types end up here, so there's no need for the CTypeID. */ 685 /* No reference types end up here, so there's no need for the CTypeID. */
633 lua_assert(!(ctype_isrefarray(ctr->info) || ctype_isstruct(ctr->info))); 686 lua_assert(!(ctype_isrefarray(ctr->info) || ctype_isstruct(ctr->info)));
634 if (ctype_isenum(ctr->info)) ctr = ctype_child(cts, ctr); 687 if (ctype_isenum(ctr->info)) ctr = ctype_child(cts, ctr);
diff --git a/src/lj_ccall.h b/src/lj_ccall.h
index 0641625f..c94b6193 100644
--- a/src/lj_ccall.h
+++ b/src/lj_ccall.h
@@ -80,6 +80,21 @@ typedef double FPRArg;
80 80
81typedef intptr_t GPRArg; 81typedef intptr_t GPRArg;
82 82
83#elif LJ_TARGET_MIPS
84
85#define CCALL_NARG_GPR 4
86#define CCALL_NARG_FPR 2
87#define CCALL_NRET_GPR 2
88#define CCALL_NRET_FPR 2
89#define CCALL_SPS_EXTRA 7
90#define CCALL_SPS_FREE 1
91
92typedef intptr_t GPRArg;
93typedef union FPRArg {
94 double d;
95 struct { LJ_ENDIAN_LOHI(float f; , float g;) };
96} FPRArg;
97
83#else 98#else
84#error "Missing calling convention definitions for this architecture" 99#error "Missing calling convention definitions for this architecture"
85#endif 100#endif
diff --git a/src/lj_ccallback.c b/src/lj_ccallback.c
index 3c95958d..d73153b1 100644
--- a/src/lj_ccallback.c
+++ b/src/lj_ccallback.c
@@ -57,6 +57,13 @@ static MSize CALLBACK_OFS2SLOT(MSize ofs)
57#define CALLBACK_OFS2SLOT(ofs) (((ofs)-CALLBACK_MCODE_HEAD)/8) 57#define CALLBACK_OFS2SLOT(ofs) (((ofs)-CALLBACK_MCODE_HEAD)/8)
58#define CALLBACK_MAX_SLOT (CALLBACK_OFS2SLOT(CALLBACK_MCODE_SIZE)) 58#define CALLBACK_MAX_SLOT (CALLBACK_OFS2SLOT(CALLBACK_MCODE_SIZE))
59 59
60#elif LJ_TARGET_MIPS
61
62#define CALLBACK_MCODE_HEAD 24
63#define CALLBACK_SLOT2OFS(slot) (CALLBACK_MCODE_HEAD + 8*(slot))
64#define CALLBACK_OFS2SLOT(ofs) (((ofs)-CALLBACK_MCODE_HEAD)/8)
65#define CALLBACK_MAX_SLOT (CALLBACK_OFS2SLOT(CALLBACK_MCODE_SIZE))
66
60#else 67#else
61 68
62/* Missing support for this architecture. */ 69/* Missing support for this architecture. */
@@ -158,6 +165,25 @@ static void callback_mcode_init(global_State *g, uint32_t *page)
158 } 165 }
159 lua_assert(p - page <= CALLBACK_MCODE_SIZE); 166 lua_assert(p - page <= CALLBACK_MCODE_SIZE);
160} 167}
168#elif LJ_TARGET_MIPS
169static void callback_mcode_init(global_State *g, uint32_t *page)
170{
171 uint32_t *p = page;
172 void *target = (void *)lj_vm_ffi_callback;
173 MSize slot;
174 *p++ = MIPSI_SW | MIPSF_T(RID_R1)|MIPSF_S(RID_SP) | 0;
175 *p++ = MIPSI_LUI | MIPSF_T(RID_R3) | (u32ptr(target) >> 16);
176 *p++ = MIPSI_LUI | MIPSF_T(RID_R2) | (u32ptr(g) >> 16);
177 *p++ = MIPSI_ORI | MIPSF_T(RID_R3)|MIPSF_S(RID_R3) |(u32ptr(target)&0xffff);
178 *p++ = MIPSI_JR | MIPSF_S(RID_R3);
179 *p++ = MIPSI_ORI | MIPSF_T(RID_R2)|MIPSF_S(RID_R2) | (u32ptr(g)&0xffff);
180 for (slot = 0; slot < CALLBACK_MAX_SLOT; slot++) {
181 *p = MIPSI_B | ((page-p-1) & 0x0000ffffu);
182 p++;
183 *p++ = MIPSI_LI | MIPSF_T(RID_R1) | slot;
184 }
185 lua_assert(p - page <= CALLBACK_MCODE_SIZE);
186}
161#else 187#else
162/* Missing support for this architecture. */ 188/* Missing support for this architecture. */
163#define callback_mcode_init(g, p) UNUSED(p) 189#define callback_mcode_init(g, p) UNUSED(p)
@@ -308,6 +334,27 @@ void lj_ccallback_mcode_free(CTState *cts)
308 if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \ 334 if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \
309 *(double *)dp = *(float *)dp; /* FPRs always hold doubles. */ 335 *(double *)dp = *(float *)dp; /* FPRs always hold doubles. */
310 336
337#elif LJ_TARGET_MIPS
338
339#define CALLBACK_HANDLE_REGARG \
340 if (isfp && nfpr < CCALL_NARG_FPR) { /* Try to pass argument in FPRs. */ \
341 sp = (void *)((uint8_t *)&cts->cb.fpr[nfpr] + ((LJ_BE && n==1) ? 4 : 0)); \
342 nfpr++; ngpr += n; \
343 goto done; \
344 } else { /* Try to pass argument in GPRs. */ \
345 nfpr = CCALL_NARG_FPR; \
346 if (n > 1) ngpr = (ngpr + 1u) & ~1u; /* Align to regpair. */ \
347 if (ngpr + n <= maxgpr) { \
348 sp = &cts->cb.gpr[ngpr]; \
349 ngpr += n; \
350 goto done; \
351 } \
352 }
353
354#define CALLBACK_HANDLE_RET \
355 if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \
356 ((float *)dp)[1] = *(float *)dp;
357
311#else 358#else
312#error "Missing calling convention definitions for this architecture" 359#error "Missing calling convention definitions for this architecture"
313#endif 360#endif
diff --git a/src/lj_dispatch.c b/src/lj_dispatch.c
index 38fd1709..d99eb878 100644
--- a/src/lj_dispatch.c
+++ b/src/lj_dispatch.c
@@ -8,6 +8,10 @@
8 8
9#include "lj_obj.h" 9#include "lj_obj.h"
10#include "lj_err.h" 10#include "lj_err.h"
11#include "lj_func.h"
12#include "lj_str.h"
13#include "lj_tab.h"
14#include "lj_meta.h"
11#include "lj_debug.h" 15#include "lj_debug.h"
12#include "lj_state.h" 16#include "lj_state.h"
13#include "lj_frame.h" 17#include "lj_frame.h"
@@ -16,6 +20,9 @@
16#if LJ_HASJIT 20#if LJ_HASJIT
17#include "lj_jit.h" 21#include "lj_jit.h"
18#endif 22#endif
23#if LJ_HASFFI
24#include "lj_ccallback.h"
25#endif
19#include "lj_trace.h" 26#include "lj_trace.h"
20#include "lj_dispatch.h" 27#include "lj_dispatch.h"
21#include "lj_vm.h" 28#include "lj_vm.h"
@@ -26,6 +33,18 @@ LJ_STATIC_ASSERT(GG_NUM_ASMFF == FF_NUM_ASMFUNC);
26 33
27/* -- Dispatch table management ------------------------------------------- */ 34/* -- Dispatch table management ------------------------------------------- */
28 35
36#if LJ_TARGET_MIPS
37#include <math.h>
38LJ_FUNCA_NORET void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L,
39 lua_State *co);
40
41#define GOTFUNC(name) (ASMFunction)name,
42static const ASMFunction dispatch_got[] = {
43 GOTDEF(GOTFUNC)
44};
45#undef GOTFUNC
46#endif
47
29/* Initialize instruction dispatch table and hot counters. */ 48/* Initialize instruction dispatch table and hot counters. */
30void lj_dispatch_init(GG_State *GG) 49void lj_dispatch_init(GG_State *GG)
31{ 50{
@@ -44,6 +63,9 @@ void lj_dispatch_init(GG_State *GG)
44 GG->g.bc_cfunc_ext = GG->g.bc_cfunc_int = BCINS_AD(BC_FUNCC, LUA_MINSTACK, 0); 63 GG->g.bc_cfunc_ext = GG->g.bc_cfunc_int = BCINS_AD(BC_FUNCC, LUA_MINSTACK, 0);
45 for (i = 0; i < GG_NUM_ASMFF; i++) 64 for (i = 0; i < GG_NUM_ASMFF; i++)
46 GG->bcff[i] = BCINS_AD(BC__MAX+i, 0, 0); 65 GG->bcff[i] = BCINS_AD(BC__MAX+i, 0, 0);
66#if LJ_TARGET_MIPS
67 memcpy(GG->got, dispatch_got, LJ_GOT__MAX*4);
68#endif
47} 69}
48 70
49#if LJ_HASJIT 71#if LJ_HASJIT
diff --git a/src/lj_dispatch.h b/src/lj_dispatch.h
index c50d33ac..7dec0437 100644
--- a/src/lj_dispatch.h
+++ b/src/lj_dispatch.h
@@ -12,6 +12,41 @@
12#include "lj_jit.h" 12#include "lj_jit.h"
13#endif 13#endif
14 14
15#if LJ_TARGET_MIPS
16/* Need our own global offset table for the dreaded MIPS calling conventions. */
17#if LJ_HASJIT
18#define JITGOTDEF(_) _(lj_trace_exit) _(lj_trace_hot)
19#else
20#define JITGOTDEF(_)
21#endif
22#if LJ_HASFFI
23#define FFIGOTDEF(_) \
24 _(lj_meta_equal_cd) _(lj_ccallback_enter) _(lj_ccallback_leave)
25#else
26#define FFIGOTDEF(_)
27#endif
28#define GOTDEF(_) \
29 _(floor) _(ceil) _(trunc) _(log) _(log10) _(exp) _(sin) _(cos) _(tan) \
30 _(asin) _(acos) _(atan) _(sinh) _(cosh) _(tanh) _(frexp) _(modf) _(atan2) \
31 _(pow) _(fmod) _(ldexp) \
32 _(lj_dispatch_call) _(lj_dispatch_ins) _(lj_err_throw) \
33 _(lj_ffh_coroutine_wrap_err) _(lj_func_closeuv) _(lj_func_newL_gc) \
34 _(lj_gc_barrieruv) _(lj_gc_step) _(lj_gc_step_fixtop) _(lj_meta_arith) \
35 _(lj_meta_call) _(lj_meta_cat) _(lj_meta_comp) _(lj_meta_equal) \
36 _(lj_meta_for) _(lj_meta_len) _(lj_meta_tget) _(lj_meta_tset) \
37 _(lj_state_growstack) _(lj_str_fromnum) _(lj_str_fromnumber) _(lj_str_new) \
38 _(lj_tab_dup) _(lj_tab_get) _(lj_tab_getinth) _(lj_tab_len) _(lj_tab_new) \
39 _(lj_tab_newkey) _(lj_tab_next) _(lj_tab_reasize) \
40 JITGOTDEF(_) FFIGOTDEF(_)
41
42enum {
43#define GOTENUM(name) LJ_GOT_##name,
44GOTDEF(GOTENUM)
45#undef GOTENUM
46 LJ_GOT__MAX
47};
48#endif
49
15/* Type of hot counter. Must match the code in the assembler VM. */ 50/* Type of hot counter. Must match the code in the assembler VM. */
16/* 16 bits are sufficient. Only 0.0015% overhead with maximum slot penalty. */ 51/* 16 bits are sufficient. Only 0.0015% overhead with maximum slot penalty. */
17typedef uint16_t HotCount; 52typedef uint16_t HotCount;
@@ -35,6 +70,9 @@ typedef uint16_t HotCount;
35typedef struct GG_State { 70typedef struct GG_State {
36 lua_State L; /* Main thread. */ 71 lua_State L; /* Main thread. */
37 global_State g; /* Global state. */ 72 global_State g; /* Global state. */
73#if LJ_TARGET_MIPS
74 ASMFunction got[LJ_GOT__MAX]; /* Global offset table. */
75#endif
38#if LJ_HASJIT 76#if LJ_HASJIT
39 jit_State J; /* JIT state. */ 77 jit_State J; /* JIT state. */
40 HotCount hotcount[HOTCOUNT_SIZE]; /* Hot counters. */ 78 HotCount hotcount[HOTCOUNT_SIZE]; /* Hot counters. */
diff --git a/src/lj_frame.h b/src/lj_frame.h
index a69917ee..8b2f3b4f 100644
--- a/src/lj_frame.h
+++ b/src/lj_frame.h
@@ -118,14 +118,13 @@ enum {
118#define CFRAME_SIZE 184 118#define CFRAME_SIZE 184
119#define CFRAME_SHIFT_MULTRES 3 119#define CFRAME_SHIFT_MULTRES 3
120#elif LJ_TARGET_MIPS 120#elif LJ_TARGET_MIPS
121/* NYI: Dummy definitions for now. */ 121#define CFRAME_OFS_ERRF 124
122#define CFRAME_OFS_ERRF 0 122#define CFRAME_OFS_NRES 120
123#define CFRAME_OFS_NRES 0 123#define CFRAME_OFS_PREV 116
124#define CFRAME_OFS_PREV 0 124#define CFRAME_OFS_L 112
125#define CFRAME_OFS_L 0 125#define CFRAME_OFS_PC 20
126#define CFRAME_OFS_PC 0 126#define CFRAME_OFS_MULTRES 16
127#define CFRAME_OFS_MULTRES 0 127#define CFRAME_SIZE 112
128#define CFRAME_SIZE 256
129#define CFRAME_SHIFT_MULTRES 3 128#define CFRAME_SHIFT_MULTRES 3
130#else 129#else
131#error "Missing CFRAME_* definitions for this architecture" 130#error "Missing CFRAME_* definitions for this architecture"
diff --git a/src/lj_target.h b/src/lj_target.h
index c302d301..0dab8da4 100644
--- a/src/lj_target.h
+++ b/src/lj_target.h
@@ -138,6 +138,8 @@ typedef uint32_t RegCost;
138#include "lj_target_arm.h" 138#include "lj_target_arm.h"
139#elif LJ_TARGET_PPC 139#elif LJ_TARGET_PPC
140#include "lj_target_ppc.h" 140#include "lj_target_ppc.h"
141#elif LJ_TARGET_MIPS
142#include "lj_target_mips.h"
141#else 143#else
142#error "Missing include for target CPU" 144#error "Missing include for target CPU"
143#endif 145#endif
diff --git a/src/lj_target_mips.h b/src/lj_target_mips.h
new file mode 100644
index 00000000..88d066d6
--- /dev/null
+++ b/src/lj_target_mips.h
@@ -0,0 +1,153 @@
1/*
2** Definitions for MIPS CPUs.
3** Copyright (C) 2005-2012 Mike Pall. See Copyright Notice in luajit.h
4*/
5
6#ifndef _LJ_TARGET_MIPS_H
7#define _LJ_TARGET_MIPS_H
8
9/* -- Registers IDs ------------------------------------------------------- */
10
11#define GPRDEF(_) \
12 _(R0) _(R1) _(R2) _(R3) _(R4) _(R5) _(R6) _(R7) \
13 _(R8) _(R9) _(R10) _(R11) _(R12) _(R13) _(R14) _(R15) \
14 _(R16) _(R17) _(R18) _(R19) _(R20) _(R21) _(R22) _(R23) \
15 _(R24) _(R25) _(SYS1) _(SYS2) _(GP) _(SP) _(R30) _(RA)
16#define FPRDEF(_) \
17 _(F0) _(F1) _(F2) _(F3) _(F4) _(F5) _(F6) _(F7) \
18 _(F8) _(F9) _(F10) _(F11) _(F12) _(F13) _(F14) _(F15) \
19 _(F16) _(F17) _(F18) _(F19) _(F20) _(F21) _(F22) _(F23) \
20 _(F24) _(F25) _(F26) _(F27) _(F28) _(F29) _(F30) _(F31)
21#define VRIDDEF(_)
22
23#define RIDENUM(name) RID_##name,
24
25enum {
26 GPRDEF(RIDENUM) /* General-purpose registers (GPRs). */
27 FPRDEF(RIDENUM) /* Floating-point registers (FPRs). */
28 RID_MAX,
29 RID_TMP = RID_RA,
30
31 /* Calling conventions. */
32 RID_RET = RID_R2,
33#if LJ_LE
34 RID_RETHI = RID_R3,
35 RID_RETLO = RID_R2,
36#else
37 RID_RETHI = RID_R2,
38 RID_RETLO = RID_R3,
39#endif
40 RID_FPRET = RID_F0,
41
42 /* These definitions must match with the *.dasc file(s): */
43 RID_BASE = RID_R16, /* Interpreter BASE. */
44 RID_LPC = RID_R18, /* Interpreter PC. */
45 RID_DISPATCH = RID_R19, /* Interpreter DISPATCH table. */
46 RID_LREG = RID_R20, /* Interpreter L. */
47 RID_JGL = RID_R30, /* On-trace: global_State + 32768. */
48
49 /* Register ranges [min, max) and number of registers. */
50 RID_MIN_GPR = RID_R0,
51 RID_MAX_GPR = RID_RA+1,
52 RID_MIN_FPR = RID_F0,
53 RID_MAX_FPR = RID_F31+1,
54 RID_NUM_GPR = RID_MAX_GPR - RID_MIN_GPR,
55 RID_NUM_FPR = (RID_MAX_FPR - RID_MIN_FPR)/2
56};
57
58#define RID_NUM_KREF RID_NUM_GPR
59#define RID_MIN_KREF RID_R0
60
61/* -- Register sets ------------------------------------------------------- */
62
63/* Make use of all registers, except TMP, SP, SYS1, SYS2 and JGL. */
64#define RSET_FIXED \
65 (RID2RSET(RID_TMP)|RID2RSET(RID_SP)|RID2RSET(RID_SYS1)|\
66 RID2RSET(RID_SYS2)|RID2RSET(RID_JGL))
67#define RSET_GPR (RSET_RANGE(RID_MIN_GPR, RID_MAX_GPR) - RSET_FIXED)
68#define RSET_FPR \
69 (RID2RSET(RID_F0)|RID2RSET(RID_F2)|RID2RSET(RID_F4)|RID2RSET(RID_F6)|\
70 RID2RSET(RID_F8)|RID2RSET(RID_F10)|RID2RSET(RID_F12)|RID2RSET(RID_F14)|\
71 RID2RSET(RID_F16)|RID2RSET(RID_F18)|RID2RSET(RID_F20)|RID2RSET(RID_F22)|\
72 RID2RSET(RID_F24)|RID2RSET(RID_F26)|RID2RSET(RID_F28)|RID2RSET(RID_F30))
73#define RSET_ALL (RSET_GPR|RSET_FPR)
74#define RSET_INIT RSET_ALL
75
76#define RSET_SCRATCH_GPR \
77 (RSET_RANGE(RID_R1, RID_R15+1)|\
78 RID2RSET(RID_R24)|RID2RSET(RID_R25)|RID2RSET(RID_GP)|RID2RSET(RID_RA))
79#define RSET_SCRATCH_FPR \
80 (RID2RSET(RID_F0)|RID2RSET(RID_F2)|RID2RSET(RID_F4)|RID2RSET(RID_F6)|\
81 RID2RSET(RID_F8)|RID2RSET(RID_F10)|RID2RSET(RID_F12)|RID2RSET(RID_F14)|\
82 RID2RSET(RID_F16)|RID2RSET(RID_F18))
83#define RSET_SCRATCH (RSET_SCRATCH_GPR|RSET_SCRATCH_FPR)
84#define REGARG_FIRSTGPR RID_R4
85#define REGARG_LASTGPR RID_R7
86#define REGARG_NUMGPR 4
87#define REGARG_FIRSTFPR RID_F12
88#define REGARG_LASTFPR RID_F14
89#define REGARG_NUMFPR 2
90
91/* -- Spill slots --------------------------------------------------------- */
92
93/* Spill slots are 32 bit wide. An even/odd pair is used for FPRs.
94**
95** SPS_FIXED: Available fixed spill slots in interpreter frame.
96** This definition must match with the *.dasc file(s).
97**
98** SPS_FIRST: First spill slot for general use.
99*/
100#define SPS_FIXED 5
101#define SPS_FIRST 4
102
103#define sps_scale(slot) (4 * (int32_t)(slot))
104#define sps_align(slot) (((slot) - SPS_FIXED + 1) & ~1)
105
106/* -- Exit state ---------------------------------------------------------- */
107
108/* This definition must match with the *.dasc file(s). */
109typedef struct {
110 lua_Number fpr[RID_NUM_FPR]; /* Floating-point registers. */
111 int32_t gpr[RID_NUM_GPR]; /* General-purpose registers. */
112 int32_t spill[256]; /* Spill slots. */
113} ExitState;
114
115/* Highest exit + 1 indicates stack check. */
116#define EXITSTATE_CHECKEXIT 1
117
118#define EXITSTUB_SPACING 8
119#define EXITSTUBS_PER_GROUP 16
120
121/* -- Instructions -------------------------------------------------------- */
122
123/* Instruction fields. */
124#define MIPSF_S(r) ((r) << 21)
125#define MIPSF_T(r) ((r) << 16)
126#define MIPSF_D(r) ((r) << 11)
127#define MIPSF_R(r) ((r) << 21)
128#define MIPSF_H(r) ((r) << 16)
129#define MIPSF_G(r) ((r) << 11)
130#define MIPSF_F(r) ((r) << 6)
131#define MIPSF_A(n) ((n) << 6)
132#define MIPSF_M(n) ((n) << 11)
133
134typedef enum MIPSIns {
135 /* Integer instructions. */
136 MIPSI_MOVE = 0x00000021,
137 MIPSI_NOP = 0x00000000,
138
139 MIPSI_LI = 0x24000000,
140 MIPSI_LU = 0x34000000,
141 MIPSI_LUI = 0x3c000000,
142
143 MIPSI_ORI = 0x34000000,
144
145 MIPSI_B = 0x10000000,
146 MIPSI_JR = 0x00000008,
147
148 /* Load/store instructions. */
149 MIPSI_LW = 0x8c000000,
150 MIPSI_SW = 0xac000000,
151} MIPSIns;
152
153#endif
diff --git a/src/lj_vmmath.c b/src/lj_vmmath.c
index 8b177207..022e3ef2 100644
--- a/src/lj_vmmath.c
+++ b/src/lj_vmmath.c
@@ -10,7 +10,7 @@
10#include <math.h> 10#include <math.h>
11 11
12#include "lj_obj.h" 12#include "lj_obj.h"
13#if LJ_HASJIT 13#if LJ_HASJIT || LJ_TARGET_MIPS
14#include "lj_ir.h" 14#include "lj_ir.h"
15#endif 15#endif
16#include "lj_vm.h" 16#include "lj_vm.h"
@@ -24,6 +24,29 @@ LJ_FUNCA double lj_vm_cosh(double x) { return cosh(x); }
24LJ_FUNCA double lj_vm_tanh(double x) { return tanh(x); } 24LJ_FUNCA double lj_vm_tanh(double x) { return tanh(x); }
25#endif 25#endif
26 26
27#if LJ_TARGET_MIPS
28double lj_vm_foldarith(double x, double y, int op)
29{
30 switch (op) {
31 case IR_ADD - IR_ADD: return x+y; break;
32 case IR_SUB - IR_ADD: return x-y; break;
33 case IR_MUL - IR_ADD: return x*y; break;
34 case IR_DIV - IR_ADD: return x/y; break;
35 case IR_MOD - IR_ADD: return x-lj_vm_floor(x/y)*y; break;
36 case IR_POW - IR_ADD: return pow(x, y); break;
37 case IR_NEG - IR_ADD: return -x; break;
38 case IR_ABS - IR_ADD: return fabs(x); break;
39#if LJ_HASJIT
40 case IR_ATAN2 - IR_ADD: return atan2(x, y); break;
41 case IR_LDEXP - IR_ADD: return ldexp(x, (int)y); break;
42 case IR_MIN - IR_ADD: return x > y ? y : x; break;
43 case IR_MAX - IR_ADD: return x < y ? y : x; break;
44#endif
45 default: return x;
46 }
47}
48#endif
49
27#if LJ_HASJIT 50#if LJ_HASJIT
28 51
29#ifdef LUAJIT_NO_LOG2 52#ifdef LUAJIT_NO_LOG2