PPC: Add BC_TSETM.

This commit is contained in:
Mike Pall 2010-09-15 17:28:24 +02:00
parent 028a65a597
commit 3f32f4ac99

View File

@ -2005,7 +2005,47 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
break; break;
case BC_TSETM: case BC_TSETM:
| NYI | // RA = base*8 (table at base-1), RD = num_const*8 (start index)
| add RA, BASE, RA
|1:
| add TMP3, KBASE, RD
| lwz TAB:CARG2, -4(RA) // Guaranteed to be a table.
| addic. TMP0, MULTRES, -8
| lwz TMP3, 4(TMP3) // Integer constant is in lo-word.
| srwi CARG3, TMP0, 3
| beq >4 // Nothing to copy?
| add CARG3, CARG3, TMP3
| lwz TMP2, TAB:CARG2->asize
| slwi TMP1, TMP3, 3
| lbz TMP3, TAB:CARG2->marked
| cmplw CARG3, TMP2
| add TMP2, RA, TMP0
| lwz TMP0, TAB:CARG2->array
| bgt >5
| add TMP1, TMP1, TMP0
| andi. TMP0, TMP3, LJ_GC_BLACK // isblack(table)
|3: // Copy result slots to table.
| evldd TMP0, 0(RA)
| addi RA, RA, 8
| cmpw cr1, RA, TMP2
| evstdd TMP0, 0(TMP1)
| addi TMP1, TMP1, 8
| blt cr1, <3
| bne >7
|4:
| ins_next
|
|5: // Need to resize array part.
| stw BASE, L->base
| mr CARG1, L
| stw PC, SAVE_PC
| bl extern lj_tab_reasize // (lua_State *L, GCtab *t, int nasize)
| // Must not reallocate the stack.
| b <1
|
|7: // Possible table write barrier for any value. Skip valiswhite check.
| barrierback TAB:RB, TMP3, TMP0
| b <4
break; break;
/* -- Calls and vararg handling ----------------------------------------- */ /* -- Calls and vararg handling ----------------------------------------- */