1 /* { dg-do run { target int128 } } */
2 /* { dg-require-effective-target vsx_hw } */
3 /* { dg-options "-mvsx" } */
5 /* This test should run the same on any target that supports vsx
6 instructions. Intentionally not specifying cpu in order to test
7 all code generation paths. */
11 /* Define this after PR89424 is addressed. */
14 /* Define this after PR89626 is addressed. */
23 extern void abort (void);
25 #define CONST0 (((SIGNED __int128) 31415926539) << 60)
27 /* Test that indices > length of vector are applied modulo the vector
30 /* Test for vector residing in register. */
31 SIGNED __int128
e0 (vector SIGNED __int128 v
)
33 return __builtin_vec_ext_v1ti (v
, 0);
36 SIGNED __int128
e3 (vector SIGNED __int128 v
)
38 return __builtin_vec_ext_v1ti (v
, 3);
41 /* Test for vector residing in memory. */
42 SIGNED __int128
me0 (vector SIGNED __int128
*vp
)
44 return __builtin_vec_ext_v1ti (*vp
, 0);
47 SIGNED __int128
me3 (vector SIGNED __int128
*vp
)
49 return __builtin_vec_ext_v1ti (*vp
, 3);
52 /* Test the same with variable indices. */
55 /* Test for variable selector and vector residing in register. */
56 __attribute__((noinline
))
57 SIGNED __int128
ei (vector SIGNED __int128 v
, int i
)
59 return __builtin_vec_ext_v1ti (v
, i
);
62 /* Test for variable selector and vector residing in memory. */
63 SIGNED __int128
mei (vector SIGNED __int128
*vp
, int i
)
65 return __builtin_vec_ext_v1ti (*vp
, i
);
69 int main (int argc
, char *argv
[]) {
70 vector SIGNED __int128 dv
= { CONST0
};