Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/fold-vec-cmp-longlong.c

raw
1 /* Verify that overloaded built-ins for vec_cmp with long long
2 inputs produce the right code. */
3
4 /* { dg-do compile } */
5 /* { dg-options "-mvsx -O2" } */
6 /* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */
7 /* { dg-require-effective-target powerpc_vsx } */
8
9 #include <altivec.h>
10
11 vector bool long long
12 test3_eq (vector signed long long x, vector signed long long y)
13 {
14 return vec_cmpeq (x, y);
15 }
16
17 vector bool long long
18 test6_eq (vector unsigned long long x, vector unsigned long long y)
19 {
20 return vec_cmpeq (x, y);
21 }
22
23 vector bool long long
24 test3_ge (vector signed long long x, vector signed long long y)
25 {
26 return vec_cmpge (x, y);
27 }
28
29 vector bool long long
30 test6_ge (vector unsigned long long x, vector unsigned long long y)
31 {
32 return vec_cmpge (x, y);
33 }
34
35 vector bool long long
36 test3_gt (vector signed long long x, vector signed long long y)
37 {
38 return vec_cmpgt (x, y);
39 }
40
41 vector bool long long
42 test6_gt (vector unsigned long long x, vector unsigned long long y)
43 {
44 return vec_cmpgt (x, y);
45 }
46
47 vector bool long long
48 test3_le (vector signed long long x, vector signed long long y)
49 {
50 return vec_cmple (x, y);
51 }
52
53 vector bool long long
54 test6_le (vector unsigned long long x, vector unsigned long long y)
55 {
56 return vec_cmple (x, y);
57 }
58
59 vector bool long long
60 test3_lt (vector signed long long x, vector signed long long y)
61 {
62 return vec_cmplt (x, y);
63 }
64
65 vector bool long long
66 test6_lt (vector unsigned long long x, vector unsigned long long y)
67 {
68 return vec_cmplt (x, y);
69 }
70
71 vector bool long long
72 test3_ne (vector signed long long x, vector signed long long y)
73 {
74 return vec_cmpne (x, y);
75 }
76
77 vector bool long long
78 test6_ne (vector unsigned long long x, vector unsigned long long y)
79 {
80 return vec_cmpne (x, y);
81 }
82
83 /* { dg-final { scan-assembler-times "vcmpequd" 4 } } */
84 /* { dg-final { scan-assembler-times "vcmpgtsd" 4 } } */
85 /* { dg-final { scan-assembler-times "vcmpgtud" 4 } } */
86 /* { dg-final { scan-assembler-times "xxlnor" 6 } } */
87