PPC: Add call and iterator call instructions.

This commit is contained in:
Mike Pall 2010-09-03 21:02:55 +02:00
parent b4c8b05ad5
commit 684acbe930

View File

@ -1520,10 +1520,21 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
/* -- Calls and vararg handling ----------------------------------------- */ /* -- Calls and vararg handling ----------------------------------------- */
case BC_CALLM: case BC_CALLM:
| NYI | // RA = base*8, (RB = (nresults+1)*8,) RC = extra_nargs*8
| lwz TMP0, SAVE_MULTRES
| add NARGS8:RC, NARGS8:RC, TMP0
| // Fall through. Assumes BC_CALL follows.
break; break;
case BC_CALL: case BC_CALL:
| NYI | // RA = base*8, (RB = (nresults+1)*8,) RC = (nargs+1)*8
| evlddx LFUNC:RB, BASE, RA
| mr TMP2, BASE
| add BASE, BASE, RA
| subi NARGS8:RC, NARGS8:RC, 8
| checkfunc LFUNC:RB
| addi BASE, BASE, 8
| checkfail ->vmeta_call
| ins_call
break; break;
case BC_CALLMT: case BC_CALLMT:
@ -1534,7 +1545,21 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
break; break;
case BC_ITERC: case BC_ITERC:
| NYI | // RA = base*8, (RB = (nresults+1)*8,) RC = (nargs+1)*8 ((2+1)*8)
| subi RA, RA, 24 // evldd doesn't support neg. offsets.
| mr TMP2, BASE
| evlddx LFUNC:RB, BASE, RA
| add BASE, BASE, RA
| evldd TMP0, 8(BASE)
| evldd TMP1, 16(BASE)
| evstdd LFUNC:RB, 24(BASE) // Copy callable.
| checkfunc LFUNC:RB
| evstdd TMP0, 32(BASE) // Copy state.
| li NARGS8:RC, 16 // Iterators get 2 arguments.
| evstdd TMP1, 40(BASE) // Copy control var.
| addi BASE, BASE, 32
| checkfail ->vmeta_call
| ins_call
break; break;
case BC_VARG: case BC_VARG: