aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2012-10-15 21:28:10 +0200
committerMike Pall <mike>2012-10-15 21:28:10 +0200
commitbbe35adfcd1d07c36b50a050fc09c34fd166d67e (patch)
treea75375f9abe91c46edb16d24ed2cda9c683c9734 /src
parenta58b86dad39835841eb6f24e13253c69447abfc9 (diff)
downloadluajit-bbe35adfcd1d07c36b50a050fc09c34fd166d67e.tar.gz
luajit-bbe35adfcd1d07c36b50a050fc09c34fd166d67e.tar.bz2
luajit-bbe35adfcd1d07c36b50a050fc09c34fd166d67e.zip
MIPS: Compile math.sqrt() to sqrt.d instruction.
Diffstat (limited to 'src')
-rw-r--r--src/lj_asm_mips.h2
-rw-r--r--src/lj_target_mips.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h
index 37160c05..5d4115a9 100644
--- a/src/lj_asm_mips.h
+++ b/src/lj_asm_mips.h
@@ -1827,6 +1827,8 @@ static void asm_ir(ASMState *as, IRIns *ir)
1827 break; 1827 break;
1828 if (ir->op2 <= IRFPM_TRUNC) 1828 if (ir->op2 <= IRFPM_TRUNC)
1829 asm_callround(as, ir, IRCALL_lj_vm_floor + ir->op2); 1829 asm_callround(as, ir, IRCALL_lj_vm_floor + ir->op2);
1830 else if (ir->op2 == IRFPM_SQRT)
1831 asm_fpunary(as, ir, MIPSI_SQRT_D);
1830 else 1832 else
1831 asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2); 1833 asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);
1832 break; 1834 break;
diff --git a/src/lj_target_mips.h b/src/lj_target_mips.h
index 1b7727d0..4d079eaa 100644
--- a/src/lj_target_mips.h
+++ b/src/lj_target_mips.h
@@ -223,6 +223,7 @@ typedef enum MIPSIns {
223 MIPSI_SUB_D = 0x46200001, 223 MIPSI_SUB_D = 0x46200001,
224 MIPSI_MUL_D = 0x46200002, 224 MIPSI_MUL_D = 0x46200002,
225 MIPSI_DIV_D = 0x46200003, 225 MIPSI_DIV_D = 0x46200003,
226 MIPSI_SQRT_D = 0x46200004,
226 227
227 MIPSI_ADD_S = 0x46000000, 228 MIPSI_ADD_S = 0x46000000,
228 MIPSI_SUB_S = 0x46000001, 229 MIPSI_SUB_S = 0x46000001,