[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Vector/build.c helpers.h simple.c
Chris Lattner
lattner at cs.uiuc.edu
Tue Mar 21 17:48:47 PST 2006
Changes in directory llvm-test/SingleSource/UnitTests/Vector:
build.c added (r1.1)
helpers.h added (r1.1)
simple.c added (r1.1)
---
Log message:
add some trivial testcases.
---
Diffs of the changes: (+39 -0)
build.c | 14 ++++++++++++++
helpers.h | 10 ++++++++++
simple.c | 15 +++++++++++++++
3 files changed, 39 insertions(+)
Index: llvm-test/SingleSource/UnitTests/Vector/build.c
diff -c /dev/null llvm-test/SingleSource/UnitTests/Vector/build.c:1.1
*** /dev/null Tue Mar 21 19:48:45 2006
--- llvm-test/SingleSource/UnitTests/Vector/build.c Tue Mar 21 19:48:35 2006
***************
*** 0 ****
--- 1,14 ----
+ #include "helpers.h"
+
+ int main(int argc, char **Argv) {
+ float X = 1.234;
+ if (argc == 1123) X = 2.38213;
+ FV A;
+ A.V = (v4sf){ X, X, X, X }; // splat
+ A.V = A.V * A.V;
+ printFV(&A);
+ A.V = (v4sf){ X, X, 0, 0 };
+ A.V = A.V+A.V;
+ printFV(&A);
+ }
+
Index: llvm-test/SingleSource/UnitTests/Vector/helpers.h
diff -c /dev/null llvm-test/SingleSource/UnitTests/Vector/helpers.h:1.1
*** /dev/null Tue Mar 21 19:48:47 2006
--- llvm-test/SingleSource/UnitTests/Vector/helpers.h Tue Mar 21 19:48:35 2006
***************
*** 0 ****
--- 1,10 ----
+ typedef float v4sf __attribute__ ((__vector_size__ (16)));
+
+ typedef union {
+ v4sf V;
+ float A[4];
+ } FV;
+
+ static void printFV(FV *F) {
+ printf("%f %f %f %f\n", F->A[0], F->A[1], F->A[2], F->A[3]);
+ }
Index: llvm-test/SingleSource/UnitTests/Vector/simple.c
diff -c /dev/null llvm-test/SingleSource/UnitTests/Vector/simple.c:1.1
*** /dev/null Tue Mar 21 19:48:47 2006
--- llvm-test/SingleSource/UnitTests/Vector/simple.c Tue Mar 21 19:48:35 2006
***************
*** 0 ****
--- 1,15 ----
+
+ #include "helpers.h"
+
+ int main(int argc, char **Argv) {
+ float X = 1.234;
+ if (argc == 1123) X = 2.38213;
+ FV A;
+ A.V = (v4sf){ X, X, X, X }; // splat
+ A.V = A.V * A.V;
+ printFV(&A);
+ A.V = (v4sf){ X, X, 0, 0 };
+ A.V = A.V+A.V;
+ printFV(&A);
+ }
+
More information about the llvm-commits
mailing list