Rename TMPR2 as TMPR0.

TMPR2 was r0 and so cannot be used in address calculations (or
shift values). Renaming it TMPR0 makes this more obvious.
This commit is contained in:
Michael Munday 2017-01-16 16:14:51 -05:00
parent 70b5f6b966
commit 828bf84999

View File

@ -64,9 +64,9 @@
|
|.define CRET1, r2
|
|.define OP, r2
|.define TMPR0, r0
|.define TMPR1, r1
|.define TMPR2, r0
|.define OP, r2
|
|// Stack layout while in interpreter. Must match with lj_frame.h.
|.define CFRAME_SPACE, 240 // Delta for sp, 8 byte aligned.
@ -272,10 +272,10 @@
|.macro branchPC, reg
| // TODO: optimize this, was just lea PC, [PC+reg*4-BCBIAS_J*4].
| // Can't clobber TMPR1 or condition code.
| lgr TMPR2, TMPR1 // Workaround because TMPR2 == r0 and can't be used in lay.
| lgr TMPR0, TMPR1 // Workaround because TMPR0 == r0 and can't be used in lay.
| sllg TMPR1, reg, 2
| lay PC, (-BCBIAS_J*4)(TMPR1, PC)
| lgr TMPR1, TMPR2
| lgr TMPR1, TMPR0
|.endmacro
|
|// Set current VM state.
@ -574,8 +574,8 @@ static void build_subroutines(BuildCtx *ctx)
| lg KBASE, L:RB->stack // Compute -savestack(L, L->top).
| sg KBASE, L:RB->top
| lg DISPATCH, L:RB->glref // Setup pointer to dispatch table.
| lghi TMPR2, 0
| stg TMPR2, SAVE_ERRF // No error function.
| lghi TMPR0, 0
| stg TMPR0, SAVE_ERRF // No error function.
| st KBASE, SAVE_NRES // Neg. delta means cframe w/o frame.
| aghi DISPATCH, GG_G2DISP
| // Handler may change cframe_nres(L->cframe) or cframe_errfunc(L->cframe).
@ -606,8 +606,8 @@ static void build_subroutines(BuildCtx *ctx)
| lgr RB, BASE
| sgr BASE, PC // Restore caller BASE.
| sllg TMPR1, RD, 3
| lghi TMPR2, LJ_TNIL
| stg TMPR2, -8(RA, TMPR1) // Ensure one valid arg.
| lghi TMPR0, LJ_TNIL
| stg TMPR0, -8(RA, TMPR1) // Ensure one valid arg.
| lgr RC, RA // ... in [RC]
| lg PC, -24(RB) // Restore PC from [cont|PC].
| lg RA, -32(RB)
@ -645,8 +645,8 @@ static void build_subroutines(BuildCtx *ctx)
| lg L:CARG1, SAVE_L
| stg BASE, L:CARG1->base
| lgfr CARG3, RA // Caveat: RA == CARG3.
| lg TMPR2, 0(RC)
| stg TMPR2, 0(RB)
| lg TMPR0, 0(RC)
| stg TMPR0, 0(RB)
| lgr CARG2, RB
| j ->BC_CAT_Z
|
@ -728,8 +728,8 @@ static void build_subroutines(BuildCtx *ctx)
| settp STR:RC, LJ_TSTR // STR:RC = GCstr *
| stg STR:RC, TMP_STACK
| la RC, TMP_STACK
| llgc TMPR2, PC_OP
| cghi TMPR2, BC_GSET
| llgc TMPR0, PC_OP
| cghi TMPR0, BC_GSET
| jne >1
| settp TAB:RA, TAB:RB, LJ_TTAB // TAB:RB = GCtab *
| lay RB, (DISPATCH_GL(tmptv))(DISPATCH) // Store fn->l.env in g->tmptv.
@ -835,16 +835,16 @@ static void build_subroutines(BuildCtx *ctx)
| la PC, 4(PC)
| lg ITYPE, 0(RC)
| srag ITYPE, ITYPE, 47
| lghi TMPR2, LJ_TISTRUECOND
| clr ITYPE, TMPR2 // Branch if result is true.
| lghi TMPR0, LJ_TISTRUECOND
| clr ITYPE, TMPR0 // Branch if result is true.
| jl <5
| j <6
|
|->cont_condf: // BASE = base, RC = result
| lg ITYPE, 0(RC)
| srag ITYPE, ITYPE, 47
| lghi TMPR2, LJ_TISTRUECOND
| clr ITYPE, TMPR2 // Branch if result is false.
| lghi TMPR0, LJ_TISTRUECOND
| clr ITYPE, TMPR0 // Branch if result is false.
| j <4
|
|->vmeta_equal:
@ -1041,8 +1041,8 @@ static void build_subroutines(BuildCtx *ctx)
|
|.macro .ffunc_n, name, op
| .ffunc_1 name
| lg TMPR2, 0(BASE)
| checknumtp TMPR2, ->fff_fallback
| lg TMPR0, 0(BASE)
| checknumtp TMPR0, ->fff_fallback
| op f0, 0(BASE) // TODO: might be better to unconditionally load into f1.
|.endmacro
|
@ -1053,11 +1053,11 @@ static void build_subroutines(BuildCtx *ctx)
|.macro .ffunc_nn, name
| .ffunc_2 name
| lg TMPR1, 0(BASE)
| lg TMPR2, 8(BASE)
| lg TMPR0, 8(BASE)
| ld FARG1, 0(BASE)
| ld FARG2, 8(BASE)
| checknumtp TMPR1, ->fff_fallback
| checknumtp TMPR2, ->fff_fallback
| checknumtp TMPR0, ->fff_fallback
|.endmacro
|
|// Inlined GC threshold check. Caveat: uses label 1.
@ -1099,8 +1099,8 @@ static void build_subroutines(BuildCtx *ctx)
| jnl >1
| lgr RC, RB
|1:
| lghi TMPR2, -1
| xgr RC, TMPR2
| lghi TMPR0, -1
| xgr RC, TMPR0
|2:
| lg CFUNC:RB, -16(BASE)
| cleartp CFUNC:RB
@ -1120,8 +1120,8 @@ static void build_subroutines(BuildCtx *ctx)
|1: // Field metatable must be at same offset for GCtab and GCudata!
| lg TAB:RB, TAB:RB->metatable
|2:
| lghi TMPR2, LJ_TNIL
| stg TMPR2, -16(BASE)
| lghi TMPR0, LJ_TNIL
| stg TMPR0, -16(BASE)
| cghi TAB:RB, 0
| je ->fff_res1
| settp TAB:RC, TAB:RB, LJ_TTAB
@ -1150,8 +1150,8 @@ static void build_subroutines(BuildCtx *ctx)
| clfi ITYPE, LJ_TISNUM; jh >7
| lhi ITYPE, LJ_TISNUM
|7:
| lhi TMPR2, -1
| xr ITYPE, TMPR2 // not ITYPE
| lhi TMPR0, -1
| xr ITYPE, TMPR0 // not ITYPE
| llgfr ITYPE, ITYPE
| sllg ITYPE, ITYPE, 3
| lg TAB:RB, (DISPATCH_GL(gcroot[GCROOT_BASEMT]))(ITYPE, DISPATCH)
@ -1162,8 +1162,8 @@ static void build_subroutines(BuildCtx *ctx)
| lgr TAB:TMPR1, TAB:RB
| checktab TAB:RB, ->fff_fallback
| // Fast path: no mt for table yet and not clearing the mt.
| lghi TMPR2, 0
| cg TMPR2, TAB:RB->metatable; jne ->fff_fallback
| lghi TMPR0, 0
| cg TMPR0, TAB:RB->metatable; jne ->fff_fallback
| lg TAB:RA, 8(BASE)
| checktab TAB:RA, ->fff_fallback
| stg TAB:RA, TAB:RB->metatable
@ -1213,8 +1213,8 @@ static void build_subroutines(BuildCtx *ctx)
| j ->fff_res1
|3: // Handle numbers inline, unless a number base metatable is present.
| clfi ITYPE, LJ_TISNUM; jh ->fff_fallback_1
| lghi TMPR2, 0
| cg TMPR2, (DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM]))(DISPATCH)
| lghi TMPR0, 0
| cg TMPR0, (DISPATCH_GL(gcroot[GCROOT_BASEMT_NUM]))(DISPATCH)
| jne ->fff_fallback
| ffgccheck // Caveat: uses label 1.
| lg L:RB, SAVE_L
@ -1256,12 +1256,12 @@ static void build_subroutines(BuildCtx *ctx)
| lghi RD, 1+2
| j ->fff_res
|2: // Set missing 2nd arg to nil.
| lghi TMPR2, LJ_TNIL
| stg TMPR2, 8(BASE)
| lghi TMPR0, LJ_TNIL
| stg TMPR0, 8(BASE)
| j <1
|3: // End of traversal: return nil.
| lghi TMPR2, LJ_TNIL
| stg TMPR2, -16(BASE)
| lghi TMPR0, LJ_TNIL
| stg TMPR0, -16(BASE)
| j ->fff_res1
|
|.ffunc_1 pairs
@ -1269,7 +1269,7 @@ static void build_subroutines(BuildCtx *ctx)
| lgr TMPR1, TAB:RB
| checktab TAB:RB, ->fff_fallback
#if LJ_52
| ltg TMPR2, TAB:RB->metatable; jne ->fff_fallback
| ltg TMPR0, TAB:RB->metatable; jne ->fff_fallback
#endif
| lg CFUNC:RD, -16(BASE)
| cleartp CFUNC:RD
@ -1278,8 +1278,8 @@ static void build_subroutines(BuildCtx *ctx)
| lg PC, -8(BASE)
| stg CFUNC:RD, -16(BASE)
| stg TMPR1, -8(BASE)
| lghi TMPR2, LJ_TNIL
| stg TMPR2, 0(BASE)
| lghi TMPR0, LJ_TNIL
| stg TMPR0, 0(BASE)
| lghi RD, 1+3
| j ->fff_res
|
@ -1298,13 +1298,13 @@ static void build_subroutines(BuildCtx *ctx)
| sllg TMPR1, TMPR1, 3
| la RD, 0(TMPR1, RD)
|1:
| lg TMPR2, 0(RD)
| cghi TMPR2, LJ_TNIL; je ->fff_res0
| lg TMPR0, 0(RD)
| cghi TMPR0, LJ_TNIL; je ->fff_res0
| // Copy array slot.
| stg TMPR2, -8(BASE)
| stg TMPR0, -8(BASE)
| j ->fff_res2
|2: // Check for empty hash part first. Otherwise call C function.
| lt TMPR2, TAB:RB->hmask; je ->fff_res0
| lt TMPR0, TAB:RB->hmask; je ->fff_res0
| lgr CARG1, TAB:RB
| lgr RB, BASE // Save BASE. // TODO: needed?
| lgfr CARG2, RA
@ -1322,8 +1322,8 @@ static void build_subroutines(BuildCtx *ctx)
| lgr TMPR1, TAB:RB
| checktab TAB:RB, ->fff_fallback
#if LJ_52
| lghi TMPR2, 0
| cg TMPR2, TAB:RB->metatable; jne ->fff_fallback
| lghi TMPR0, 0
| cg TMPR0, TAB:RB->metatable; jne ->fff_fallback
#endif
| lg CFUNC:RD, -16(BASE)
| cleartp CFUNC:RD
@ -1375,7 +1375,7 @@ static void build_subroutines(BuildCtx *ctx)
|.if resume
|.ffunc_1 coroutine_resume
| lg L:RB, 0(BASE)
| lgr L:TMPR2, L:RB // Save type for checktptp.
| lgr L:TMPR0, L:RB // Save type for checktptp.
| cleartp L:RB
|.else
|.ffunc coroutine_wrap_aux
@ -1388,9 +1388,9 @@ static void build_subroutines(BuildCtx *ctx)
| stg PC, SAVE_PC
| stg L:RB, TMP_STACK
|.if resume
| checktptp L:TMPR2, LJ_TTHREAD, ->fff_fallback
| checktptp L:TMPR0, LJ_TTHREAD, ->fff_fallback
|.endif
| ltg TMPR2, L:RB->cframe; jne ->fff_fallback
| ltg TMPR0, L:RB->cframe; jne ->fff_fallback
| cli L:RB->status, LUA_YIELD; jh ->fff_fallback
| lg RA, L:RB->top
| je >1 // Status != LUA_YIELD (i.e. 0)?
@ -1523,8 +1523,8 @@ static void build_subroutines(BuildCtx *ctx)
|
|.ffunc coroutine_yield
| lg L:RB, SAVE_L
| lg TMPR2, L:RB->cframe
| tmll TMPR2, CFRAME_RESUME
| lg TMPR0, L:RB->cframe
| tmll TMPR0, CFRAME_RESUME
| je ->fff_fallback
| stg BASE, L:RB->base
| sllg RD, NARGS:RD, 3
@ -1585,8 +1585,8 @@ static void build_subroutines(BuildCtx *ctx)
|
|6: // Fill up results with nil.
| sllg TMPR1, RD, 3
| lghi TMPR2, LJ_TNIL
| stg TMPR2, -24(TMPR1, BASE)
| lghi TMPR0, LJ_TNIL
| stg TMPR0, -24(TMPR1, BASE)
| la RD, 1(RD)
| j <5
|
@ -1612,9 +1612,9 @@ static void build_subroutines(BuildCtx *ctx)
|
|.ffunc math_log
| chi NARGS:RD, 1+1; jne ->fff_fallback // Exactly one argument.
| lg TMPR2, 0(BASE)
| lg TMPR0, 0(BASE)
| ld FARG1, 0(BASE)
| checknumtp TMPR2, ->fff_fallback
| checknumtp TMPR0, ->fff_fallback
| lgr RB, BASE
| brasl r14, extern log
| lgr BASE, RB
@ -1652,10 +1652,10 @@ static void build_subroutines(BuildCtx *ctx)
| math_extern2 fmod
|
|.ffunc_2 math_ldexp
| lg TMPR2, 0(BASE)
| lg TMPR0, 0(BASE)
| ld FARG1, 0(BASE)
| lg CARG1, 8(BASE)
| checknumtp TMPR2, ->fff_fallback
| checknumtp TMPR0, ->fff_fallback
| checkinttp CARG1, ->fff_fallback
| lgfr CARG1, CARG1
| lgr RB, BASE
@ -1695,11 +1695,11 @@ static void build_subroutines(BuildCtx *ctx)
| checkint RB, >4
|1: // Handle integers.
| clgr RA, TMPR1; jhe ->fff_resRB
| lg TMPR2, -8(RA, BASE)
| checkint TMPR2, >3
| cr RB, TMPR2
| lg TMPR0, -8(RA, BASE)
| checkint TMPR0, >3
| cr RB, TMPR0
| cjmp >2
| lgr RB, TMPR2
| lgr RB, TMPR0
|2:
| aghi RA, 8
| j <1
@ -1707,7 +1707,7 @@ static void build_subroutines(BuildCtx *ctx)
| jh ->fff_fallback
| // Convert intermediate result to number and continue below.
| cdfbr f0, RB
| ldgr f1, TMPR2
| ldgr f1, TMPR0
| j >6
|4:
| jh ->fff_fallback
@ -1737,7 +1737,7 @@ static void build_subroutines(BuildCtx *ctx)
| lg STR:RB, 0(BASE)
| checkstr STR:RB, ->fff_fallback
| lg PC, -8(BASE)
| ltg TMPR2, STR:RB->len
| ltg TMPR0, STR:RB->len
| je ->fff_res0 // Return no results for empty string.
| llgc RB, STR:RB[1]
| j ->fff_resi
@ -1907,8 +1907,8 @@ static void build_subroutines(BuildCtx *ctx)
| j ->fff_resbit
|
|.ffunc_bit bit_bnot, 1
| lhi TMPR2, -1
| xr RB, TMPR2 // TODO: use xilf on newer models?
| lhi TMPR0, -1
| xr RB, TMPR0 // TODO: use xilf on newer models?
| j ->fff_resbit
|
|->fff_fallback_bit_op:
@ -1943,9 +1943,9 @@ static void build_subroutines(BuildCtx *ctx)
| checkint RA, ->fff_fallback
| // TODO: shorter sequence of instructions to convert right rotate into left rotate.
| nill RA, 0x1f
| lghi TMPR2, 32
| sr TMPR2, RA
| lr RA, TMPR2
| lghi TMPR0, 32
| sr TMPR0, RA
| lr RA, TMPR0
| rll RB, RB, 0(RA)
| j ->fff_resbit
|
@ -2050,9 +2050,9 @@ static void build_subroutines(BuildCtx *ctx)
|
| tmll RD, LUA_MASKLINE|LUA_MASKCOUNT
| je >5
| ly TMPR2, (DISPATCH_GL(hookcount))(DISPATCH)
| ahi TMPR2, -1
| sty TMPR2, (DISPATCH_GL(hookcount))(DISPATCH)
| ly TMPR0, (DISPATCH_GL(hookcount))(DISPATCH)
| ahi TMPR0, -1
| sty TMPR0, (DISPATCH_GL(hookcount))(DISPATCH)
| je >1
| tmll RD, LUA_MASKLINE
| je >5
@ -2103,8 +2103,8 @@ static void build_subroutines(BuildCtx *ctx)
| lgr CARG1, L:RB
| brasl r14, extern lj_dispatch_call // (lua_State *L, const BCIns *pc)
| // ASMFunction returned in r2 (CRET1).
| lghi TMPR2, 0
| stg TMPR2, SAVE_PC // Invalidate for subsequent line hook.
| lghi TMPR0, 0
| stg TMPR0, SAVE_PC // Invalidate for subsequent line hook.
|.if JIT
| nill PC, -2
|.endif
@ -2604,8 +2604,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|3:
| jh ->vmeta_unm
| // Toggle sign bit.
| llihh TMPR2, 0x8000
| xgr RB, TMPR2
| llihh TMPR0, 0x8000
| xgr RB, TMPR0
| j <1
break;
case BC_LEN:
@ -2793,10 +2793,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| sllg RC, RC, 3
| ld FARG1, 0(RB, BASE)
| ld FARG2, 0(RC, BASE)
| lg TMPR2, 0(RB, BASE)
| checknumtp TMPR2, ->vmeta_arith_vvo
| lg TMPR2, 0(RC, BASE)
| checknumtp TMPR2, ->vmeta_arith_vvo
| lg TMPR0, 0(RB, BASE)
| checknumtp TMPR0, ->vmeta_arith_vvo
| lg TMPR0, 0(RC, BASE)
| checknumtp TMPR0, ->vmeta_arith_vvo
| lgr RB, BASE // TODO: redundant, BASE is currently callee-saved.
| brasl r14, extern pow // double pow(double x, double y), result in f0.
| llgc RA, PC_RA
@ -2874,8 +2874,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| ins_AD // RA = dst, RD = primitive type (~)
| sllg RA, RA, 3
| sllg RD, RD, 47
| lghi TMPR2, -1
| xgr RD, TMPR2 // not
| lghi TMPR0, -1
| xgr RD, TMPR0 // not
| stg RD, 0(RA, BASE)
| ins_next
break;
@ -2994,8 +2994,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| cleartp LFUNC:RB
| lg UPVAL:RB, (offsetof(GCfuncL, uvptr))(RA, LFUNC:RB)
| sllg RD, RD, 47
| lghi TMPR2, -1
| xgr RD, TMPR2
| lghi TMPR0, -1
| xgr RD, TMPR0
| lg RA, UPVAL:RB->v
| stg RD, 0(RA)
| ins_next
@ -3004,7 +3004,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| ins_AD // RA = level, RD = target
| branchPC RD // Do this first to free RD.
| lg L:RB, SAVE_L
| ltg TMPR2, L:RB->openupval
| ltg TMPR0, L:RB->openupval
| je >1
| stg BASE, L:RB->base
| sllg RA, RA, 3
@ -3046,9 +3046,9 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| jhe >5
|1:
| srlg CARG3, RD, 11
| llill TMPR2, 0x7ff
| nr RD, TMPR2
| cr RD, TMPR2
| llill TMPR0, 0x7ff
| nr RD, TMPR0
| cr RD, TMPR0
| je >3
|2:
| lgr L:CARG1, L:RB
@ -3094,8 +3094,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| lgr L:CARG1, L:RB
| brasl r14, extern lj_gc_step_fixtop // (lua_State *L)
| llgh RD, PC_RD // Need to reload RD.
| lghi TMPR2, -1
| xgr RD, TMPR2 // not RD
| lghi TMPR0, -1
| xgr RD, TMPR0 // not RD
| j <2
break;
@ -3259,8 +3259,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| llgfr RC, RC
| sllg RC, RC, 3
| ag RC, TAB:RB->array
| lghi TMPR2, LJ_TNIL
| cg TMPR2, 0(RC)
| lghi TMPR0, LJ_TNIL
| cg TMPR0, 0(RC)
| je >3 // Previous value is nil?
|1:
| tm TAB:RB->marked, LJ_GC_BLACK // isblack(table)
@ -3292,8 +3292,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| ins_ABC // RA = src, RB = table, RC = str const (~)
| sllg RB, RB, 3
| lg TAB:RB, 0(RB, BASE)
| lghi TMPR2, -1
| xgr RC, TMPR2 // ~RC
| lghi TMPR0, -1
| xgr RC, TMPR0 // ~RC
| sllg RC, RC, 3
| lg STR:RC, 0(RC, KBASE)
| checktab TAB:RB, ->vmeta_tsets
@ -3309,8 +3309,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| cg ITYPE, NODE:TMPR1->key
| jne >5
| // Ok, key found. Assumes: offsetof(Node, val) == 0
| lghi TMPR2, LJ_TNIL
| cg TMPR2, 0(TMPR1)
| lghi TMPR0, LJ_TNIL
| cg TMPR0, 0(TMPR1)
| je >4 // Previous value is nil?
|2:
| tm TAB:RB->marked, LJ_GC_BLACK // isblack(table)
@ -3369,8 +3369,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| jhe ->vmeta_tsetb
| sllg RC, RC, 3
| ag RC, TAB:RB->array
| lghi TMPR2, LJ_TNIL
| cg TMPR2, 0(RC)
| lghi TMPR0, LJ_TNIL
| cg TMPR0, 0(RC)
| je >3 // Previous value is nil?
|1:
| tm TAB:RB->marked, LJ_GC_BLACK // isblack(table)
@ -3578,10 +3578,10 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|1: // Traverse array part.
| clr RC, TMPR1; jhe >5 // Index points after array part?
| sllg RD, RC, 3 // Warning: won't work if RD==RC!
| lg TMPR2, 0(RD, ITYPE)
| cghi TMPR2, LJ_TNIL; je >4
| lg TMPR0, 0(RD, ITYPE)
| cghi TMPR0, LJ_TNIL; je >4
| // Copy array slot to returned value.
| lgr RB, TMPR2
| lgr RB, TMPR0
| stg RB, 8(RA, BASE)
| // Return array index as a numeric key.
| setint ITYPE, RC
@ -3605,8 +3605,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| llgfr ITYPE, RC
| mghi ITYPE, #NODE
| ag NODE:ITYPE, TAB:RB->node
| lghi TMPR2, LJ_TNIL
| cg TMPR2, NODE:ITYPE->val; je >7
| lghi TMPR0, LJ_TNIL
| cg TMPR0, NODE:ITYPE->val; je >7
| ar TMPR1, RC
| ahi TMPR1, 1
| // Copy key and value from hash slot.
@ -3629,8 +3629,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| checkfunc CFUNC:RB, >5
| lg TMPR1, -16(RA, BASE)
| checktptp TMPR1, LJ_TTAB, >5
| lghi TMPR2, LJ_TNIL
| cg TMPR2, -8(RA, BASE); jne >5
| lghi TMPR0, LJ_TNIL
| cg TMPR0, -8(RA, BASE); jne >5
| llgc TMPR1, CFUNC:RB->ffid
| clfi TMPR1, (uint8_t)FF_next_N; jne >5
| branchPC RD
@ -3640,8 +3640,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|1:
| ins_next
|5: // Despecialize bytecode if any of the checks fail.
| lghi TMPR2, BC_JMP
| stcy TMPR2, PC_OP
| lghi TMPR0, BC_JMP
| stcy TMPR0, PC_OP
| branchPC RD
| mvi 3(PC), BC_ITERC
| j <1
@ -3672,8 +3672,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| clgr TMPR1, BASE // No more vararg slots?
| jl <1
|2: // Fill up remainder with nil.
| lghi TMPR2, LJ_TNIL // TODO: move out of loop. Add NIL range macro?
| stg TMPR2, 0(RA)
| lghi TMPR0, LJ_TNIL // TODO: move out of loop. Add NIL range macro?
| stg TMPR0, 0(RA)
| la RA, 8(RA)
| clgr RA, RB
| jl <2
@ -3681,8 +3681,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| ins_next
|
|5: // Copy all varargs.
| lghi TMPR2, 1
| st TMPR2, SAVE_MULTRES // MULTRES = 0+1
| lghi TMPR0, 1
| st TMPR0, SAVE_MULTRES // MULTRES = 0+1
| lgr RC, BASE
| slgr RC, TMPR1
| jno <3 // No vararg slots? (borrow or zero)
@ -3840,8 +3840,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
#ifdef LUA_USE_ASSERT
| // lg TMPR1, FOR_STOP
| checkinttp TMPR1, ->assert_bad_for_arg_type
| lg TMPR2, FOR_STEP
| checkinttp TMPR2, ->assert_bad_for_arg_type
| lg TMPR0, FOR_STEP
| checkinttp TMPR0, ->assert_bad_for_arg_type
#endif
| lg ITYPE, FOR_STEP
| chi ITYPE, 0; jl >5
@ -3903,14 +3903,14 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| jhe ->vmeta_for
}
if (!vk) {
| lg TMPR2, FOR_STOP
| checknumtp TMPR2, ->vmeta_for
| lg TMPR0, FOR_STOP
| checknumtp TMPR0, ->vmeta_for
} else {
#ifdef LUA_USE_ASSERT
| lg TMPR2, FOR_STOP
| checknumtp TMPR2, ->assert_bad_for_arg_type
| lg TMPR2, FOR_STEP
| checknumtp TMPR2, ->assert_bad_for_arg_type
| lg TMPR0, FOR_STOP
| checknumtp TMPR0, ->assert_bad_for_arg_type
| lg TMPR0, FOR_STEP
| checknumtp TMPR0, ->assert_bad_for_arg_type
#endif
}
| lg RB, FOR_STEP
@ -4042,8 +4042,8 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|3: // Clear missing parameters.
| // TODO: optimize this. Some of this can be hoisted.
| sllg TMPR1, NARGS:RD, 3
| lghi TMPR2, LJ_TNIL
| stg TMPR2, -8(TMPR1, BASE)
| lghi TMPR0, LJ_TNIL
| stg TMPR0, -8(TMPR1, BASE)
| la RD, 1(RD)
| clgr RD, RA
| jle <3