[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Vector/Altivec/2007-01-07-lvsl-lvsr-Regression.c
Jim Laskey
jlaskey at apple.com
Sun Jan 7 05:32:45 PST 2007
Changes in directory llvm-test/SingleSource/UnitTests/Vector/Altivec:
2007-01-07-lvsl-lvsr-Regression.c added (r1.1)
---
Log message:
Regression test for llvm-rs6000.cpp function cache overlap.
---
Diffs of the changes: (+28 -0)
2007-01-07-lvsl-lvsr-Regression.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+)
Index: llvm-test/SingleSource/UnitTests/Vector/Altivec/2007-01-07-lvsl-lvsr-Regression.c
diff -c /dev/null llvm-test/SingleSource/UnitTests/Vector/Altivec/2007-01-07-lvsl-lvsr-Regression.c:1.1
*** /dev/null Sun Jan 7 07:32:40 2007
--- llvm-test/SingleSource/UnitTests/Vector/Altivec/2007-01-07-lvsl-lvsr-Regression.c Sun Jan 7 07:32:30 2007
***************
*** 0 ****
--- 1,28 ----
+ #include <stdio.h>
+ #include <altivec.h>
+
+ __vector unsigned char C_uchar1[2] = {
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
+ { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 }
+ };
+ __vector unsigned char C_uchar2[2] = {
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
+ { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 }
+ };
+
+ void print_vector(__vector unsigned char v) {
+ unsigned *vp = (unsigned *)&v;
+ printf("%08x%08x%08x%08x\n", vp[0], vp[1], vp[2], vp[3]);
+ }
+
+ int main(int argc, const char * argv[]) {
+ C_uchar1[0] = (__vector unsigned char)__builtin_altivec_lvsl(1,
+ (void *)&C_uchar1);
+ C_uchar2[0] = (__vector unsigned char)__builtin_altivec_lvsr(1,
+ (void *)&C_uchar2);
+ print_vector(C_uchar1[0]);
+ print_vector(C_uchar1[1]);
+ print_vector(C_uchar2[0]);
+ print_vector(C_uchar2[1]);
+ return 0;
+ }
More information about the llvm-commits
mailing list