aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-09-05 23:07:03 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-09-05 23:07:03 +0000
commit7fa52cae3b36df1f45f50289d684d8fbe56503b6 (patch)
treebfe771f0c124753499ee1face4e30fc597a52a6d /test
parent283e4995a27b39e2d5b206ba64cffb06a9c35dd4 (diff)
downloadexternal_llvm-7fa52cae3b36df1f45f50289d684d8fbe56503b6.zip
external_llvm-7fa52cae3b36df1f45f50289d684d8fbe56503b6.tar.gz
external_llvm-7fa52cae3b36df1f45f50289d684d8fbe56503b6.tar.bz2
Fix for PR2687: Add patterns to match sint_to_fp and fp_to_sint for <2 x
i32>. This is a little messy, but it works. We should really get rid of the intrinsics, though, since they map perfectly well to standard LLVM instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55864 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/2008-09-05-sinttofp-2xi32.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2008-09-05-sinttofp-2xi32.ll b/test/CodeGen/X86/2008-09-05-sinttofp-2xi32.ll
new file mode 100644
index 0000000..ffe10d4
--- /dev/null
+++ b/test/CodeGen/X86/2008-09-05-sinttofp-2xi32.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep cvttpd2pi | count 1
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep cvtpi2pd | count 1
+; PR2687
+
+define <2 x double> @a(<2 x i32> %x) nounwind {
+entry:
+ %y = sitofp <2 x i32> %x to <2 x double>
+ ret <2 x double> %y
+}
+
+define <2 x i32> @b(<2 x double> %x) nounwind {
+entry:
+ %y = fptosi <2 x double> %x to <2 x i32>
+ ret <2 x i32> %y
+}