1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN:llc %s -verify-machineinstrs -mtriple=aarch64-unknown-unknown -run-pass=legalizer -global-isel-abort=1 -o - | FileCheck %s
7 tracksRegLiveness: true
15 ; CHECK-LABEL: name: smin_s32
16 ; CHECK: liveins: $w0, $w1
18 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
19 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
20 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY]](s32), [[COPY1]]
21 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
22 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]]
23 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]
24 ; CHECK-NEXT: $w0 = COPY [[SELECT]](s32)
25 ; CHECK-NEXT: RET_ReallyLR implicit $w0
28 %2:_(s32) = G_SMIN %0, %1
30 RET_ReallyLR implicit $w0
36 tracksRegLiveness: true
44 ; CHECK-LABEL: name: smin_s64
45 ; CHECK: liveins: $x0, $x1
47 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
48 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
49 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY]](s64), [[COPY1]]
50 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
51 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]]
52 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]
53 ; CHECK-NEXT: $x0 = COPY [[SELECT]](s64)
54 ; CHECK-NEXT: RET_ReallyLR implicit $x0
57 %2:_(s64) = G_SMIN %0, %1
59 RET_ReallyLR implicit $x0
65 tracksRegLiveness: true
73 ; CHECK-LABEL: name: smax_s32
74 ; CHECK: liveins: $w0, $w1
76 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
77 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
78 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[COPY]](s32), [[COPY1]]
79 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
80 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]]
81 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]
82 ; CHECK-NEXT: $w0 = COPY [[SELECT]](s32)
83 ; CHECK-NEXT: RET_ReallyLR implicit $w0
86 %2:_(s32) = G_SMAX %0, %1
88 RET_ReallyLR implicit $w0
94 tracksRegLiveness: true
102 ; CHECK-LABEL: name: smax_s64
103 ; CHECK: liveins: $x0, $x1
105 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
106 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
107 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[COPY]](s64), [[COPY1]]
108 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
109 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]]
110 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]
111 ; CHECK-NEXT: $x0 = COPY [[SELECT]](s64)
112 ; CHECK-NEXT: RET_ReallyLR implicit $x0
115 %2:_(s64) = G_SMAX %0, %1
117 RET_ReallyLR implicit $x0
125 tracksRegLiveness: true
133 ; CHECK-LABEL: name: umin_s32
134 ; CHECK: liveins: $w0, $w1
136 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
137 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
138 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY1]]
139 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
140 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]]
141 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]
142 ; CHECK-NEXT: $w0 = COPY [[SELECT]](s32)
143 ; CHECK-NEXT: RET_ReallyLR implicit $w0
146 %2:_(s32) = G_UMIN %0, %1
148 RET_ReallyLR implicit $w0
154 tracksRegLiveness: true
162 ; CHECK-LABEL: name: umin_s64
163 ; CHECK: liveins: $x0, $x1
165 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
166 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
167 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s64), [[COPY1]]
168 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
169 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]]
170 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]
171 ; CHECK-NEXT: $x0 = COPY [[SELECT]](s64)
172 ; CHECK-NEXT: RET_ReallyLR implicit $x0
175 %2:_(s64) = G_UMIN %0, %1
177 RET_ReallyLR implicit $x0
183 tracksRegLiveness: true
191 ; CHECK-LABEL: name: umax_s32
192 ; CHECK: liveins: $w0, $w1
194 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
195 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
196 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[COPY1]]
197 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
198 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]]
199 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]
200 ; CHECK-NEXT: $w0 = COPY [[SELECT]](s32)
201 ; CHECK-NEXT: RET_ReallyLR implicit $w0
204 %2:_(s32) = G_UMAX %0, %1
206 RET_ReallyLR implicit $w0
212 tracksRegLiveness: true
220 ; CHECK-LABEL: name: umax_s64
221 ; CHECK: liveins: $x0, $x1
223 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
224 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
225 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s64), [[COPY1]]
226 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
227 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]]
228 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s64) = G_SELECT [[AND]](s32), [[COPY]], [[COPY1]]
229 ; CHECK-NEXT: $x0 = COPY [[SELECT]](s64)
230 ; CHECK-NEXT: RET_ReallyLR implicit $x0
233 %2:_(s64) = G_UMAX %0, %1
235 RET_ReallyLR implicit $x0