| 1 |
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py |
| 2 |
# RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - \ |
| 3 |
# RUN: | FileCheck %s --check-prefixes=CHECK,RV32I |
| 4 |
# RUN: llc -mtriple=riscv32 -mattr=+zbb -run-pass=legalizer %s -o - \ |
| 5 |
# RUN: | FileCheck %s --check-prefixes=CHECK,RV32ZBB |
| 6 |
|
| 7 |
--- |
| 8 |
name: abds_i8 |
| 9 |
body: | |
| 10 |
bb.0.entry: |
| 11 |
liveins: $x10, $x11 |
| 12 |
; RV32I-LABEL: name: abds_i8 |
| 13 |
; RV32I: liveins: $x10, $x11 |
| 14 |
; RV32I-NEXT: {{ $}} |
| 15 |
; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 16 |
; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 17 |
; RV32I-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s32) = G_ASSERT_SEXT [[COPY]], 8 |
| 18 |
; RV32I-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s32) = G_ASSERT_SEXT [[COPY1]], 8 |
| 19 |
; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[ASSERT_SEXT]], [[ASSERT_SEXT1]] |
| 20 |
; RV32I-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[ASSERT_SEXT1]], [[ASSERT_SEXT]] |
| 21 |
; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[ASSERT_SEXT]](s32), [[ASSERT_SEXT1]] |
| 22 |
; RV32I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[SUB]], [[SUB1]] |
| 23 |
; RV32I-NEXT: $x10 = COPY [[SELECT]](s32) |
| 24 |
; RV32I-NEXT: PseudoRET implicit $x10 |
| 25 |
; |
| 26 |
; RV32ZBB-LABEL: name: abds_i8 |
| 27 |
; RV32ZBB: liveins: $x10, $x11 |
| 28 |
; RV32ZBB-NEXT: {{ $}} |
| 29 |
; RV32ZBB-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 30 |
; RV32ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 31 |
; RV32ZBB-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s32) = G_ASSERT_SEXT [[COPY]], 8 |
| 32 |
; RV32ZBB-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s32) = G_ASSERT_SEXT [[COPY1]], 8 |
| 33 |
; RV32ZBB-NEXT: [[SMAX:%[0-9]+]]:_(s32) = G_SMAX [[ASSERT_SEXT]], [[ASSERT_SEXT1]] |
| 34 |
; RV32ZBB-NEXT: [[SMIN:%[0-9]+]]:_(s32) = G_SMIN [[ASSERT_SEXT]], [[ASSERT_SEXT1]] |
| 35 |
; RV32ZBB-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[SMAX]], [[SMIN]] |
| 36 |
; RV32ZBB-NEXT: $x10 = COPY [[SUB]](s32) |
| 37 |
; RV32ZBB-NEXT: PseudoRET implicit $x10 |
| 38 |
%1:_(s32) = COPY $x10 |
| 39 |
%2:_(s32) = COPY $x11 |
| 40 |
%3:_(s32) = G_ASSERT_SEXT %1, 8 |
| 41 |
%4:_(s32) = G_ASSERT_SEXT %2, 8 |
| 42 |
%5:_(s8) = G_TRUNC %3(s32) |
| 43 |
%6:_(s8) = G_TRUNC %4(s32) |
| 44 |
%7:_(s8) = G_ABDS %5, %6 |
| 45 |
%8:_(s32) = G_ANYEXT %7(s8) |
| 46 |
$x10 = COPY %8(s32) |
| 47 |
PseudoRET implicit $x10 |
| 48 |
... |
| 49 |
--- |
| 50 |
name: abds_i16 |
| 51 |
body: | |
| 52 |
bb.0.entry: |
| 53 |
liveins: $x10, $x11 |
| 54 |
; RV32I-LABEL: name: abds_i16 |
| 55 |
; RV32I: liveins: $x10, $x11 |
| 56 |
; RV32I-NEXT: {{ $}} |
| 57 |
; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 58 |
; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 59 |
; RV32I-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s32) = G_ASSERT_SEXT [[COPY]], 16 |
| 60 |
; RV32I-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s32) = G_ASSERT_SEXT [[COPY1]], 16 |
| 61 |
; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[ASSERT_SEXT]], [[ASSERT_SEXT1]] |
| 62 |
; RV32I-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[ASSERT_SEXT1]], [[ASSERT_SEXT]] |
| 63 |
; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[ASSERT_SEXT]](s32), [[ASSERT_SEXT1]] |
| 64 |
; RV32I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[SUB]], [[SUB1]] |
| 65 |
; RV32I-NEXT: $x10 = COPY [[SELECT]](s32) |
| 66 |
; RV32I-NEXT: PseudoRET implicit $x10 |
| 67 |
; |
| 68 |
; RV32ZBB-LABEL: name: abds_i16 |
| 69 |
; RV32ZBB: liveins: $x10, $x11 |
| 70 |
; RV32ZBB-NEXT: {{ $}} |
| 71 |
; RV32ZBB-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 72 |
; RV32ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 73 |
; RV32ZBB-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s32) = G_ASSERT_SEXT [[COPY]], 16 |
| 74 |
; RV32ZBB-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s32) = G_ASSERT_SEXT [[COPY1]], 16 |
| 75 |
; RV32ZBB-NEXT: [[SMAX:%[0-9]+]]:_(s32) = G_SMAX [[ASSERT_SEXT]], [[ASSERT_SEXT1]] |
| 76 |
; RV32ZBB-NEXT: [[SMIN:%[0-9]+]]:_(s32) = G_SMIN [[ASSERT_SEXT]], [[ASSERT_SEXT1]] |
| 77 |
; RV32ZBB-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[SMAX]], [[SMIN]] |
| 78 |
; RV32ZBB-NEXT: $x10 = COPY [[SUB]](s32) |
| 79 |
; RV32ZBB-NEXT: PseudoRET implicit $x10 |
| 80 |
%1:_(s32) = COPY $x10 |
| 81 |
%2:_(s32) = COPY $x11 |
| 82 |
%3:_(s32) = G_ASSERT_SEXT %1, 16 |
| 83 |
%4:_(s32) = G_ASSERT_SEXT %2, 16 |
| 84 |
%5:_(s16) = G_TRUNC %3(s32) |
| 85 |
%6:_(s16) = G_TRUNC %4(s32) |
| 86 |
%7:_(s16) = G_ABDS %5, %6 |
| 87 |
%8:_(s32) = G_ANYEXT %7(s16) |
| 88 |
$x10 = COPY %8(s32) |
| 89 |
PseudoRET implicit $x10 |
| 90 |
... |
| 91 |
--- |
| 92 |
name: abds_i32 |
| 93 |
body: | |
| 94 |
bb.0.entry: |
| 95 |
liveins: $x10, $x11 |
| 96 |
; RV32I-LABEL: name: abds_i32 |
| 97 |
; RV32I: liveins: $x10, $x11 |
| 98 |
; RV32I-NEXT: {{ $}} |
| 99 |
; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 100 |
; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 101 |
; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]] |
| 102 |
; RV32I-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[COPY1]], [[COPY]] |
| 103 |
; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[COPY]](s32), [[COPY1]] |
| 104 |
; RV32I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[SUB]], [[SUB1]] |
| 105 |
; RV32I-NEXT: $x10 = COPY [[SELECT]](s32) |
| 106 |
; RV32I-NEXT: PseudoRET implicit $x10 |
| 107 |
; |
| 108 |
; RV32ZBB-LABEL: name: abds_i32 |
| 109 |
; RV32ZBB: liveins: $x10, $x11 |
| 110 |
; RV32ZBB-NEXT: {{ $}} |
| 111 |
; RV32ZBB-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 112 |
; RV32ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 113 |
; RV32ZBB-NEXT: [[SMAX:%[0-9]+]]:_(s32) = G_SMAX [[COPY]], [[COPY1]] |
| 114 |
; RV32ZBB-NEXT: [[SMIN:%[0-9]+]]:_(s32) = G_SMIN [[COPY]], [[COPY1]] |
| 115 |
; RV32ZBB-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[SMAX]], [[SMIN]] |
| 116 |
; RV32ZBB-NEXT: $x10 = COPY [[SUB]](s32) |
| 117 |
; RV32ZBB-NEXT: PseudoRET implicit $x10 |
| 118 |
%1:_(s32) = COPY $x10 |
| 119 |
%2:_(s32) = COPY $x11 |
| 120 |
%3:_(s32) = G_ABDS %1, %2 |
| 121 |
$x10 = COPY %3(s32) |
| 122 |
PseudoRET implicit $x10 |
| 123 |
... |
| 124 |
--- |
| 125 |
name: abds_i64 |
| 126 |
body: | |
| 127 |
bb.0.entry: |
| 128 |
; CHECK-LABEL: name: abds_i64 |
| 129 |
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 130 |
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 131 |
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10 |
| 132 |
; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x11 |
| 133 |
; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY2]] |
| 134 |
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]] |
| 135 |
; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[COPY1]], [[COPY3]] |
| 136 |
; CHECK-NEXT: [[SUB2:%[0-9]+]]:_(s32) = G_SUB [[SUB1]], [[ICMP]] |
| 137 |
; CHECK-NEXT: [[SUB3:%[0-9]+]]:_(s32) = G_SUB [[COPY2]], [[COPY]] |
| 138 |
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY2]](s32), [[COPY]] |
| 139 |
; CHECK-NEXT: [[SUB4:%[0-9]+]]:_(s32) = G_SUB [[COPY3]], [[COPY1]] |
| 140 |
; CHECK-NEXT: [[SUB5:%[0-9]+]]:_(s32) = G_SUB [[SUB4]], [[ICMP1]] |
| 141 |
; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[COPY2]] |
| 142 |
; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[COPY1]](s32), [[COPY3]] |
| 143 |
; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]] |
| 144 |
; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP4]](s32), [[ICMP2]], [[ICMP3]] |
| 145 |
; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[SELECT]](s32), [[SUB]], [[SUB3]] |
| 146 |
; CHECK-NEXT: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[SELECT]](s32), [[SUB2]], [[SUB5]] |
| 147 |
; CHECK-NEXT: $x10 = COPY [[SELECT1]](s32) |
| 148 |
; CHECK-NEXT: $x11 = COPY [[SELECT2]](s32) |
| 149 |
; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11 |
| 150 |
%0:_(s32) = COPY $x10 |
| 151 |
%1:_(s32) = COPY $x11 |
| 152 |
%2:_(s64) = G_MERGE_VALUES %0(s32), %1(s32) |
| 153 |
%3:_(s32) = COPY $x10 |
| 154 |
%4:_(s32) = COPY $x11 |
| 155 |
%5:_(s64) = G_MERGE_VALUES %3(s32), %4(s32) |
| 156 |
%6:_(s64) = G_ABDS %2, %5 |
| 157 |
%7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) |
| 158 |
$x10 = COPY %7(s32) |
| 159 |
$x11 = COPY %8(s32) |
| 160 |
PseudoRET implicit $x10, implicit $x11 |
| 161 |
... |
| 162 |
--- |
| 163 |
name: abdu_i8 |
| 164 |
body: | |
| 165 |
bb.0.entry: |
| 166 |
liveins: $x10, $x11 |
| 167 |
; RV32I-LABEL: name: abdu_i8 |
| 168 |
; RV32I: liveins: $x10, $x11 |
| 169 |
; RV32I-NEXT: {{ $}} |
| 170 |
; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 171 |
; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 172 |
; RV32I-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[COPY]], 8 |
| 173 |
; RV32I-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[COPY1]], 8 |
| 174 |
; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]] |
| 175 |
; RV32I-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[ASSERT_ZEXT1]], [[ASSERT_ZEXT]] |
| 176 |
; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[ASSERT_ZEXT]](s32), [[ASSERT_ZEXT1]] |
| 177 |
; RV32I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[SUB]], [[SUB1]] |
| 178 |
; RV32I-NEXT: $x10 = COPY [[SELECT]](s32) |
| 179 |
; RV32I-NEXT: PseudoRET implicit $x10 |
| 180 |
; |
| 181 |
; RV32ZBB-LABEL: name: abdu_i8 |
| 182 |
; RV32ZBB: liveins: $x10, $x11 |
| 183 |
; RV32ZBB-NEXT: {{ $}} |
| 184 |
; RV32ZBB-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 185 |
; RV32ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 186 |
; RV32ZBB-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[COPY]], 8 |
| 187 |
; RV32ZBB-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[COPY1]], 8 |
| 188 |
; RV32ZBB-NEXT: [[UMAX:%[0-9]+]]:_(s32) = G_UMAX [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]] |
| 189 |
; RV32ZBB-NEXT: [[UMIN:%[0-9]+]]:_(s32) = G_UMIN [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]] |
| 190 |
; RV32ZBB-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[UMAX]], [[UMIN]] |
| 191 |
; RV32ZBB-NEXT: $x10 = COPY [[SUB]](s32) |
| 192 |
; RV32ZBB-NEXT: PseudoRET implicit $x10 |
| 193 |
%1:_(s32) = COPY $x10 |
| 194 |
%2:_(s32) = COPY $x11 |
| 195 |
%3:_(s32) = G_ASSERT_ZEXT %1, 8 |
| 196 |
%4:_(s32) = G_ASSERT_ZEXT %2, 8 |
| 197 |
%5:_(s8) = G_TRUNC %3(s32) |
| 198 |
%6:_(s8) = G_TRUNC %4(s32) |
| 199 |
%7:_(s8) = G_ABDU %5, %6 |
| 200 |
%8:_(s32) = G_ANYEXT %7(s8) |
| 201 |
$x10 = COPY %8(s32) |
| 202 |
PseudoRET implicit $x10 |
| 203 |
... |
| 204 |
--- |
| 205 |
name: abdu_i16 |
| 206 |
body: | |
| 207 |
bb.0.entry: |
| 208 |
liveins: $x10, $x11 |
| 209 |
; RV32I-LABEL: name: abdu_i16 |
| 210 |
; RV32I: liveins: $x10, $x11 |
| 211 |
; RV32I-NEXT: {{ $}} |
| 212 |
; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 213 |
; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 214 |
; RV32I-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[COPY]], 16 |
| 215 |
; RV32I-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[COPY1]], 16 |
| 216 |
; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]] |
| 217 |
; RV32I-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[ASSERT_ZEXT1]], [[ASSERT_ZEXT]] |
| 218 |
; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[ASSERT_ZEXT]](s32), [[ASSERT_ZEXT1]] |
| 219 |
; RV32I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[SUB]], [[SUB1]] |
| 220 |
; RV32I-NEXT: $x10 = COPY [[SELECT]](s32) |
| 221 |
; RV32I-NEXT: PseudoRET implicit $x10 |
| 222 |
; |
| 223 |
; RV32ZBB-LABEL: name: abdu_i16 |
| 224 |
; RV32ZBB: liveins: $x10, $x11 |
| 225 |
; RV32ZBB-NEXT: {{ $}} |
| 226 |
; RV32ZBB-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 227 |
; RV32ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 228 |
; RV32ZBB-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[COPY]], 16 |
| 229 |
; RV32ZBB-NEXT: [[ASSERT_ZEXT1:%[0-9]+]]:_(s32) = G_ASSERT_ZEXT [[COPY1]], 16 |
| 230 |
; RV32ZBB-NEXT: [[UMAX:%[0-9]+]]:_(s32) = G_UMAX [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]] |
| 231 |
; RV32ZBB-NEXT: [[UMIN:%[0-9]+]]:_(s32) = G_UMIN [[ASSERT_ZEXT]], [[ASSERT_ZEXT1]] |
| 232 |
; RV32ZBB-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[UMAX]], [[UMIN]] |
| 233 |
; RV32ZBB-NEXT: $x10 = COPY [[SUB]](s32) |
| 234 |
; RV32ZBB-NEXT: PseudoRET implicit $x10 |
| 235 |
%1:_(s32) = COPY $x10 |
| 236 |
%2:_(s32) = COPY $x11 |
| 237 |
%3:_(s32) = G_ASSERT_ZEXT %1, 16 |
| 238 |
%4:_(s32) = G_ASSERT_ZEXT %2, 16 |
| 239 |
%5:_(s16) = G_TRUNC %3(s32) |
| 240 |
%6:_(s16) = G_TRUNC %4(s32) |
| 241 |
%7:_(s16) = G_ABDU %5, %6 |
| 242 |
%8:_(s32) = G_ANYEXT %7(s16) |
| 243 |
$x10 = COPY %8(s32) |
| 244 |
PseudoRET implicit $x10 |
| 245 |
... |
| 246 |
--- |
| 247 |
name: abdu_i32 |
| 248 |
body: | |
| 249 |
bb.0.entry: |
| 250 |
liveins: $x10, $x11 |
| 251 |
; RV32I-LABEL: name: abdu_i32 |
| 252 |
; RV32I: liveins: $x10, $x11 |
| 253 |
; RV32I-NEXT: {{ $}} |
| 254 |
; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 255 |
; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 256 |
; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]] |
| 257 |
; RV32I-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[COPY1]], [[COPY]] |
| 258 |
; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[COPY1]] |
| 259 |
; RV32I-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP]](s32), [[SUB]], [[SUB1]] |
| 260 |
; RV32I-NEXT: $x10 = COPY [[SELECT]](s32) |
| 261 |
; RV32I-NEXT: PseudoRET implicit $x10 |
| 262 |
; |
| 263 |
; RV32ZBB-LABEL: name: abdu_i32 |
| 264 |
; RV32ZBB: liveins: $x10, $x11 |
| 265 |
; RV32ZBB-NEXT: {{ $}} |
| 266 |
; RV32ZBB-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 267 |
; RV32ZBB-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 268 |
; RV32ZBB-NEXT: [[UMAX:%[0-9]+]]:_(s32) = G_UMAX [[COPY]], [[COPY1]] |
| 269 |
; RV32ZBB-NEXT: [[UMIN:%[0-9]+]]:_(s32) = G_UMIN [[COPY]], [[COPY1]] |
| 270 |
; RV32ZBB-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[UMAX]], [[UMIN]] |
| 271 |
; RV32ZBB-NEXT: $x10 = COPY [[SUB]](s32) |
| 272 |
; RV32ZBB-NEXT: PseudoRET implicit $x10 |
| 273 |
%1:_(s32) = COPY $x10 |
| 274 |
%2:_(s32) = COPY $x11 |
| 275 |
%3:_(s32) = G_ABDU %1, %2 |
| 276 |
$x10 = COPY %3(s32) |
| 277 |
PseudoRET implicit $x10 |
| 278 |
... |
| 279 |
--- |
| 280 |
name: abdu_i64 |
| 281 |
body: | |
| 282 |
bb.0.entry: |
| 283 |
; CHECK-LABEL: name: abdu_i64 |
| 284 |
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 |
| 285 |
; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 |
| 286 |
; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10 |
| 287 |
; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x11 |
| 288 |
; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY2]] |
| 289 |
; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]] |
| 290 |
; CHECK-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[COPY1]], [[COPY3]] |
| 291 |
; CHECK-NEXT: [[SUB2:%[0-9]+]]:_(s32) = G_SUB [[SUB1]], [[ICMP]] |
| 292 |
; CHECK-NEXT: [[SUB3:%[0-9]+]]:_(s32) = G_SUB [[COPY2]], [[COPY]] |
| 293 |
; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY2]](s32), [[COPY]] |
| 294 |
; CHECK-NEXT: [[SUB4:%[0-9]+]]:_(s32) = G_SUB [[COPY3]], [[COPY1]] |
| 295 |
; CHECK-NEXT: [[SUB5:%[0-9]+]]:_(s32) = G_SUB [[SUB4]], [[ICMP1]] |
| 296 |
; CHECK-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[COPY2]] |
| 297 |
; CHECK-NEXT: [[ICMP3:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY1]](s32), [[COPY3]] |
| 298 |
; CHECK-NEXT: [[ICMP4:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]] |
| 299 |
; CHECK-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP4]](s32), [[ICMP2]], [[ICMP3]] |
| 300 |
; CHECK-NEXT: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[SELECT]](s32), [[SUB]], [[SUB3]] |
| 301 |
; CHECK-NEXT: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[SELECT]](s32), [[SUB2]], [[SUB5]] |
| 302 |
; CHECK-NEXT: $x10 = COPY [[SELECT1]](s32) |
| 303 |
; CHECK-NEXT: $x11 = COPY [[SELECT2]](s32) |
| 304 |
; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11 |
| 305 |
%0:_(s32) = COPY $x10 |
| 306 |
%1:_(s32) = COPY $x11 |
| 307 |
%2:_(s64) = G_MERGE_VALUES %0(s32), %1(s32) |
| 308 |
%3:_(s32) = COPY $x10 |
| 309 |
%4:_(s32) = COPY $x11 |
| 310 |
%5:_(s64) = G_MERGE_VALUES %3(s32), %4(s32) |
| 311 |
%6:_(s64) = G_ABDU %2, %5 |
| 312 |
%7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) |
| 313 |
$x10 = COPY %7(s32) |
| 314 |
$x11 = COPY %8(s32) |
| 315 |
PseudoRET implicit $x10, implicit $x11 |
| 316 |
... |