3 /* { dg-do compile } */
4 /* { dg-require-effective-target powerpc_altivec_ok } */
7 test_eq_char (vector
bool char x
, vector
bool char y
)
9 return vec_cmpeq (x
, y
);
13 test_eq_short (vector
bool short x
, vector
bool short y
)
15 return vec_cmpeq (x
, y
);
19 test_eq_int (vector
bool int x
, vector
bool int y
)
21 return vec_cmpeq (x
, y
);
25 test_eq_long (vector
bool long x
, vector
bool long y
)
27 return vec_cmpeq (x
, y
);
31 test_ne_char (vector
bool char x
, vector
bool char y
)
33 return vec_cmpne (x
, y
);
37 test_ne_short (vector
bool short x
, vector
bool short y
)
39 return vec_cmpne (x
, y
);
43 test_ne_int (vector
bool int x
, vector
bool int y
)
45 return vec_cmpne (x
, y
);
49 test_ne_long (vector
bool long x
, vector
bool long y
)
51 return vec_cmpne (x
, y
);
54 /* Note: vec_cmpne is implemented as vcmpeq and then NOT'ed
55 using the xxlnor instruction.
57 Expected test results:
58 test_eq_char 1 vcmpeq inst
59 test_eq_short 1 vcmpeq inst
60 test_eq_int 1 vcmpeq inst
61 test_eq_long 1 vcmpeq inst
62 test_ne_char 1 vcmpeq, 1 xxlnor inst
63 test_ne_short 1 vcmpeq, 1 xxlnor inst
64 test_ne_int 1 vcmpeq, 1 xxlnor inst
65 test_ne_long 1 vcmpeq, 1 xxlnor inst */
67 /* { dg-final { scan-assembler-times "vcmpeq" 8 } } */
68 /* { dg-final { scan-assembler-times "xxlnor" 4 } } */