1 /* { dg-do compile { target { le } } } */
2 /* { dg-require-effective-target powerpc_p9vector_ok } */
3 /* { dg-options "-mcpu=power9 -O1" } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
9 test_ne_char (vector
bool char x
, vector
bool char y
)
11 return vec_cmpne (x
, y
);
15 test_ne_short (vector
bool short x
, vector
bool short y
)
17 return vec_cmpne (x
, y
);
21 test_ne_int (vector
bool int x
, vector
bool int y
)
23 return vec_cmpne (x
, y
);
27 test_ne_long (vector
bool long long x
, vector
bool long long y
)
29 return vec_cmpne (x
, y
);
33 test_nabs_long_long (vector
long long x
)
39 test_neg_long_long (vector
long long x
)
44 vector
unsigned long long
45 test_vull_bperm_vull_vuc (vector
unsigned long long x
,
46 vector
unsigned char y
)
48 return vec_bperm (x
, y
);
52 test_nabs_char (vector
signed char x
)
58 test_nabs_short (vector
short x
)
64 test_nabs_int (vector
int x
)
71 test_neg_char (vector
signed char x
)
77 test_neg_short (vector
short x
)
83 test_neg_int (vector
int x
)
88 /* Expected test results:
90 test_ne_char 1 vcmpneb
91 test_ne_short 1 vcmpneh
93 test_ne_long 1 vcmpequd, 1 xxlnor inst
94 test_neg_long_long 1 vnegd
95 test_vull_bperm_vull_vuc 1 vbpermd
96 test_nabs_long_long (-O0) 1 xxspltib, 1 vsubudm, 1 vminsd
97 test_nabs_long_long (-O1) 1 vnegd, vminsd
98 test_nabs_char (P9) 1 xxspltib, 1 vsububm, 1 vminsb
99 test_nabs_short (P9) 1 xxspltib, 1 vsubuhm, 1 vminsh
100 test_nabs_int (P9) 1 vnegw, 1 vminsw
101 test_neg_char (P9) 1 xxspltib, 1 vsububm
102 test_neg_short (P9) 1 xxspltib, 1 vsubuhm
103 test_neg_int (P9) 1 vnegw
106 /* { dg-final { scan-assembler-times "vcmpneb" 1 } } */
107 /* { dg-final { scan-assembler-times "vcmpneh" 1 } } */
108 /* { dg-final { scan-assembler-times "vcmpnew" 1 } } */
109 /* { dg-final { scan-assembler-times "vcmpequd" 1 } } */
110 /* { dg-final { scan-assembler-times "xxlnor" 1 } } */
111 /* { dg-final { scan-assembler-times "xxspltib" 4 } } */
112 /* { dg-final { scan-assembler-times "vsubudm" 0 } } */
113 /* { dg-final { scan-assembler-times "vsububm" 2 } } */
114 /* { dg-final { scan-assembler-times "vsubuhm" 2 } } */
115 /* { dg-final { scan-assembler-times "vsubuwm" 0 } } */
116 /* { dg-final { scan-assembler-times "vminsb" 1 } } */
117 /* { dg-final { scan-assembler-times "vminsh" 1 } } */
118 /* { dg-final { scan-assembler-times "vminsw" 1 } } */
119 /* { dg-final { scan-assembler-times "vminsd" 1 } } */
120 /* { dg-final { scan-assembler-times "vnegd" 2 } } */
121 /* { dg-final { scan-assembler-times "vnegw" 2 } } */
122 /* { dg-final { scan-assembler-times "vbpermd" 1 } } */