1 /* { dg-do compile } */
2 /* { dg-options "-mdejagnu-cpu=power6 -maltivec -O2" } */
3 /* { dg-require-effective-target powerpc_altivec } */
4 /* { dg-require-effective-target lp64 } */
10 test1 (vector
int a
, vector
int b
)
12 return vec_add (a
, b
);
15 #error failed on default power6 pragma target
18 #pragma GCC target ("cpu=power7")
20 #undef _RS6000_VECDEFINES_H
24 test2 (vector
signed int a
, vector
signed int b
)
26 return vec_sldw (a
, b
, 3);
29 #error failed to set power7 pragma target
32 #pragma GCC target ("cpu=power8")
34 #undef _RS6000_VECDEFINES_H
38 test3 (vector
int a
, vector
int b
)
40 return vec_mergee (a
, b
);
43 typedef __attribute__((altivec(vector__
))) long vec_t
;
45 test3b (vec_t a
, vec_t b
)
47 return __builtin_vec_vcmpeq_p (2, a
, b
);
50 #error failed to set power8 pragma target.
53 #pragma GCC target ("cpu=power9,power9-vector")
55 #undef _RS6000_VECDEFINES_H
59 test4 (vector
signed int a
, vector
signed int b
)
61 return vec_cmpnez (a
, b
);
64 #error Failed to set cpu=power9 pragma target.