Replace lay with la where possible.

This commit is contained in:
Michael Munday 2017-01-11 16:55:50 -05:00
parent a3bb1cee5d
commit 9e9a1cf0a5

View File

@ -22,6 +22,7 @@
|// clfi (compare logical immediate) [requires z9-109] |// clfi (compare logical immediate) [requires z9-109]
|// ldgr (load FPR from GPR) [requires z9-109 GA3] |// ldgr (load FPR from GPR) [requires z9-109 GA3]
|// lgdr (load GPR from FPR) [requires z9-109 GA3] |// lgdr (load GPR from FPR) [requires z9-109 GA3]
|// lay (load address)  [requires z900 GA2]
|// ldy (load (long bfp)) [requires z900 GA2] |// ldy (load (long bfp)) [requires z900 GA2]
|// stdy (store (long bfp)) [requires z900 GA2] |// stdy (store (long bfp)) [requires z900 GA2]
|// TODO: alternative instructions? |// TODO: alternative instructions?
@ -390,7 +391,7 @@ static void build_subroutines(BuildCtx *ctx)
| je <5 // But check for LUA_MULTRET+1. | je <5 // But check for LUA_MULTRET+1.
| sgr RA, RD // Negative result! | sgr RA, RD // Negative result!
| sllg TMPR1, RA, 3 | sllg TMPR1, RA, 3
| lay BASE, 0(TMPR1, BASE) // Correct top. | la BASE, 0(TMPR1, BASE) // Correct top.
| j <5 | j <5
| |
|8: // Corner case: need to grow stack for filling up results. |8: // Corner case: need to grow stack for filling up results.
@ -430,7 +431,7 @@ static void build_subroutines(BuildCtx *ctx)
| lghi RD, 1+1 // Really 1+2 results, incr. later. | lghi RD, 1+1 // Really 1+2 results, incr. later.
| lg BASE, L:RB->base | lg BASE, L:RB->base
| lg DISPATCH, L:RB->glref // Setup pointer to dispatch table. | lg DISPATCH, L:RB->glref // Setup pointer to dispatch table.
| lay DISPATCH, GG_G2DISP(DISPATCH) | la DISPATCH, GG_G2DISP(DISPATCH)
| lg PC, -8(BASE) // Fetch PC of previous frame. | lg PC, -8(BASE) // Fetch PC of previous frame.
| load_false RA | load_false RA
| lg RB, 0(BASE) | lg RB, 0(BASE)
@ -489,7 +490,7 @@ static void build_subroutines(BuildCtx *ctx)
| lgr RA, CARG2 | lgr RA, CARG2
| lghi PC, FRAME_CP | lghi PC, FRAME_CP
| lghi RD, 0 | lghi RD, 0
| lay KBASE, CFRAME_RESUME(sp) | la KBASE, CFRAME_RESUME(sp)
| lg DISPATCH, L:RB->glref // Setup pointer to dispatch table. | lg DISPATCH, L:RB->glref // Setup pointer to dispatch table.
| aghi DISPATCH, GG_G2DISP | aghi DISPATCH, GG_G2DISP
| stg RD, SAVE_PC // Any value outside of bytecode is ok. | stg RD, SAVE_PC // Any value outside of bytecode is ok.
@ -701,7 +702,7 @@ static void build_subroutines(BuildCtx *ctx)
| // BASE = base, L->top = new base, stack = cont/func/t/k | // BASE = base, L->top = new base, stack = cont/func/t/k
| lg RA, L:RB->top | lg RA, L:RB->top
| stg PC, -24(RA) // [cont|PC] | stg PC, -24(RA) // [cont|PC]
| lay PC, FRAME_CONT(RA) | la PC, FRAME_CONT(RA)
| sgr PC, BASE | sgr PC, BASE
| lg LFUNC:RB, -16(RA) // Guaranteed to be a function here. | lg LFUNC:RB, -16(RA) // Guaranteed to be a function here.
| lghi NARGS:RD, 2+1 // 2 args for func(t, k). | lghi NARGS:RD, 2+1 // 2 args for func(t, k).
@ -892,8 +893,8 @@ static void build_subroutines(BuildCtx *ctx)
|->vmeta_arith_vn: |->vmeta_arith_vn:
| sllg RB, RB, 3 | sllg RB, RB, 3
| sllg RC, RC, 3 | sllg RC, RC, 3
| lay RB, 0(RB, BASE) | la RB, 0(RB, BASE)
| lay RC, 0(RC, KBASE) | la RC, 0(RC, KBASE)
| j >1 | j >1
| |
|->vmeta_arith_nvo: |->vmeta_arith_nvo:
@ -902,8 +903,8 @@ static void build_subroutines(BuildCtx *ctx)
|->vmeta_arith_nv: |->vmeta_arith_nv:
| sllg RC, RC, 3 | sllg RC, RC, 3
| sllg RB, RB, 3 | sllg RB, RB, 3
| lay TMPR1, 0(RC, KBASE) | la TMPR1, 0(RC, KBASE)
| lay RC, 0(RB, BASE) | la RC, 0(RB, BASE)
| lgr RB, TMPR1 | lgr RB, TMPR1
| j >1 | j >1
| |
@ -920,12 +921,12 @@ static void build_subroutines(BuildCtx *ctx)
|->vmeta_arith_vv: |->vmeta_arith_vv:
| sllg RC, RC, 3 | sllg RC, RC, 3
| sllg RB, RB, 3 | sllg RB, RB, 3
| lay RB, 0(RB, BASE) | la RB, 0(RB, BASE)
| lay RC, 0(RC, BASE) | la RC, 0(RC, BASE)
|1: |1:
| llgc RA, PC_RA | llgc RA, PC_RA
| sllg RA, RA, 3 | sllg RA, RA, 3
| lay RA, 0(RA, BASE) | la RA, 0(RA, BASE)
| llgc CARG5, PC_OP // Caveat: CARG5 == RD. | llgc CARG5, PC_OP // Caveat: CARG5 == RD.
| lgr CARG2, RA | lgr CARG2, RA
| lgr CARG3, RB | lgr CARG3, RB
@ -2167,8 +2168,8 @@ static void build_subroutines(BuildCtx *ctx)
| |
|2: |2:
| sll r1, 3 | sll r1, 3
| lay r10, (offsetof(CCallState, stack))(CCSTATE) // Source. | la r10, (offsetof(CCallState, stack))(CCSTATE) // Source.
| lay r11, (CCALL_SPS_EXTRA*8)(sp) // Destination. | la r11, (CCALL_SPS_EXTRA*8)(sp) // Destination.
|3: |3:
| chi r1, 256 | chi r1, 256
| jl >4 | jl >4
@ -4056,7 +4057,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| sllg RD, NARGS:RD, 3 | sllg RD, NARGS:RD, 3
| lay RD, -8(RD,BASE) | lay RD, -8(RD,BASE)
| stg BASE, L:RB->base | stg BASE, L:RB->base
| lay RA, (8*LUA_MINSTACK)(RD) | la RA, (8*LUA_MINSTACK)(RD)
| clg RA, L:RB->maxstack | clg RA, L:RB->maxstack
| stg RD, L:RB->top | stg RD, L:RB->top
| lgr CARG1, L:RB | lgr CARG1, L:RB