[llvm-commits] [test-suite] r47942 - /test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.shift.c
Evan Cheng
evan.cheng at apple.com
Wed Mar 5 00:26:18 PST 2008
Author: evancheng
Date: Wed Mar 5 02:26:18 2008
New Revision: 47942
URL: http://llvm.org/viewvc/llvm-project?rev=47942&view=rev
Log:
Add a test for _mm_slli_epi16 and _mm_srli_epi16.
Added:
test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.shift.c
Added: test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.shift.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.shift.c?rev=47942&view=auto
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.shift.c (added)
+++ test-suite/trunk/SingleSource/UnitTests/Vector/SSE/sse.shift.c Wed Mar 5 02:26:18 2008
@@ -0,0 +1,21 @@
+#include <emmintrin.h>
+#include <stdio.h>
+
+typedef union {
+ __m128i V;
+ int A[4];
+} IV;
+
+static void printIV(IV *F) {
+ printf("%08x %08x %08x %08x\n", F->A[0], F->A[1], F->A[2], F->A[3]);
+}
+
+int main() {
+ __m128i allones, zeroones, onezeros;
+ allones = _mm_cmpeq_epi32(allones, allones);
+ zeroones = _mm_srli_epi16(allones, 8);
+ printIV((IV*)&zeroones);
+ onezeros = _mm_slli_epi16(allones, 8);
+ printIV((IV*)&onezeros);
+ return 0;
+}
More information about the llvm-commits
mailing list