1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_fprs } */
4 /* { dg-options "-O2 -ffast-math -mdejagnu-cpu=power5 -mno-altivec -mabi=altivec -fno-unroll-loops" } */
5 /* { dg-final { scan-assembler-times "vaddfp" 1 } } */
6 /* { dg-final { scan-assembler-times "xvaddsp" 1 } } */
7 /* { dg-final { scan-assembler-times "fadds" 1 } } */
14 #error "__ALTIVEC__ should not be defined."
18 #error "__VSX__ should not be defined."
21 #pragma GCC target("altivec,vsx")
23 #pragma GCC reset_options
25 #pragma GCC push_options
26 #pragma GCC target("altivec,no-vsx")
29 #error "__ALTIVEC__ should be defined."
33 #error "__VSX__ should not be defined."
37 av_add (vector
float *a
, vector
float *b
, vector
float *c
)
40 unsigned long n
= SIZE
/ 4;
42 for (i
= 0; i
< n
; i
++)
43 a
[i
] = vec_add (b
[i
], c
[i
]);
46 #pragma GCC target("vsx")
49 #error "__ALTIVEC__ should be defined."
53 #error "__VSX__ should be defined."
57 vsx_add (vector
float *a
, vector
float *b
, vector
float *c
)
60 unsigned long n
= SIZE
/ 4;
62 for (i
= 0; i
< n
; i
++)
63 a
[i
] = vec_add (b
[i
], c
[i
]);
66 #pragma GCC pop_options
67 #pragma GCC target("no-vsx,no-altivec")
70 #error "__ALTIVEC__ should not be defined."
74 #error "__VSX__ should not be defined."
78 norm_add (float *a
, float *b
, float *c
)
82 for (i
= 0; i
< SIZE
; i
++)