Add a test to make sure that we're lowering the shift amount correctly.
authorEric Christopher <echristo@apple.com>
Wed, 19 May 2010 00:22:04 +0000 (00:22 +0000)
committerEric Christopher <echristo@apple.com>
Wed, 19 May 2010 00:22:04 +0000 (00:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104090 91177308-0d34-0410-b5e6-96231b3b80d8

test/FrontendC/2010-05-18-palignr.c [new file with mode: 0644]

diff --git a/test/FrontendC/2010-05-18-palignr.c b/test/FrontendC/2010-05-18-palignr.c
new file mode 100644 (file)
index 0000000..a383f77
--- /dev/null
@@ -0,0 +1,22 @@
+// RUN: %llvmgcc -mssse3 -S -o - %s | llc -mtriple=x86_64-apple-darwin | FileCheck %s
+
+#include <tmmintrin.h>
+
+int main ()
+{
+#if defined( __SSSE3__ )
+
+#define vec_rld_epi16( _a, _i )  ({ vSInt16 _t = _a; _t = _mm_alignr_epi8( _t, _t, _i ); /*return*/ _t; })
+  typedef int16_t     vSInt16         __attribute__ ((__vector_size__ (16)));
+
+  short   dtbl[] = {1,2,3,4,5,6,7,8};
+  vSInt16 *vdtbl = (vSInt16*) dtbl;
+
+  vSInt16 v0;
+  v0 = *vdtbl;
+  // CHECK: pshufd  $57
+  v0 = vec_rld_epi16( v0, 4 );
+
+  return 0;
+#endif
+}