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" } } */
12 
13 /* Insure caller save on long double does not use VSX instructions.  */
14 
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
21 
22 #elif defined(__LONG_DOUBLE_IBM128__)
23 #define LDOUBLE long double
24 
25 #else
26 #error "long double must be either IBM 128-bit or IEEE 128-bit"
27 #endif
28 
29 extern LDOUBLE modify (LDOUBLE);
30 
31 void
sum(LDOUBLE * ptr,LDOUBLE value,unsigned long n)32 sum (LDOUBLE *ptr, LDOUBLE value, unsigned long n)
33 {
34   unsigned long i;
35 
36   for (i = 0; i < n; i++)
37     ptr[i] += modify (value);
38 }
39