gcc/ChangeLog:
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / builtins-3.c
blob8d4b63d806da881cc669186e6f3a651bcde5aa60
1 #include <altivec.h>
3 /* { dg-do compile } */
4 /* { dg-require-effective-target powerpc_altivec_ok } */
6 vector bool char
7 test_eq_char (vector bool char x, vector bool char y)
9 return vec_cmpeq (x, y);
12 vector bool short
13 test_eq_short (vector bool short x, vector bool short y)
15 return vec_cmpeq (x, y);
18 vector bool int
19 test_eq_int (vector bool int x, vector bool int y)
21 return vec_cmpeq (x, y);
24 vector bool long
25 test_eq_long (vector bool long x, vector bool long y)
27 return vec_cmpeq (x, y);
30 vector bool char
31 test_ne_char (vector bool char x, vector bool char y)
33 return vec_cmpne (x, y);
36 vector bool short
37 test_ne_short (vector bool short x, vector bool short y)
39 return vec_cmpne (x, y);
42 vector bool int
43 test_ne_int (vector bool int x, vector bool int y)
45 return vec_cmpne (x, y);
48 vector bool long
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 } } */