diff options
author | Mike Pall <mike> | 2012-10-15 21:23:20 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-10-15 21:23:20 +0200 |
commit | a58b86dad39835841eb6f24e13253c69447abfc9 (patch) | |
tree | 69e37a35edf6adda7fb92a680ee7e1656ce033f5 /src/lj_asm_ppc.h | |
parent | 2621617a9292ea821a0630339e20e83e11858a5e (diff) | |
download | luajit2-a58b86dad39835841eb6f24e13253c69447abfc9.tar.gz |
PPC: Compile math.sqrt() to fsqrt instruction.
Diffstat (limited to 'src/lj_asm_ppc.h')
-rw-r--r-- | src/lj_asm_ppc.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lj_asm_ppc.h b/src/lj_asm_ppc.h index e3cbe5b8..f65eed5a 100644 --- a/src/lj_asm_ppc.h +++ b/src/lj_asm_ppc.h @@ -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. */ |