summaryrefslogtreecommitdiff
path: root/test/CodeGen/Mips/optimize-fp-math.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-12-22 00:04:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-12-22 00:04:03 +0000
commitf8af5cf600354830d4ccf59732403f0f073eccb9 (patch)
tree2ba0398b4c42ad4f55561327538044fd2c925a8b /test/CodeGen/Mips/optimize-fp-math.ll
parent59d6cff90eecf31cb3dd860c4e786674cfdd42eb (diff)
Diffstat (limited to 'test/CodeGen/Mips/optimize-fp-math.ll')
-rw-r--r--test/CodeGen/Mips/optimize-fp-math.ll32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/optimize-fp-math.ll b/test/CodeGen/Mips/optimize-fp-math.ll
new file mode 100644
index 0000000000000..8b71dc42344c1
--- /dev/null
+++ b/test/CodeGen/Mips/optimize-fp-math.ll
@@ -0,0 +1,32 @@
+; RUN: llc -march=mipsel < %s | FileCheck %s -check-prefix=32
+; RUN: llc -march=mips64el -mcpu=mips64 < %s | FileCheck %s -check-prefix=64
+
+; 32-LABEL: test_sqrtf_float_:
+; 32: sqrt.s $f[[R0:[0-9]+]], $f{{[0-9]+}}
+; 32: c.un.s $f[[R0]], $f[[R0]]
+; 64-LABEL: test_sqrtf_float_:
+; 64: sqrt.s $f[[R0:[0-9]+]], $f{{[0-9]+}}
+; 64: c.un.s $f[[R0]], $f[[R0]]
+
+define float @test_sqrtf_float_(float %a) {
+entry:
+ %call = tail call float @sqrtf(float %a)
+ ret float %call
+}
+
+declare float @sqrtf(float)
+
+; 32-LABEL: test_sqrt_double_:
+; 32: sqrt.d $f[[R0:[0-9]+]], $f{{[0-9]+}}
+; 32: c.un.d $f[[R0]], $f[[R0]]
+; 64-LABEL: test_sqrt_double_:
+; 64: sqrt.d $f[[R0:[0-9]+]], $f{{[0-9]+}}
+; 64: c.un.d $f[[R0]], $f[[R0]]
+
+define double @test_sqrt_double_(double %a) {
+entry:
+ %call = tail call double @sqrt(double %a)
+ ret double %call
+}
+
+declare double @sqrt(double)