ARM: Add BC_CAT and lj_cont_cat.

This commit is contained in:
Mike Pall 2011-04-08 03:01:37 +02:00
parent b1912f3325
commit b56784aae2

View File

@ -457,8 +457,20 @@ static void build_subroutines(BuildCtx *ctx)
| // BASE = base, RA = resultptr, CARG4 = meta base
| bx CARG1
|
|->cont_cat:
| NYI
|->cont_cat: // RA = resultptr, CARG4 = meta base
| ldr INS, [PC, #-4]
| sub CARG2, CARG4, #16
| ldrd CARG34, [RA]
| str BASE, L->base
| decode_RB8 RC, INS
| decode_RA8 RA, INS
| add CARG1, BASE, RC
| subs CARG1, CARG2, CARG1
| strdne CARG34, [CARG2]
| movne CARG3, CARG1
| bne ->BC_CAT_Z
| strd CARG34, [BASE, RA]
| b ->cont_nop
|
|//-- Table indexing metamethods -----------------------------------------
|
@ -1846,7 +1858,27 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
break;
case BC_CAT:
| NYI
| decode_RB8 RC, INS
| decode_RC8 RB, INS
| // RA = dst*8, RC = src_start*8, RB = src_end*8 (note: RB/RC swapped!)
| sub CARG3, RB, RC
| str BASE, L->base
| add CARG2, BASE, RB
|->BC_CAT_Z:
| // RA = dst*8, RC = src_start*8, CARG2 = top-1
| mov CARG1, L
| str PC, SAVE_PC
| lsr CARG3, CARG3, #3
| bl extern lj_meta_cat // (lua_State *L, TValue *top, int left)
| // Returns NULL (finished) or TValue * (metamethod).
| ldr BASE, L->base
| cmp CRET1, #0
| bne ->vmeta_binop
| ldrd CARG34, [BASE, RC]
| ins_next1
| ins_next2
| strd CARG34, [BASE, RA] // Copy result to RA.
| ins_next3
break;
/* -- Constant ops ------------------------------------------------------ */