mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 15:34:09 +00:00
Add and use branch on count instructions where possible.
This commit is contained in:
parent
c8db1b960c
commit
a3bb1cee5d
@ -1240,6 +1240,8 @@ map_op = {
|
|||||||
mghi_2 = "0000a70d0000RI-a",
|
mghi_2 = "0000a70d0000RI-a",
|
||||||
-- RI-b mode instructions
|
-- RI-b mode instructions
|
||||||
bras_2 = "0000a7050000RI-b",
|
bras_2 = "0000a7050000RI-b",
|
||||||
|
brct_2 = "0000a7060000RI-b",
|
||||||
|
brctg_2 = "0000a7070000RI-b",
|
||||||
-- RI-c mode instructions
|
-- RI-c mode instructions
|
||||||
brc_2 = "0000a7040000RI-c",
|
brc_2 = "0000a7040000RI-c",
|
||||||
-- RIL-c
|
-- RIL-c
|
||||||
|
@ -1085,9 +1085,7 @@ static void build_subroutines(BuildCtx *ctx)
|
|||||||
| la RA, 8(RA)
|
| la RA, 8(RA)
|
||||||
| lg RB, 0(RA)
|
| lg RB, 0(RA)
|
||||||
| stg RB, -16(RA)
|
| stg RB, -16(RA)
|
||||||
| ahi RD, -1
|
| brct RD, <1
|
||||||
| jne <1
|
|
||||||
| // TODO: replace with branch on count (brctg).
|
|
||||||
|2:
|
|2:
|
||||||
| llgf RD, SAVE_MULTRES
|
| llgf RD, SAVE_MULTRES
|
||||||
| j ->fff_res_
|
| j ->fff_res_
|
||||||
@ -3392,9 +3390,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
| la RA, 8(RA)
|
| la RA, 8(RA)
|
||||||
| stg RB, 0(TMPR1)
|
| stg RB, 0(TMPR1)
|
||||||
| la TMPR1, 8(TMPR1)
|
| la TMPR1, 8(TMPR1)
|
||||||
| aghi RD, -1
|
| brctg RD, <3
|
||||||
| jne <3
|
|
||||||
| // TODO: replace decrement/branch with branch on count.
|
|
||||||
|4:
|
|4:
|
||||||
| ins_next
|
| ins_next
|
||||||
|
|
|
|
||||||
@ -3458,9 +3454,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
| la RA, 8(RA)
|
| la RA, 8(RA)
|
||||||
| stg RB, 0(KBASE)
|
| stg RB, 0(KBASE)
|
||||||
| la KBASE, 8(KBASE)
|
| la KBASE, 8(KBASE)
|
||||||
| // TODO: replace decrement/branch with brctg
|
| brctg NARGS:RD, <2
|
||||||
| aghi NARGS:RD, -1
|
|
||||||
| jne <2
|
|
||||||
|
|
|
|
||||||
| lg LFUNC:RB, -16(BASE)
|
| lg LFUNC:RB, -16(BASE)
|
||||||
|3:
|
|3:
|
||||||
@ -3698,9 +3692,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
| lg RB, 0(KBASE, RA)
|
| lg RB, 0(KBASE, RA)
|
||||||
| stg RB, -16(KBASE)
|
| stg RB, -16(KBASE)
|
||||||
| la KBASE, 8(KBASE)
|
| la KBASE, 8(KBASE)
|
||||||
| // TODO: replace with brctg RD, <2 once supported.
|
| brctg RD, <2
|
||||||
| aghi RD, -1
|
|
||||||
| jne <2
|
|
||||||
|3:
|
|3:
|
||||||
| llgf RD, SAVE_MULTRES // Note: MULTRES may be >256.
|
| llgf RD, SAVE_MULTRES // Note: MULTRES may be >256.
|
||||||
| llgc RB, PC_RB
|
| llgc RB, PC_RB
|
||||||
@ -4037,9 +4029,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
| stg KBASE, 0(RD)
|
| stg KBASE, 0(RD)
|
||||||
| la RD, 8(RD)
|
| la RD, 8(RD)
|
||||||
| stg TMPR1, -16(RA) // Clear old fixarg slot (help the GC).
|
| stg TMPR1, -16(RA) // Clear old fixarg slot (help the GC).
|
||||||
| aghi RB, -1
|
| brctg RB, <1
|
||||||
| jne <1
|
|
||||||
| // TODO: brctg instead of decrement/branch
|
|
||||||
|2:
|
|2:
|
||||||
if (op == BC_JFUNCV) {
|
if (op == BC_JFUNCV) {
|
||||||
| llgh RD, PC_RD
|
| llgh RD, PC_RD
|
||||||
@ -4052,9 +4042,7 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
|
|||||||
|3: // Clear missing parameters.
|
|3: // Clear missing parameters.
|
||||||
| stg TMPR1, 0(RD) // TMPR1=LJ_TNIL (-1) here.
|
| stg TMPR1, 0(RD) // TMPR1=LJ_TNIL (-1) here.
|
||||||
| la RD, 8(RD)
|
| la RD, 8(RD)
|
||||||
| aghi RB, -1
|
| brctg RB, <3
|
||||||
| jne <3
|
|
||||||
| // TODO: brctg instead of decrement/branch
|
|
||||||
| j <2
|
| j <2
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user