aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-17 20:37:18 +0000
committerChris Lattner <sabre@nondot.org>2009-10-17 20:37:18 +0000
commitd0772882bc15a2318fd4cf30dc73e138e5058397 (patch)
tree7f04018d9509a39f11a419145127519d70ae91fa /test
parent6a2b9261bf9c973c7122d9d1febce24a38fa862d (diff)
daniel really wants this in the testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84354 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/vector.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/test/CodeGen/vector.c b/test/CodeGen/vector.c
index 5e48fd42b1..2945ebaa4d 100644
--- a/test/CodeGen/vector.c
+++ b/test/CodeGen/vector.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -emit-llvm %s -o -
+// RUN: clang-cc -triple i386-apple-darwin9 -mcpu=pentium4 -g -emit-llvm %s -o -
typedef short __v4hi __attribute__ ((__vector_size__ (8)));
-void f() {
+void test1() {
__v4hi A = (__v4hi)0LL;
}
@@ -9,11 +9,34 @@ __v4hi x = {1,2,3};
__v4hi y = {1,2,3,4};
typedef int vty __attribute((vector_size(16)));
-int a() { vty b; return b[2LL]; }
+int test2() { vty b; return b[2LL]; }
// PR4339
typedef float vec4 __attribute__((vector_size(16)));
-void vac ( vec4* a, char b, float c ) {
+void test3 ( vec4* a, char b, float c ) {
(*a)[b] = c;
}
+
+
+
+
+#include <mmintrin.h>
+
+int test4(int argc, char *argv[]) {
+ int array[16] = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 };
+ __m64 *p = (__m64 *)array;
+
+ __m64 accum = _mm_setzero_si64();
+
+ for (int i=0; i<8; ++i)
+ accum = _mm_add_pi32(p[i], accum);
+
+ __m64 accum2 = _mm_unpackhi_pi32(accum, accum);
+ accum = _mm_add_pi32(accum, accum2);
+
+ int result = _mm_cvtsi64_si32(accum);
+ _mm_empty();
+
+ return result;
+}