summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/floor-soft-float.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/X86/floor-soft-float.ll')
-rw-r--r--test/CodeGen/X86/floor-soft-float.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/X86/floor-soft-float.ll b/test/CodeGen/X86/floor-soft-float.ll
new file mode 100644
index 0000000000..158a82413d
--- /dev/null
+++ b/test/CodeGen/X86/floor-soft-float.ll
@@ -0,0 +1,11 @@
+; RUN: llc < %s -march=x86-64 -mattr=+sse41 -soft-float=0 | FileCheck %s --check-prefix=CHECK-HARD-FLOAT
+; RUN: llc < %s -march=x86-64 -mattr=+sse41 -soft-float=1 | FileCheck %s --check-prefix=CHECK-SOFT-FLOAT
+
+declare float @llvm.floor.f32(float)
+
+; CHECK-SOFT-FLOAT: callq _floorf
+; CHECK-HARD-FLOAT: vroundss $1, %xmm0, %xmm0, %xmm0
+define float @myfloor(float %a) {
+ %val = tail call float @llvm.floor.f32(float %a)
+ ret float %val
+}