1 /* { dg-do run { target powerpc*-*-* } } */
2 /* { dg-require-effective-target powerpc_altivec_ok } */
3 /* { dg-options "-maltivec" } */
5 /* Test the vec_splats and vec_promote VMX intrinsics. */
7 #include "altivec_check.h"
9 extern "C" void abort (void);
11 vector int a[] = {{0, 0, 0, 0}, {1,0,0,0}, {1,2,0,0},{1,2,3,0},{1,2,3,4},{5,2,3,4},{5,6,3,4}};
12 vector int c = {0,6,3,4};
13 vector int d = {0,0,3,4};
14 int main1(int t) __attribute__((noinline));
18 vector int b = vec_splats(0);
19 for(i = 0;i<sizeof(a)/sizeof(a[0])-1;i++)
21 if (__builtin_memcmp (&b, &a[i], sizeof(vector int)))
23 b = vec_insert(i+1, b, i);
25 if (__builtin_memcmp (&b, &a[i], sizeof(vector int)))
28 b = vec_insert(0, b, 0);
29 if (__builtin_memcmp (&b, &c, sizeof(vector int)))
32 b = vec_insert(0, b, 1);
33 if (__builtin_memcmp (&b, &d, sizeof(vector int)))
41 altivec_check(); /* Exits if AltiVec not supported */