PPC: Compile math.sqrt() to fsqrt instruction.

This commit is contained in:
Mike Pall
2012-10-15 21:23:20 +02:00
parent 2621617a92
commit a58b86dad3
2 changed files with 5 additions and 1 deletions

View File

@@ -2026,7 +2026,10 @@ static void asm_ir(ASMState *as, IRIns *ir)
case IR_FPMATH:
if (ir->op2 == IRFPM_EXP2 && asm_fpjoin_pow(as, ir))
break;
asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);
if (ir->op2 == IRFPM_SQRT && (as->flags & JIT_F_SQRT))
asm_fpunary(as, ir, PPCI_FSQRT);
else
asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);
break;
/* Overflow-checking arithmetic ops. */