aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/palignr.c
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2009-12-14 04:57:03 +0000
committerNate Begeman <natebegeman@mac.com>2009-12-14 04:57:03 +0000
commitce5818a19a8f77d1540d0352649d6687eca4af6b (patch)
tree83ed72f91711d4cd14d2b2b2fc759f9c24cbf7c6 /test/CodeGen/palignr.c
parent1d9c54df56391ac4740db27d551782e81189cb51 (diff)
Support x86's PALIGNR instruction without the use of a palignr intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/palignr.c')
-rw-r--r--test/CodeGen/palignr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/palignr.c b/test/CodeGen/palignr.c
new file mode 100644
index 0000000000..c0c7e77384
--- /dev/null
+++ b/test/CodeGen/palignr.c
@@ -0,0 +1,15 @@
+// RUN: clang-cc %s -triple=i686-apple-darwin -target-feature +ssse3 -O1 -S -o - | FileCheck %s
+
+#define _mm_alignr_epi8(a, b, n) (__builtin_ia32_palignr128((a), (b), (n)))
+typedef __attribute__((vector_size(16))) int int4;
+
+// CHECK: palignr
+int4 align1(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 15); }
+// CHECK: ret
+// CHECK: ret
+// CHECK-NOT: palignr
+int4 align2(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 16); }
+// CHECK: psrldq
+int4 align3(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 17); }
+// CHECK: xorps
+int4 align4(int4 a, int4 b) { return _mm_alignr_epi8(a, b, 32); }