1 ; RUN: llc < %s -mtriple=ve | FileCheck %s
3 ;;; Test all combination of input type and output type among following types.
6 ;;; i1/i8/u8/i16/u16/i32/u32/i64/u64/i128/u128/float/double/fp128
8 ; Function Attrs: norecurse nounwind readnone
9 define zeroext i1 @setcc_i1(i1 zeroext %0, i1 zeroext %1) {
10 ; CHECK-LABEL: setcc_i1:
12 ; CHECK-NEXT: xor %s0, %s0, %s1
13 ; CHECK-NEXT: xor %s0, 1, %s0
14 ; CHECK-NEXT: b.l.t (, %s10)
20 ; Function Attrs: norecurse nounwind readnone
21 define zeroext i1 @setcc_i8(i8 signext %0, i8 signext %1) {
22 ; CHECK-LABEL: setcc_i8:
24 ; CHECK-NEXT: cmps.w.sx %s0, %s0, %s1
25 ; CHECK-NEXT: or %s1, 0, (0)1
26 ; CHECK-NEXT: cmov.w.eq %s1, (63)0, %s0
27 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
28 ; CHECK-NEXT: b.l.t (, %s10)
29 %3 = icmp eq i8 %0, %1
33 ; Function Attrs: norecurse nounwind readnone
34 define zeroext i1 @setcc_u8(i8 zeroext %0, i8 zeroext %1) {
35 ; CHECK-LABEL: setcc_u8:
37 ; CHECK-NEXT: cmps.w.sx %s0, %s0, %s1
38 ; CHECK-NEXT: or %s1, 0, (0)1
39 ; CHECK-NEXT: cmov.w.eq %s1, (63)0, %s0
40 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
41 ; CHECK-NEXT: b.l.t (, %s10)
42 %3 = icmp eq i8 %0, %1
46 ; Function Attrs: norecurse nounwind readnone
47 define zeroext i1 @setcc_i16(i16 signext %0, i16 signext %1) {
48 ; CHECK-LABEL: setcc_i16:
50 ; CHECK-NEXT: cmps.w.sx %s0, %s0, %s1
51 ; CHECK-NEXT: or %s1, 0, (0)1
52 ; CHECK-NEXT: cmov.w.eq %s1, (63)0, %s0
53 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
54 ; CHECK-NEXT: b.l.t (, %s10)
55 %3 = icmp eq i16 %0, %1
59 ; Function Attrs: norecurse nounwind readnone
60 define zeroext i1 @setcc_u16(i16 zeroext %0, i16 zeroext %1) {
61 ; CHECK-LABEL: setcc_u16:
63 ; CHECK-NEXT: cmps.w.sx %s0, %s0, %s1
64 ; CHECK-NEXT: or %s1, 0, (0)1
65 ; CHECK-NEXT: cmov.w.eq %s1, (63)0, %s0
66 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
67 ; CHECK-NEXT: b.l.t (, %s10)
68 %3 = icmp eq i16 %0, %1
72 ; Function Attrs: norecurse nounwind readnone
73 define zeroext i1 @setcc_i32(i32 signext %0, i32 signext %1) {
74 ; CHECK-LABEL: setcc_i32:
76 ; CHECK-NEXT: cmps.w.sx %s0, %s0, %s1
77 ; CHECK-NEXT: or %s1, 0, (0)1
78 ; CHECK-NEXT: cmov.w.eq %s1, (63)0, %s0
79 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
80 ; CHECK-NEXT: b.l.t (, %s10)
81 %3 = icmp eq i32 %0, %1
85 ; Function Attrs: norecurse nounwind readnone
86 define zeroext i1 @setcc_u32(i32 zeroext %0, i32 zeroext %1) {
87 ; CHECK-LABEL: setcc_u32:
89 ; CHECK-NEXT: cmps.w.sx %s0, %s0, %s1
90 ; CHECK-NEXT: or %s1, 0, (0)1
91 ; CHECK-NEXT: cmov.w.eq %s1, (63)0, %s0
92 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
93 ; CHECK-NEXT: b.l.t (, %s10)
94 %3 = icmp eq i32 %0, %1
98 ; Function Attrs: norecurse nounwind readnone
99 define zeroext i1 @setcc_i64(i64 %0, i64 %1) {
100 ; CHECK-LABEL: setcc_i64:
102 ; CHECK-NEXT: cmps.l %s0, %s0, %s1
103 ; CHECK-NEXT: or %s1, 0, (0)1
104 ; CHECK-NEXT: cmov.l.eq %s1, (63)0, %s0
105 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
106 ; CHECK-NEXT: b.l.t (, %s10)
107 %3 = icmp eq i64 %0, %1
111 ; Function Attrs: norecurse nounwind readnone
112 define zeroext i1 @setcc_u64(i64 %0, i64 %1) {
113 ; CHECK-LABEL: setcc_u64:
115 ; CHECK-NEXT: cmps.l %s0, %s0, %s1
116 ; CHECK-NEXT: or %s1, 0, (0)1
117 ; CHECK-NEXT: cmov.l.eq %s1, (63)0, %s0
118 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
119 ; CHECK-NEXT: b.l.t (, %s10)
120 %3 = icmp eq i64 %0, %1
124 ; Function Attrs: norecurse nounwind readnone
125 define zeroext i1 @setcc_i128(i128 %0, i128 %1) {
126 ; CHECK-LABEL: setcc_i128:
128 ; CHECK-NEXT: xor %s1, %s1, %s3
129 ; CHECK-NEXT: xor %s0, %s0, %s2
130 ; CHECK-NEXT: or %s0, %s0, %s1
131 ; CHECK-NEXT: or %s1, 0, (0)1
132 ; CHECK-NEXT: cmps.l %s0, %s0, (0)1
133 ; CHECK-NEXT: cmov.l.eq %s1, (63)0, %s0
134 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
135 ; CHECK-NEXT: b.l.t (, %s10)
136 %3 = icmp eq i128 %0, %1
140 ; Function Attrs: norecurse nounwind readnone
141 define zeroext i1 @setcc_u128(i128 %0, i128 %1) {
142 ; CHECK-LABEL: setcc_u128:
144 ; CHECK-NEXT: xor %s1, %s1, %s3
145 ; CHECK-NEXT: xor %s0, %s0, %s2
146 ; CHECK-NEXT: or %s0, %s0, %s1
147 ; CHECK-NEXT: or %s1, 0, (0)1
148 ; CHECK-NEXT: cmps.l %s0, %s0, (0)1
149 ; CHECK-NEXT: cmov.l.eq %s1, (63)0, %s0
150 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
151 ; CHECK-NEXT: b.l.t (, %s10)
152 %3 = icmp eq i128 %0, %1
156 ; Function Attrs: norecurse nounwind readnone
157 define zeroext i1 @setcc_float(float %0, float %1) {
158 ; CHECK-LABEL: setcc_float:
160 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
161 ; CHECK-NEXT: or %s1, 0, (0)1
162 ; CHECK-NEXT: cmov.s.eq %s1, (63)0, %s0
163 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
164 ; CHECK-NEXT: b.l.t (, %s10)
165 %3 = fcmp fast oeq float %0, %1
169 ; Function Attrs: norecurse nounwind readnone
170 define zeroext i1 @setcc_double(double %0, double %1) {
171 ; CHECK-LABEL: setcc_double:
173 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
174 ; CHECK-NEXT: or %s1, 0, (0)1
175 ; CHECK-NEXT: cmov.d.eq %s1, (63)0, %s0
176 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
177 ; CHECK-NEXT: b.l.t (, %s10)
178 %3 = fcmp fast oeq double %0, %1
182 ; Function Attrs: norecurse nounwind readnone
183 define zeroext i1 @setcc_quad(fp128 %0, fp128 %1) {
184 ; CHECK-LABEL: setcc_quad:
186 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
187 ; CHECK-NEXT: or %s1, 0, (0)1
188 ; CHECK-NEXT: cmov.d.eq %s1, (63)0, %s0
189 ; CHECK-NEXT: adds.w.zx %s0, %s1, (0)1
190 ; CHECK-NEXT: b.l.t (, %s10)
191 %3 = fcmp fast oeq fp128 %0, %1