[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Vector/divides.c
Reid Spencer
reid at x10sys.com
Wed Oct 25 22:59:39 PDT 2006
Changes in directory llvm-test/SingleSource/UnitTests/Vector:
divides.c added (r1.1)
---
Log message:
Add a new test case for testing vector divides, both signed and unsigned.
---
Diffs of the changes: (+33 -0)
divides.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+)
Index: llvm-test/SingleSource/UnitTests/Vector/divides.c
diff -c /dev/null llvm-test/SingleSource/UnitTests/Vector/divides.c:1.1
*** /dev/null Thu Oct 26 00:59:35 2006
--- llvm-test/SingleSource/UnitTests/Vector/divides.c Thu Oct 26 00:59:25 2006
***************
*** 0 ****
--- 1,33 ----
+ #include <stdio.h>
+ typedef unsigned uvec __attribute__ ((__vector_size__ (16)));
+ typedef int svec __attribute__ ((__vector_size__ (16)));
+ void testuvec(uvec *A, uvec *B, uvec *R) { *R = *A / *B; }
+ void testsvec(svec *A, svec *B, svec *R) { *R = *A / *B; }
+
+ typedef union {
+ svec V;
+ int A[4];
+ } SV;
+
+ typedef union {
+ uvec V;
+ unsigned A[4];
+ } UV;
+
+ int main(int argc, char**argv) {
+ SV S1, S2, S3;
+ UV U1, U2, U3;
+ S1.A[0] = S2.A[0] = 2;
+ S1.A[1] = S2.A[1] = -3;
+ S1.A[2] = S2.A[2] = 5;
+ S1.A[3] = S2.A[3] = -8;
+ U1.A[0] = U2.A[0] = 2;
+ U1.A[1] = U2.A[1] = 3;
+ U1.A[2] = U2.A[2] = 5;
+ U1.A[3] = U2.A[3] = 8;
+ testuvec(&U1.V, &U2.V, &U3.V);
+ testsvec(&S1.V, &S2.V, &S3.V);
+
+ printf("U3.V = <%u %u %u %u>\n", U3.A[0], U3.A[1], U3.A[2], U3.A[3]);
+ printf("S3.V = <%u %u %u %u>\n", S3.A[0], S3.A[1], S3.A[2], S3.A[3]);
+ }
More information about the llvm-commits
mailing list