1 ; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
3 define i64 @selectcceq(i64, i64, i64, i64) {
4 ; CHECK-LABEL: selectcceq:
6 ; CHECK-NEXT: cmpu.l %s0, 12, %s0
7 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
8 ; CHECK-NEXT: or %s0, 0, %s3
9 ; CHECK-NEXT: b.l.t (, %s10)
10 %5 = icmp eq i64 %0, 12
11 %6 = select i1 %5, i64 %2, i64 %3
15 define i64 @selectccne(i64, i64, i64, i64) {
16 ; CHECK-LABEL: selectccne:
18 ; CHECK-NEXT: cmpu.l %s0, 12, %s0
19 ; CHECK-NEXT: cmov.l.ne %s3, %s2, %s0
20 ; CHECK-NEXT: or %s0, 0, %s3
21 ; CHECK-NEXT: b.l.t (, %s10)
22 %5 = icmp ne i64 %0, 12
23 %6 = select i1 %5, i64 %2, i64 %3
27 define i64 @selectccsgt(i64, i64, i64, i64) {
28 ; CHECK-LABEL: selectccsgt:
30 ; CHECK-NEXT: cmps.l %s0, 12, %s0
31 ; CHECK-NEXT: cmov.l.lt %s3, %s2, %s0
32 ; CHECK-NEXT: or %s0, 0, %s3
33 ; CHECK-NEXT: b.l.t (, %s10)
34 %5 = icmp sgt i64 %0, 12
35 %6 = select i1 %5, i64 %2, i64 %3
39 define i64 @selectccsge(i64, i64, i64, i64) {
40 ; CHECK-LABEL: selectccsge:
42 ; CHECK-NEXT: cmps.l %s0, 11, %s0
43 ; CHECK-NEXT: cmov.l.lt %s3, %s2, %s0
44 ; CHECK-NEXT: or %s0, 0, %s3
45 ; CHECK-NEXT: b.l.t (, %s10)
46 %5 = icmp sge i64 %0, 12
47 %6 = select i1 %5, i64 %2, i64 %3
51 define i64 @selectccslt(i64, i64, i64, i64) {
52 ; CHECK-LABEL: selectccslt:
54 ; CHECK-NEXT: cmps.l %s0, 12, %s0
55 ; CHECK-NEXT: cmov.l.gt %s3, %s2, %s0
56 ; CHECK-NEXT: or %s0, 0, %s3
57 ; CHECK-NEXT: b.l.t (, %s10)
58 %5 = icmp slt i64 %0, 12
59 %6 = select i1 %5, i64 %2, i64 %3
63 define i64 @selectccsle(i64, i64, i64, i64) {
64 ; CHECK-LABEL: selectccsle:
66 ; CHECK-NEXT: cmps.l %s0, 13, %s0
67 ; CHECK-NEXT: cmov.l.gt %s3, %s2, %s0
68 ; CHECK-NEXT: or %s0, 0, %s3
69 ; CHECK-NEXT: b.l.t (, %s10)
70 %5 = icmp sle i64 %0, 12
71 %6 = select i1 %5, i64 %2, i64 %3
75 define i64 @selectccugt(i64, i64, i64, i64) {
76 ; CHECK-LABEL: selectccugt:
78 ; CHECK-NEXT: cmpu.l %s0, 12, %s0
79 ; CHECK-NEXT: cmov.l.lt %s3, %s2, %s0
80 ; CHECK-NEXT: or %s0, 0, %s3
81 ; CHECK-NEXT: b.l.t (, %s10)
82 %5 = icmp ugt i64 %0, 12
83 %6 = select i1 %5, i64 %2, i64 %3
87 define i64 @selectccuge(i64, i64, i64, i64) {
88 ; CHECK-LABEL: selectccuge:
90 ; CHECK-NEXT: cmpu.l %s0, 11, %s0
91 ; CHECK-NEXT: cmov.l.lt %s3, %s2, %s0
92 ; CHECK-NEXT: or %s0, 0, %s3
93 ; CHECK-NEXT: b.l.t (, %s10)
94 %5 = icmp uge i64 %0, 12
95 %6 = select i1 %5, i64 %2, i64 %3
99 define i64 @selectccult(i64, i64, i64, i64) {
100 ; CHECK-LABEL: selectccult:
102 ; CHECK-NEXT: cmpu.l %s0, 12, %s0
103 ; CHECK-NEXT: cmov.l.gt %s3, %s2, %s0
104 ; CHECK-NEXT: or %s0, 0, %s3
105 ; CHECK-NEXT: b.l.t (, %s10)
106 %5 = icmp ult i64 %0, 12
107 %6 = select i1 %5, i64 %2, i64 %3
111 define i64 @selectccule(i64, i64, i64, i64) {
112 ; CHECK-LABEL: selectccule:
114 ; CHECK-NEXT: cmpu.l %s0, 13, %s0
115 ; CHECK-NEXT: cmov.l.gt %s3, %s2, %s0
116 ; CHECK-NEXT: or %s0, 0, %s3
117 ; CHECK-NEXT: b.l.t (, %s10)
118 %5 = icmp ule i64 %0, 12
119 %6 = select i1 %5, i64 %2, i64 %3
123 define i64 @selectccugt2(i64, i64, i64, i64) {
124 ; CHECK-LABEL: selectccugt2:
126 ; CHECK-NEXT: cmpu.l %s0, 12, %s0
127 ; CHECK-NEXT: cmov.l.lt %s3, %s2, %s0
128 ; CHECK-NEXT: or %s0, 0, %s3
129 ; CHECK-NEXT: b.l.t (, %s10)
130 %5 = icmp ugt i64 %0, 12
131 %6 = select i1 %5, i64 %2, i64 %3
135 define i64 @selectccuge2(i64, i64, i64, i64) {
136 ; CHECK-LABEL: selectccuge2:
138 ; CHECK-NEXT: cmpu.l %s0, 11, %s0
139 ; CHECK-NEXT: cmov.l.lt %s3, %s2, %s0
140 ; CHECK-NEXT: or %s0, 0, %s3
141 ; CHECK-NEXT: b.l.t (, %s10)
142 %5 = icmp uge i64 %0, 12
143 %6 = select i1 %5, i64 %2, i64 %3
147 define i64 @selectccult2(i64, i64, i64, i64) {
148 ; CHECK-LABEL: selectccult2:
150 ; CHECK-NEXT: cmpu.l %s0, 12, %s0
151 ; CHECK-NEXT: cmov.l.gt %s3, %s2, %s0
152 ; CHECK-NEXT: or %s0, 0, %s3
153 ; CHECK-NEXT: b.l.t (, %s10)
154 %5 = icmp ult i64 %0, 12
155 %6 = select i1 %5, i64 %2, i64 %3
159 define i64 @selectccule2(i64, i64, i64, i64) {
160 ; CHECK-LABEL: selectccule2:
162 ; CHECK-NEXT: cmpu.l %s0, 13, %s0
163 ; CHECK-NEXT: cmov.l.gt %s3, %s2, %s0
164 ; CHECK-NEXT: or %s0, 0, %s3
165 ; CHECK-NEXT: b.l.t (, %s10)
166 %5 = icmp ule i64 %0, 12
167 %6 = select i1 %5, i64 %2, i64 %3