PPC: Add modulo instructions.

This commit is contained in:
Mike Pall 2010-09-08 00:12:23 +02:00
parent e9e7df5bfe
commit 932193baa6

View File

@ -1272,10 +1272,18 @@ static void build_ins(BuildCtx *ctx, BCOp op, int defop)
| ins_arith efddiv | ins_arith efddiv
break; break;
case BC_MODVN: case BC_MODVN:
| NYI | ins_arithpre RD, SAVE0
|->BC_MODVN_Z:
| efddiv CARG2, RD, SAVE0
| bl ->vm_floor // floor(b/c)
| efdmul TMP0, CRET2, SAVE0
| efdsub TMP0, RD, TMP0 // b - floor(b/c)*c
| evstddx TMP0, BASE, RA
| ins_next
break; break;
case BC_MODNV: case BC_MODVV: case BC_MODNV: case BC_MODVV:
| NYI | ins_arithpre RD, SAVE0
| b ->BC_MODVN_Z // Avoid 3 copies. It's slow anyway.
break; break;
case BC_POW: case BC_POW:
| evlddx CARG2, BASE, RB | evlddx CARG2, BASE, RB