Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr57150.c
blob1afacae9725a37223cb79b5b5c428fa6ff236ee0
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
5 /* { dg-options "-O3 -mcpu=power7 -fcaller-saves" } */
6 /* { dg-final { scan-assembler-not "lxvd2x" } } */
7 /* { dg-final { scan-assembler-not "lxvw4x" } } */
8 /* { dg-final { scan-assembler-not "lvx" } } */
9 /* { dg-final { scan-assembler-not "stxvd2x" } } */
10 /* { dg-final { scan-assembler-not "stxvw4x" } } */
11 /* { dg-final { scan-assembler-not "stvx" } } */
13 /* Insure caller save on long double does not use VSX instructions. */
15 #if defined(__LONG_DOUBLE_IEEE128__)
16 /* If long double is IEEE 128-bit, we need to use the __ibm128 type instead of
17 long double. We can't use __ibm128 on systems that don't support IEEE
18 128-bit floating point, because the type is not enabled on those
19 systems. */
20 #define LDOUBLE __ibm128
22 #elif defined(__LONG_DOUBLE_IBM128__)
23 #define LDOUBLE long double
25 #else
26 #error "long double must be either IBM 128-bit or IEEE 128-bit"
27 #endif
29 extern LDOUBLE modify (LDOUBLE);
31 void
32 sum (LDOUBLE *ptr, LDOUBLE value, unsigned long n)
34 unsigned long i;
36 for (i = 0; i < n; i++)
37 ptr[i] += modify (value);