Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/altivec-37.c

raw
1 /* { dg-do compile { target powerpc*-*-* } } */
2 /* { dg-options "-mvsx" } */
3 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
4 /* { dg-require-effective-target powerpc_vsx } */
5
6 #include <altivec.h>
7
8 vector bool int *vecubi;
9 vector bool long long *vecublli;
10 vector signed int *vecsi;
11 vector signed long long int *vecslli;
12
13 int main ()
14 {
15
16 /* use of ‘long long’ in AltiVec types requires -mvsx */
17 /* __builtin_altivec_vupkhsw and __builtin_altivec_vupklsw
18 requires the -mcpu=power8 and -mvsx option */
19 *vecublli++ = vec_unpackh(vecubi[0]);
20 *vecublli++ = vec_unpackl(vecubi[0]);
21 *vecslli++ = vec_unpackh(vecsi[0]);
22 *vecslli++ = vec_unpackl(vecsi[0]);
23
24 return 0;
25 }
26
27 /* Expected results:
28 vec_unpackh vupklsw
29 vec_unpackl vupkhsw
30 */
31
32 /* { dg-final { scan-assembler-times "vupklsw" 2 } } */
33 /* { dg-final { scan-assembler-times "vupkhsw" 2 } } */