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 | |
parent | 2621617a9292ea821a0630339e20e83e11858a5e (diff) | |
download | luajit-a58b86dad39835841eb6f24e13253c69447abfc9.tar.gz luajit-a58b86dad39835841eb6f24e13253c69447abfc9.tar.bz2 luajit-a58b86dad39835841eb6f24e13253c69447abfc9.zip |
PPC: Compile math.sqrt() to fsqrt instruction.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_asm_ppc.h | 5 | ||||
-rw-r--r-- | src/lj_target_ppc.h | 1 |
2 files changed, 5 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) | |||
2026 | case IR_FPMATH: | 2026 | case IR_FPMATH: |
2027 | if (ir->op2 == IRFPM_EXP2 && asm_fpjoin_pow(as, ir)) | 2027 | if (ir->op2 == IRFPM_EXP2 && asm_fpjoin_pow(as, ir)) |
2028 | break; | 2028 | break; |
2029 | asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2); | 2029 | if (ir->op2 == IRFPM_SQRT && (as->flags & JIT_F_SQRT)) |
2030 | asm_fpunary(as, ir, PPCI_FSQRT); | ||
2031 | else | ||
2032 | asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2); | ||
2030 | break; | 2033 | break; |
2031 | 2034 | ||
2032 | /* Overflow-checking arithmetic ops. */ | 2035 | /* Overflow-checking arithmetic ops. */ |
diff --git a/src/lj_target_ppc.h b/src/lj_target_ppc.h index f5e89325..5347c3f7 100644 --- a/src/lj_target_ppc.h +++ b/src/lj_target_ppc.h | |||
@@ -263,6 +263,7 @@ typedef enum PPCIns { | |||
263 | PPCI_FSUB = 0xfc000028, | 263 | PPCI_FSUB = 0xfc000028, |
264 | PPCI_FMUL = 0xfc000032, | 264 | PPCI_FMUL = 0xfc000032, |
265 | PPCI_FDIV = 0xfc000024, | 265 | PPCI_FDIV = 0xfc000024, |
266 | PPCI_FSQRT = 0xfc00002c, | ||
266 | 267 | ||
267 | PPCI_FMADD = 0xfc00003a, | 268 | PPCI_FMADD = 0xfc00003a, |
268 | PPCI_FMSUB = 0xfc000038, | 269 | PPCI_FMSUB = 0xfc000038, |