1 /* { dg-do compile } */
2 /* { dg-require-effective-target lp64 } */
3 /* Ensure there is no explicit -mno-vsx etc., otherwise
4 the below bif __builtin_vec_vcmpeq_p replies on power8
6 /* { dg-require-effective-target powerpc_vsx } */
7 /* { dg-options "-mdejagnu-cpu=power6 -maltivec -O2" } */
11 #pragma GCC target ("cpu=power6,altivec")
14 test1 (vector
int a
, vector
int b
)
16 return vec_add (a
, b
);
19 #error failed power6 pragma target
22 #pragma GCC target ("cpu=power7")
23 /* Force a re-read of altivec.h with new cpu target. */
25 #undef _RS6000_VECDEFINES_H
29 test2 (vector
signed int a
, vector
signed int b
)
31 return vec_sldw (a
, b
, 3);
34 #error failed to set power7 pragma target
37 #pragma GCC target ("cpu=power8")
38 /* Force a re-read of altivec.h with new cpu target. */
40 #undef _RS6000_VECDEFINES_H
44 test3 (vector
int a
, vector
int b
)
46 return vec_mergee (a
, b
);
48 typedef __attribute__((altivec(vector__
))) long vec_t
;
50 test3b (vec_t a
, vec_t b
)
52 return __builtin_vec_vcmpeq_p (2, a
, b
);
55 #error failed to set power8 pragma target.