1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-options "-mdejagnu-cpu=power8 -mvsx -O2 -ftree-vectorize -fvect-cost-model=dynamic -fno-unroll-loops -fno-unroll-all-loops" } */
17 #define ATTR_ALIGN __attribute__((__aligned__(ALIGN)))
20 #define DOIT(TYPE, PREFIX) \
21 TYPE PREFIX ## _eqv_builtin (TYPE a, TYPE b) \
23 return vec_eqv (a, b); \
26 TYPE PREFIX ## _eqv_arith (TYPE a, TYPE b) \
31 TYPE PREFIX ## _nand_builtin (TYPE a, TYPE b) \
33 return vec_nand (a, b); \
36 TYPE PREFIX ## _nand_arith1 (TYPE a, TYPE b) \
41 TYPE PREFIX ## _nand_arith2 (TYPE a, TYPE b) \
46 TYPE PREFIX ## _orc_builtin (TYPE a, TYPE b) \
48 return vec_orc (a, b); \
51 TYPE PREFIX ## _orc_arith1 (TYPE a, TYPE b) \
56 TYPE PREFIX ## _orc_arith2 (TYPE a, TYPE b) \
61 #define DOIT_FLOAT(TYPE, PREFIX) \
62 TYPE PREFIX ## _eqv_builtin (TYPE a, TYPE b) \
64 return vec_eqv (a, b); \
67 TYPE PREFIX ## _nand_builtin (TYPE a, TYPE b) \
69 return vec_nand (a, b); \
72 TYPE PREFIX ## _orc_builtin (TYPE a, TYPE b) \
74 return vec_orc (a, b); \
77 typedef vector
signed char sign_char_vec
;
78 typedef vector
short sign_short_vec
;
79 typedef vector
int sign_int_vec
;
80 typedef vector
long long sign_llong_vec
;
82 typedef vector
unsigned char uns_char_vec
;
83 typedef vector
unsigned short uns_short_vec
;
84 typedef vector
unsigned int uns_int_vec
;
85 typedef vector
unsigned long long uns_llong_vec
;
87 typedef vector
float float_vec
;
88 typedef vector
double double_vec
;
90 DOIT(sign_char_vec
, sign_char
)
91 DOIT(sign_short_vec
, sign_short
)
92 DOIT(sign_int_vec
, sign_int
)
93 DOIT(sign_llong_vec
, sign_llong
)
95 DOIT(uns_char_vec
, uns_char
)
96 DOIT(uns_short_vec
, uns_short
)
97 DOIT(uns_int_vec
, uns_int
)
98 DOIT(uns_llong_vec
, uns_llong
)
100 DOIT_FLOAT(float_vec
, float)
101 DOIT_FLOAT(double_vec
, double)
103 /* { dg-final { scan-assembler-times "xxleqv" 18 } } */
104 /* { dg-final { scan-assembler-times "xxlnand" 26 } } */
105 /* { dg-final { scan-assembler-times "xxlorc" 26 } } */