summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/fold-xmm-zero.ll
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-06-10 00:30:08 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-06-10 00:30:08 +0000
commit88b2af7e61c4941f202214f07e2082e03045acde (patch)
treef555012a8f41dcf910441125cd603e5b36f61f5d /test/CodeGen/X86/fold-xmm-zero.ll
parentd3f4eeaec177ed34a54fede9faea4ffa94c4d0af (diff)
downloadllvm-88b2af7e61c4941f202214f07e2082e03045acde.tar.gz
llvm-88b2af7e61c4941f202214f07e2082e03045acde.tar.bz2
llvm-88b2af7e61c4941f202214f07e2082e03045acde.tar.xz
Add a simple test which makes sure folding immediate float zero to a memory operand works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132824 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/fold-xmm-zero.ll')
-rw-r--r--test/CodeGen/X86/fold-xmm-zero.ll34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fold-xmm-zero.ll b/test/CodeGen/X86/fold-xmm-zero.ll
new file mode 100644
index 0000000000..65c31f054b
--- /dev/null
+++ b/test/CodeGen/X86/fold-xmm-zero.ll
@@ -0,0 +1,34 @@
+; RUN: llc < %s -mtriple=i386-apple-macosx10.6.7 | FileCheck %s
+
+; Simple test to make sure folding for special constants (like float zero)
+; isn't completely broken.
+
+; CHECK: divss LCPI0
+
+%0 = type { float, float, float, float, float, float, float, float }
+
+define void @f() nounwind ssp {
+entry:
+ %0 = tail call %0 asm sideeffect "foo", "={xmm0},={xmm1},={xmm2},={xmm3},={xmm4},={xmm5},={xmm6},={xmm7},0,1,2,3,4,5,6,7,~{dirflag},~{fpsr},~{flags}"(float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00) nounwind
+ %asmresult = extractvalue %0 %0, 0
+ %asmresult8 = extractvalue %0 %0, 1
+ %asmresult9 = extractvalue %0 %0, 2
+ %asmresult10 = extractvalue %0 %0, 3
+ %asmresult11 = extractvalue %0 %0, 4
+ %asmresult12 = extractvalue %0 %0, 5
+ %asmresult13 = extractvalue %0 %0, 6
+ %asmresult14 = extractvalue %0 %0, 7
+ %div = fdiv float %asmresult, 0.000000e+00
+ %1 = tail call %0 asm sideeffect "bar", "={xmm0},={xmm1},={xmm2},={xmm3},={xmm4},={xmm5},={xmm6},={xmm7},0,1,2,3,4,5,6,7,~{dirflag},~{fpsr},~{flags}"(float %div, float %asmresult8, float %asmresult9, float %asmresult10, float %asmresult11, float %asmresult12, float %asmresult13, float %asmresult14) nounwind
+ %asmresult24 = extractvalue %0 %1, 0
+ %asmresult25 = extractvalue %0 %1, 1
+ %asmresult26 = extractvalue %0 %1, 2
+ %asmresult27 = extractvalue %0 %1, 3
+ %asmresult28 = extractvalue %0 %1, 4
+ %asmresult29 = extractvalue %0 %1, 5
+ %asmresult30 = extractvalue %0 %1, 6
+ %asmresult31 = extractvalue %0 %1, 7
+ %div33 = fdiv float %asmresult24, 0.000000e+00
+ %2 = tail call %0 asm sideeffect "baz", "={xmm0},={xmm1},={xmm2},={xmm3},={xmm4},={xmm5},={xmm6},={xmm7},0,1,2,3,4,5,6,7,~{dirflag},~{fpsr},~{flags}"(float %div33, float %asmresult25, float %asmresult26, float %asmresult27, float %asmresult28, float %asmresult29, float %asmresult30, float %asmresult31) nounwind
+ ret void
+}