1 /* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
2 /* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
3 /* { dg-require-effective-target powerpc_altivec_ok } */
4 /* { dg-options "-maltivec" } */
6 /* Test the vec_splats and vec_promote VMX intrinsics. */
9 extern 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)))