summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2014-08-06 20:45:30 +0000
committerSanjay Patel <spatel@rotateright.com>2014-08-06 20:45:30 +0000
commitcd47959eb614ceb13c4a723068c72d0930f5c4e2 (patch)
treeebfc960f2eb1982490c841f79457805dd9c212a4 /llvm
parenta6dc6c281c4518ff39daf125d27d598e10ed30ae (diff)
downloadbcm5719-llvm-cd47959eb614ceb13c4a723068c72d0930f5c4e2.tar.gz
bcm5719-llvm-cd47959eb614ceb13c4a723068c72d0930f5c4e2.zip
Fix a test that has no checks.
X86 doesn't have fneg, so check for xor. Differential Revision: http://reviews.llvm.org/D4812 llvm-svn: 214992
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/CodeGen/X86/vec_fneg.ll22
1 files changed, 17 insertions, 5 deletions
diff --git a/llvm/test/CodeGen/X86/vec_fneg.ll b/llvm/test/CodeGen/X86/vec_fneg.ll
index d49c70e5639..00383be02c9 100644
--- a/llvm/test/CodeGen/X86/vec_fneg.ll
+++ b/llvm/test/CodeGen/X86/vec_fneg.ll
@@ -1,11 +1,23 @@
-; RUN: llc < %s -march=x86 -mattr=+sse2
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=corei7 | FileCheck %s
+; FNEG is defined as subtraction from -0.0.
+
+; This test verifies that we use an xor with a constant to flip the sign bits; no subtraction needed.
define <4 x float> @t1(<4 x float> %Q) {
- %tmp15 = fsub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %Q
- ret <4 x float> %tmp15
+; CHECK-LABEL: t1:
+; CHECK: xorps {{.*}}LCPI0_0{{.*}}, %xmm0
+; CHECK-NEXT: retq
+ %tmp = fsub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %Q
+ ret <4 x float> %tmp
}
+; This test verifies that we generate an FP subtraction because "0.0 - x" is not an fneg.
define <4 x float> @t2(<4 x float> %Q) {
- %tmp15 = fsub <4 x float> zeroinitializer, %Q
- ret <4 x float> %tmp15
+; CHECK-LABEL: t2:
+; CHECK: xorps %[[X:xmm[0-9]+]], %[[X]]
+; CHECK-NEXT: subps %xmm0, %[[X]]
+; CHECK-NEXT: movaps %[[X]], %xmm0
+; CHECK-NEXT: retq
+ %tmp = fsub <4 x float> zeroinitializer, %Q
+ ret <4 x float> %tmp
}
OpenPOWER on IntegriCloud