Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/fold-vec-cmp-short.h

raw
1 /* Verify that overloaded built-ins for vec_cmp with short
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 short
12 test3_eq (vector signed short x, vector signed short y)
13 {
14 return vec_cmpeq (x, y);
15 }
16
17 vector bool short
18 test6_eq (vector unsigned short x, vector unsigned short y)
19 {
20 return vec_cmpeq (x, y);
21 }
22
23 vector bool short
24 test3_ge (vector signed short x, vector signed short y)
25 {
26 return vec_cmpge (x, y);
27 }
28
29 vector bool short
30 test6_ge (vector unsigned short x, vector unsigned short y)
31 {
32 return vec_cmpge (x, y);
33 }
34
35 vector bool short
36 test3_gt (vector signed short x, vector signed short y)
37 {
38 return vec_cmpgt (x, y);
39 }
40
41 vector bool short
42 test6_gt (vector unsigned short x, vector unsigned short y)
43 {
44 return vec_cmpgt (x, y);
45 }
46
47
48 vector bool short
49 test3_le (vector signed short x, vector signed short y)
50 {
51 return vec_cmple (x, y);
52 }
53
54 vector bool short
55 test6_le (vector unsigned short x, vector unsigned short y)
56 {
57 return vec_cmple (x, y);
58 }
59
60 vector bool short
61 test3_lt (vector signed short x, vector signed short y)
62 {
63 return vec_cmplt (x, y);
64 }
65
66 vector bool short
67 test6_lt (vector unsigned short x, vector unsigned short y)
68 {
69 return vec_cmplt (x, y);
70 }
71
72 vector bool short
73 test3_ne (vector signed short x, vector signed short y)
74 {
75 return vec_cmpne (x, y);
76 }
77
78 vector bool short
79 test6_ne (vector unsigned short x, vector unsigned short y)
80 {
81 return vec_cmpne (x, y);
82 }
83