1 /* { dg-do compile } */
2 /* { dg-options "-mdejagnu-cpu=power9 -mvsx -O1" } */
3 /* { dg-require-effective-target powerpc_vsx } */
8 test_ne_char (vector
bool char x
, vector
bool char y
)
10 return vec_cmpne (x
, y
);
14 test_ne_short (vector
bool short x
, vector
bool short y
)
16 return vec_cmpne (x
, y
);
20 test_ne_int (vector
bool int x
, vector
bool int y
)
22 return vec_cmpne (x
, y
);
26 test_ne_long (vector
bool long long x
, vector
bool long long y
)
28 return vec_cmpne (x
, y
);
32 test_nabs_long_long (vector
long long x
)
38 test_neg_long_long (vector
long long x
)
43 vector
unsigned long long
44 test_vull_bperm_vull_vuc (vector
unsigned long long x
,
45 vector
unsigned char y
)
47 return vec_bperm (x
, y
);
51 test_nabs_char (vector
signed char x
)
57 test_nabs_short (vector
short x
)
63 test_nabs_int (vector
int x
)
70 test_neg_char (vector
signed char x
)
76 test_neg_short (vector
short x
)
82 test_neg_int (vector
int x
)
87 /* Expected test results:
89 test_ne_char 1 vcmpneb
90 test_ne_short 1 vcmpneh
92 test_ne_long 1 vcmpequd, 1 xxlnor inst
93 test_neg_long_long 1 vnegd
94 test_vull_bperm_vull_vuc 1 vbpermd
95 test_nabs_long_long (-O0) 1 xxspltib, 1 vsubudm, 1 vminsd
96 test_nabs_long_long (-O1) 1 vnegd, vminsd
97 test_nabs_char (P9) 1 xxspltib, 1 vsububm, 1 vminsb
98 test_nabs_short (P9) 1 xxspltib, 1 vsubuhm, 1 vminsh
99 test_nabs_int (P9) 1 vnegw, 1 vminsw
100 test_neg_char (P9) 1 xxspltib, 1 vsububm
101 test_neg_short (P9) 1 xxspltib, 1 vsubuhm
102 test_neg_int (P9) 1 vnegw
105 /* { dg-final { scan-assembler-times "vcmpneb" 1 } } */
106 /* { dg-final { scan-assembler-times "vcmpneh" 1 } } */
107 /* { dg-final { scan-assembler-times "vcmpnew" 1 } } */
108 /* { dg-final { scan-assembler-times "vcmpequd" 1 } } */
109 /* { dg-final { scan-assembler-times "xxlnor" 1 } } */
110 /* { dg-final { scan-assembler-times "xxspltib" 4 } } */
111 /* { dg-final { scan-assembler-times "vsubudm" 0 } } */
112 /* { dg-final { scan-assembler-times "vsububm" 2 } } */
113 /* { dg-final { scan-assembler-times "vsubuhm" 2 } } */
114 /* { dg-final { scan-assembler-times "vsubuwm" 0 } } */
115 /* { dg-final { scan-assembler-times "vminsb" 1 } } */
116 /* { dg-final { scan-assembler-times "vminsh" 1 } } */
117 /* { dg-final { scan-assembler-times "vminsw" 1 } } */
118 /* { dg-final { scan-assembler-times "vminsd" 1 } } */
119 /* { dg-final { scan-assembler-times "vnegd" 2 } } */
120 /* { dg-final { scan-assembler-times "vnegw" 2 } } */
121 /* { dg-final { scan-assembler-times "vbpermd" 1 } } */