1 /* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target p8vector_hw } */
4 /* { dg-options "-mdejagnu-cpu=power8 -O2" } */
15 typedef __int128_t
__attribute__((__vector_size__(16))) vector_128_t
;
16 typedef __int128_t scalar_128_t
;
17 typedef unsigned long long scalar_64_t
;
19 volatile scalar_64_t one
= 1;
20 volatile scalar_64_t two
= 2;
25 scalar_128_t a
= (((scalar_128_t
)one
) << 64) | ((scalar_128_t
)two
);
26 vector_128_t v1
= (vector_128_t
) { a
};
27 vector_128_t v2
= __builtin_pack_vector_int128 (one
, two
);
28 scalar_64_t x0
= __builtin_unpack_vector_int128 (v1
, 0);
29 scalar_64_t x1
= __builtin_unpack_vector_int128 (v1
, 1);
30 vector_128_t v3
= __builtin_pack_vector_int128 (x0
, x1
);
37 unsigned char uc
[sizeof (scalar_128_t
)];
38 char c
[sizeof (scalar_128_t
)];
45 for (i
= 0; i
< sizeof (scalar_128_t
); i
++)
46 printf ("%.2x", u
.uc
[i
]);
50 for (i
= 0; i
< sizeof (scalar_128_t
); i
++)
51 printf ("%.2x", u
.uc
[i
]);
55 for (i
= 0; i
< sizeof (scalar_128_t
); i
++)
56 printf ("%.2x", u
.uc
[i
]);
60 for (i
= 0; i
< sizeof (scalar_128_t
); i
++)
61 printf ("%.2x", u
.uc
[i
]);
65 for (i
= 0; i
< sizeof (scalar_64_t
); i
++)
66 printf ("%.2x", u
.uc
[i
]);
70 for (i
= 0; i
< sizeof (scalar_64_t
); i
++)
71 printf ("%.2x", u
.uc
[i
]);
79 if (memcmp (u
.c
, u2
.c
, sizeof (scalar_128_t
)) != 0)
83 if (memcmp (u
.c
, u2
.c
, sizeof (scalar_128_t
)) != 0)
87 if (memcmp (u
.c
, u2
.c
, sizeof (scalar_128_t
)) != 0)