Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / p9-extract-2.c
blob34f9bdd142eae480379522e94687ecadd17a55f8
1 /* { dg-do compile { target { powerpc64*-*-* && lp64 } } } */
2 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
3 /* { dg-require-effective-target powerpc_p9vector_ok } */
4 /* { dg-options "-mcpu=power9 -O2" } */
6 #include <altivec.h>
8 void extract_int_0 (int *p, vector int a) { *p = vec_extract (a, 0); }
9 void extract_int_3 (int *p, vector int a) { *p = vec_extract (a, 3); }
11 void extract_short_0 (short *p, vector short a) { *p = vec_extract (a, 0); }
12 void extract_short_3 (short *p, vector short a) { *p = vec_extract (a, 7); }
14 void extract_schar_0 (signed char *p, vector signed char a) { *p = vec_extract (a, 0); }
15 void extract_schar_3 (signed char *p, vector signed char a) { *p = vec_extract (a, 15); }
17 /* { dg-final { scan-assembler "vextractub" } } */
18 /* { dg-final { scan-assembler "vextractuh" } } */
19 /* { dg-final { scan-assembler "xxextractuw" } } */
20 /* { dg-final { scan-assembler "stxsibx" } } */
21 /* { dg-final { scan-assembler "stxsihx" } } */
22 /* { dg-final { scan-assembler "stfiwx\|stxsiwx" } } */
23 /* { dg-final { scan-assembler-not "mfvsrd" } } */
24 /* { dg-final { scan-assembler-not "stxvd2x" } } */
25 /* { dg-final { scan-assembler-not "stxv" } } */
26 /* { dg-final { scan-assembler-not "lwa" } } */
27 /* { dg-final { scan-assembler-not "stw" } } */