187 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -mtriple=riscv64 -run-pass=legalizer %s -o - \3# RUN: | FileCheck %s4---5name: mul_i86body: |7 bb.0.entry:8 ; CHECK-LABEL: name: mul_i89 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x1010 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1111 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x212 ; CHECK-NEXT: $x10 = COPY [[COPY]](s64)13 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s64)14 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x1015 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x216 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x1017 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s64)18 ; CHECK-NEXT: PseudoRET implicit $x1019 %0:_(s64) = COPY $x1020 %1:_(s64) = COPY $x1121 %2:_(s8) = G_TRUNC %0(s64)22 %3:_(s8) = G_TRUNC %1(s64)23 %4:_(s8) = G_MUL %2, %324 %5:_(s64) = G_ANYEXT %4(s8)25 $x10 = COPY %5(s64)26 PseudoRET implicit $x1027 28...29---30name: mul_i1531body: |32 bb.0.entry:33 ; CHECK-LABEL: name: mul_i1534 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x1035 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1136 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x237 ; CHECK-NEXT: $x10 = COPY [[COPY]](s64)38 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s64)39 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x1040 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x241 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x1042 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s64)43 ; CHECK-NEXT: PseudoRET implicit $x1044 %0:_(s64) = COPY $x1045 %1:_(s64) = COPY $x1146 %2:_(s15) = G_TRUNC %0(s64)47 %3:_(s15) = G_TRUNC %1(s64)48 %4:_(s15) = G_MUL %2, %349 %5:_(s64) = G_ANYEXT %4(s15)50 $x10 = COPY %5(s64)51 PseudoRET implicit $x1052 53...54---55name: mul_i1656body: |57 bb.0.entry:58 ; CHECK-LABEL: name: mul_i1659 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x1060 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1161 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x262 ; CHECK-NEXT: $x10 = COPY [[COPY]](s64)63 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s64)64 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x1065 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x266 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x1067 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s64)68 ; CHECK-NEXT: PseudoRET implicit $x1069 %0:_(s64) = COPY $x1070 %1:_(s64) = COPY $x1171 %2:_(s16) = G_TRUNC %0(s64)72 %3:_(s16) = G_TRUNC %1(s64)73 %4:_(s16) = G_MUL %2, %374 %5:_(s64) = G_ANYEXT %4(s16)75 $x10 = COPY %5(s64)76 PseudoRET implicit $x1077 78...79---80name: mul_i3281body: |82 bb.0.entry:83 ; CHECK-LABEL: name: mul_i3284 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x1085 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1186 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x287 ; CHECK-NEXT: $x10 = COPY [[COPY]](s64)88 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s64)89 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x1090 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x291 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x1092 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s64)93 ; CHECK-NEXT: PseudoRET implicit $x1094 %0:_(s64) = COPY $x1095 %1:_(s64) = COPY $x1196 %2:_(s32) = G_TRUNC %0(s64)97 %3:_(s32) = G_TRUNC %1(s64)98 %4:_(s32) = G_MUL %2, %399 %5:_(s64) = G_ANYEXT %4(s32)100 $x10 = COPY %5(s64)101 PseudoRET implicit $x10102 103...104---105name: mul_i64106body: |107 bb.0.entry:108 ; CHECK-LABEL: name: mul_i64109 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10110 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11111 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2112 ; CHECK-NEXT: $x10 = COPY [[COPY]](s64)113 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s64)114 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10115 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2116 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x10117 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s64)118 ; CHECK-NEXT: PseudoRET implicit $x10119 %0:_(s64) = COPY $x10120 %1:_(s64) = COPY $x11121 %2:_(s64) = G_MUL %0, %1122 $x10 = COPY %2(s64)123 PseudoRET implicit $x10124 125...126---127name: mul_i128128body: |129 bb.0.entry:130 ; CHECK-LABEL: name: mul_i128131 ; CHECK: %lo1:_(s64) = COPY $x10132 ; CHECK-NEXT: %hi1:_(s64) = COPY $x11133 ; CHECK-NEXT: %lo2:_(s64) = COPY $x12134 ; CHECK-NEXT: %hi2:_(s64) = COPY $x13135 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2136 ; CHECK-NEXT: $x10 = COPY %lo1(s64)137 ; CHECK-NEXT: $x11 = COPY %hi1(s64)138 ; CHECK-NEXT: $x12 = COPY %lo2(s64)139 ; CHECK-NEXT: $x13 = COPY %hi2(s64)140 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__multi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11141 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2142 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10143 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11144 ; CHECK-NEXT: $x10 = COPY [[COPY]](s64)145 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s64)146 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11147 %lo1:_(s64) = COPY $x10148 %hi1:_(s64) = COPY $x11149 %lo2:_(s64) = COPY $x12150 %hi2:_(s64) = COPY $x13151 %x1:_(s128) = G_MERGE_VALUES %lo1(s64), %hi1(s64)152 %x2:_(s128) = G_MERGE_VALUES %lo2(s64), %hi2(s64)153 %y:_(s128) = G_MUL %x1, %x2154 %loy:_(s64), %hiy:_(s64) = G_UNMERGE_VALUES %y(s128)155 $x10 = COPY %loy(s64)156 $x11 = COPY %hiy(s64)157 PseudoRET implicit $x10, implicit $x11158 159...160---161name: smulh_i64162body: |163 bb.0.entry:164 ; CHECK-LABEL: name: smulh_i64165 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x10166 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11167 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63168 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[COPY]], [[C]](s64)169 ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:_(s64) = G_ASHR [[COPY1]], [[C]](s64)170 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2171 ; CHECK-NEXT: $x10 = COPY [[COPY]](s64)172 ; CHECK-NEXT: $x11 = COPY [[ASHR]](s64)173 ; CHECK-NEXT: $x12 = COPY [[COPY1]](s64)174 ; CHECK-NEXT: $x13 = COPY [[ASHR1]](s64)175 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__multi3, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11176 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2177 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x11178 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s64)179 ; CHECK-NEXT: PseudoRET implicit $x10180 %0:_(s64) = COPY $x10181 %1:_(s64) = COPY $x11182 %2:_(s64) = G_SMULH %0, %1183 $x10 = COPY %2(s64)184 PseudoRET implicit $x10185 186...187