1; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
2
3define i64 @selectcceq(i64, i64, i64, i64) {
4; CHECK-LABEL: selectcceq:
5; CHECK:       # %bb.0:
6; CHECK-NEXT:    or %s1, 12, (0)1
7; CHECK-NEXT:    cmps.l %s0, %s0, %s1
8; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
9; CHECK-NEXT:    or %s0, 0, %s3
10; CHECK-NEXT:    b.l.t (, %s10)
11  %5 = icmp eq i64 %0, 12
12  %6 = select i1 %5, i64 %2, i64 %3
13  ret i64 %6
14}
15
16define i64 @selectccne(i64, i64, i64, i64) {
17; CHECK-LABEL: selectccne:
18; CHECK:       # %bb.0:
19; CHECK-NEXT:    or %s1, 12, (0)1
20; CHECK-NEXT:    cmps.l %s0, %s0, %s1
21; CHECK-NEXT:    cmov.l.ne %s3, %s2, %s0
22; CHECK-NEXT:    or %s0, 0, %s3
23; CHECK-NEXT:    b.l.t (, %s10)
24  %5 = icmp ne i64 %0, 12
25  %6 = select i1 %5, i64 %2, i64 %3
26  ret i64 %6
27}
28
29define i64 @selectccsgt(i64, i64, i64, i64) {
30; CHECK-LABEL: selectccsgt:
31; CHECK:       # %bb.0:
32; CHECK-NEXT:    or %s1, 12, (0)1
33; CHECK-NEXT:    cmps.l %s0, %s0, %s1
34; CHECK-NEXT:    cmov.l.gt %s3, %s2, %s0
35; CHECK-NEXT:    or %s0, 0, %s3
36; CHECK-NEXT:    b.l.t (, %s10)
37  %5 = icmp sgt i64 %0, 12
38  %6 = select i1 %5, i64 %2, i64 %3
39  ret i64 %6
40}
41
42define i64 @selectccsge(i64, i64, i64, i64) {
43; CHECK-LABEL: selectccsge:
44; CHECK:       # %bb.0:
45; CHECK-NEXT:    or %s1, 11, (0)1
46; CHECK-NEXT:    cmps.l %s0, %s0, %s1
47; CHECK-NEXT:    cmov.l.gt %s3, %s2, %s0
48; CHECK-NEXT:    or %s0, 0, %s3
49; CHECK-NEXT:    b.l.t (, %s10)
50  %5 = icmp sge i64 %0, 12
51  %6 = select i1 %5, i64 %2, i64 %3
52  ret i64 %6
53}
54
55define i64 @selectccslt(i64, i64, i64, i64) {
56; CHECK-LABEL: selectccslt:
57; CHECK:       # %bb.0:
58; CHECK-NEXT:    or %s1, 12, (0)1
59; CHECK-NEXT:    cmps.l %s0, %s0, %s1
60; CHECK-NEXT:    cmov.l.lt %s3, %s2, %s0
61; CHECK-NEXT:    or %s0, 0, %s3
62; CHECK-NEXT:    b.l.t (, %s10)
63  %5 = icmp slt i64 %0, 12
64  %6 = select i1 %5, i64 %2, i64 %3
65  ret i64 %6
66}
67
68define i64 @selectccsle(i64, i64, i64, i64) {
69; CHECK-LABEL: selectccsle:
70; CHECK:       # %bb.0:
71; CHECK-NEXT:    or %s1, 13, (0)1
72; CHECK-NEXT:    cmps.l %s0, %s0, %s1
73; CHECK-NEXT:    cmov.l.lt %s3, %s2, %s0
74; CHECK-NEXT:    or %s0, 0, %s3
75; CHECK-NEXT:    b.l.t (, %s10)
76  %5 = icmp sle i64 %0, 12
77  %6 = select i1 %5, i64 %2, i64 %3
78  ret i64 %6
79}
80
81define i64 @selectccugt(i64, i64, i64, i64) {
82; CHECK-LABEL: selectccugt:
83; CHECK:       # %bb.0:
84; CHECK-NEXT:    or %s1, 12, (0)1
85; CHECK-NEXT:    cmpu.l %s0, %s0, %s1
86; CHECK-NEXT:    cmov.l.gt %s3, %s2, %s0
87; CHECK-NEXT:    or %s0, 0, %s3
88; CHECK-NEXT:    b.l.t (, %s10)
89  %5 = icmp ugt i64 %0, 12
90  %6 = select i1 %5, i64 %2, i64 %3
91  ret i64 %6
92}
93
94define i64 @selectccuge(i64, i64, i64, i64) {
95; CHECK-LABEL: selectccuge:
96; CHECK:       # %bb.0:
97; CHECK-NEXT:    or %s1, 11, (0)1
98; CHECK-NEXT:    cmpu.l %s0, %s0, %s1
99; CHECK-NEXT:    cmov.l.gt %s3, %s2, %s0
100; CHECK-NEXT:    or %s0, 0, %s3
101; CHECK-NEXT:    b.l.t (, %s10)
102  %5 = icmp uge i64 %0, 12
103  %6 = select i1 %5, i64 %2, i64 %3
104  ret i64 %6
105}
106
107define i64 @selectccult(i64, i64, i64, i64) {
108; CHECK-LABEL: selectccult:
109; CHECK:       # %bb.0:
110; CHECK-NEXT:    or %s1, 12, (0)1
111; CHECK-NEXT:    cmpu.l %s0, %s0, %s1
112; CHECK-NEXT:    cmov.l.lt %s3, %s2, %s0
113; CHECK-NEXT:    or %s0, 0, %s3
114; CHECK-NEXT:    b.l.t (, %s10)
115  %5 = icmp ult i64 %0, 12
116  %6 = select i1 %5, i64 %2, i64 %3
117  ret i64 %6
118}
119
120define i64 @selectccule(i64, i64, i64, i64) {
121; CHECK-LABEL: selectccule:
122; CHECK:       # %bb.0:
123; CHECK-NEXT:    or %s1, 13, (0)1
124; CHECK-NEXT:    cmpu.l %s0, %s0, %s1
125; CHECK-NEXT:    cmov.l.lt %s3, %s2, %s0
126; CHECK-NEXT:    or %s0, 0, %s3
127; CHECK-NEXT:    b.l.t (, %s10)
128  %5 = icmp ule i64 %0, 12
129  %6 = select i1 %5, i64 %2, i64 %3
130  ret i64 %6
131}
132
133define i64 @selectccugt2(i64, i64, i64, i64) {
134; CHECK-LABEL: selectccugt2:
135; CHECK:       # %bb.0:
136; CHECK-NEXT:    or %s1, 12, (0)1
137; CHECK-NEXT:    cmpu.l %s0, %s0, %s1
138; CHECK-NEXT:    cmov.l.gt %s3, %s2, %s0
139; CHECK-NEXT:    or %s0, 0, %s3
140; CHECK-NEXT:    b.l.t (, %s10)
141  %5 = icmp ugt i64 %0, 12
142  %6 = select i1 %5, i64 %2, i64 %3
143  ret i64 %6
144}
145
146define i64 @selectccuge2(i64, i64, i64, i64) {
147; CHECK-LABEL: selectccuge2:
148; CHECK:       # %bb.0:
149; CHECK-NEXT:    or %s1, 11, (0)1
150; CHECK-NEXT:    cmpu.l %s0, %s0, %s1
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 uge i64 %0, 12
155  %6 = select i1 %5, i64 %2, i64 %3
156  ret i64 %6
157}
158
159define i64 @selectccult2(i64, i64, i64, i64) {
160; CHECK-LABEL: selectccult2:
161; CHECK:       # %bb.0:
162; CHECK-NEXT:    or %s1, 12, (0)1
163; CHECK-NEXT:    cmpu.l %s0, %s0, %s1
164; CHECK-NEXT:    cmov.l.lt %s3, %s2, %s0
165; CHECK-NEXT:    or %s0, 0, %s3
166; CHECK-NEXT:    b.l.t (, %s10)
167  %5 = icmp ult i64 %0, 12
168  %6 = select i1 %5, i64 %2, i64 %3
169  ret i64 %6
170}
171
172define i64 @selectccule2(i64, i64, i64, i64) {
173; CHECK-LABEL: selectccule2:
174; CHECK:       # %bb.0:
175; CHECK-NEXT:    or %s1, 13, (0)1
176; CHECK-NEXT:    cmpu.l %s0, %s0, %s1
177; CHECK-NEXT:    cmov.l.lt %s3, %s2, %s0
178; CHECK-NEXT:    or %s0, 0, %s3
179; CHECK-NEXT:    b.l.t (, %s10)
180  %5 = icmp ule i64 %0, 12
181  %6 = select i1 %5, i64 %2, i64 %3
182  ret i64 %6
183}
184