aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/fsxor-alignment.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-07-27 17:16:43 +0000
committerDan Gohman <gohman@apple.com>2007-07-27 17:16:43 +0000
commitd300622ebacde5bffb5b5e58142323e505df9dbe (patch)
treeeaaadf961ade373f2c208baa68d8bf6607eb42c0 /test/CodeGen/X86/fsxor-alignment.ll
parent9d3e79107d4ea26fe64a30e9981897735df10952 (diff)
downloadexternal_llvm-d300622ebacde5bffb5b5e58142323e505df9dbe.zip
external_llvm-d300622ebacde5bffb5b5e58142323e505df9dbe.tar.gz
external_llvm-d300622ebacde5bffb5b5e58142323e505df9dbe.tar.bz2
Re-apply 40504, but with a fix for the segfault it caused in oggenc:
Make the alignedload and alignedstore patterns always require 16-byte alignment. This way when they are used in the "Fs" instructions, in which a vector instruction is used for a scalar purpose, they can still require the full vector alignment. And add a regression test for this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40555 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/fsxor-alignment.ll')
-rw-r--r--test/CodeGen/X86/fsxor-alignment.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fsxor-alignment.ll b/test/CodeGen/X86/fsxor-alignment.ll
new file mode 100644
index 0000000..bb55e44
--- /dev/null
+++ b/test/CodeGen/X86/fsxor-alignment.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse -enable-unsafe-fp-math | \
+; RUN: grep -v sp | grep xorps | wc -l | grep 2
+
+; Don't fold the incoming stack arguments into the xorps instructions used
+; to do floating-point negations, because the arguments aren't vectors
+; and aren't vector-aligned.
+
+define void @foo(float* %p, float* %q, float %s, float %y) {
+ %ss = sub float -0.0, %s
+ %yy = sub float -0.0, %y
+ store float %ss, float* %p
+ store float %yy, float* %q
+ ret void
+}