1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
10 liveins: $sgpr0, $sgpr1
11 ; CHECK-LABEL: name: mul_s32_ss
12 ; CHECK: liveins: $sgpr0, $sgpr1
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
15 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
16 ; CHECK-NEXT: [[MUL:%[0-9]+]]:sgpr(s32) = G_MUL [[COPY]], [[COPY1]]
17 %0:_(s32) = COPY $sgpr0
18 %1:_(s32) = COPY $sgpr1
19 %2:_(s32) = G_MUL %0, %1
28 liveins: $sgpr0, $vgpr0
29 ; CHECK-LABEL: name: mul_s32_sv
30 ; CHECK: liveins: $sgpr0, $vgpr0
32 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
33 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
34 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
35 ; CHECK-NEXT: [[MUL:%[0-9]+]]:vgpr(s32) = G_MUL [[COPY2]], [[COPY1]]
36 %0:_(s32) = COPY $sgpr0
37 %1:_(s32) = COPY $vgpr0
38 %2:_(s32) = G_MUL %0, %1
47 liveins: $sgpr0, $vgpr0
48 ; CHECK-LABEL: name: mul_s32_vs
49 ; CHECK: liveins: $sgpr0, $vgpr0
51 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
52 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
53 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
54 ; CHECK-NEXT: [[MUL:%[0-9]+]]:vgpr(s32) = G_MUL [[COPY]], [[COPY2]]
55 %0:_(s32) = COPY $vgpr0
56 %1:_(s32) = COPY $sgpr0
57 %2:_(s32) = G_MUL %0, %1
66 liveins: $vgpr0, $vgpr1
67 ; CHECK-LABEL: name: mul_s32_vv
68 ; CHECK: liveins: $vgpr0, $vgpr1
70 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
71 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
72 ; CHECK-NEXT: [[MUL:%[0-9]+]]:vgpr(s32) = G_MUL [[COPY]], [[COPY1]]
73 %0:_(s32) = COPY $vgpr0
74 %1:_(s32) = COPY $vgpr1
75 %2:_(s32) = G_MUL %0, %1
84 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
85 ; CHECK-LABEL: name: mul_s64_ss
86 ; CHECK: liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
88 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
89 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s64) = COPY $sgpr2_sgpr3
90 ; CHECK-NEXT: [[MUL:%[0-9]+]]:sgpr(s64) = G_MUL [[COPY]], [[COPY1]]
91 %0:_(s64) = COPY $sgpr0_sgpr1
92 %1:_(s64) = COPY $sgpr2_sgpr3
93 %2:_(s64) = G_MUL %0, %1
102 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
103 ; CHECK-LABEL: name: mul_s64_vv
104 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
106 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s64) = COPY $vgpr0_vgpr1
107 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s64) = COPY $vgpr2_vgpr3
108 ; CHECK-NEXT: [[UV:%[0-9]+]]:vgpr(s32), [[UV1:%[0-9]+]]:vgpr(s32) = G_UNMERGE_VALUES [[COPY]](s64)
109 ; CHECK-NEXT: [[UV2:%[0-9]+]]:vgpr(s32), [[UV3:%[0-9]+]]:vgpr(s32) = G_UNMERGE_VALUES [[COPY1]](s64)
110 ; CHECK-NEXT: [[UMULH:%[0-9]+]]:vgpr(s32) = G_UMULH [[UV]], [[UV2]]
111 ; CHECK-NEXT: [[MUL:%[0-9]+]]:vgpr(s32) = G_MUL [[UV]], [[UV3]]
112 ; CHECK-NEXT: [[ADD:%[0-9]+]]:vgpr(s32) = G_ADD [[UMULH]], [[MUL]]
113 ; CHECK-NEXT: [[MUL1:%[0-9]+]]:vgpr(s32) = G_MUL [[UV1]], [[UV2]]
114 ; CHECK-NEXT: [[ADD1:%[0-9]+]]:vgpr(s32) = G_ADD [[ADD]], [[MUL1]]
115 ; CHECK-NEXT: [[MUL2:%[0-9]+]]:vgpr(s32) = G_MUL [[UV]], [[UV2]]
116 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[MUL2]](s32), [[ADD1]](s32)
117 %0:_(s64) = COPY $vgpr0_vgpr1
118 %1:_(s64) = COPY $vgpr2_vgpr3
119 %2:_(s64) = G_MUL %0, %1
123 name: mul_s64_zext_ss
128 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
129 ; CHECK-LABEL: name: mul_s64_zext_ss
130 ; CHECK: liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
132 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr_64(s64) = COPY $sgpr0_sgpr1
133 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr_64(s64) = COPY $sgpr2_sgpr3
134 ; CHECK-NEXT: [[S_MUL_U64_:%[0-9]+]]:sgpr_64(s64) = S_MUL_U64 [[COPY]](s64), [[COPY1]](s64)
135 %0:_(s64) = COPY $sgpr0_sgpr1
136 %1:_(s64) = COPY $sgpr2_sgpr3
137 %2:_(s64) = G_AMDGPU_S_MUL_U64_U32 %0, %1
141 name: mul_s64_zext_vv
146 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
147 ; CHECK-LABEL: name: mul_s64_zext_vv
148 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
150 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s64) = COPY $vgpr0_vgpr1
151 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s64) = COPY $vgpr2_vgpr3
152 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr_32(s32) = G_TRUNC [[COPY]](s64)
153 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:vgpr_32(s32) = G_TRUNC [[COPY1]](s64)
154 ; CHECK-NEXT: [[C:%[0-9]+]]:vreg_64(s64) = G_CONSTANT i64 0
155 ; CHECK-NEXT: [[AMDGPU_MAD_U64_U32_:%[0-9]+]]:vgpr(s64), [[AMDGPU_MAD_U64_U32_1:%[0-9]+]]:vreg_64 = G_AMDGPU_MAD_U64_U32 [[TRUNC]](s32), [[TRUNC1]], [[C]]
156 %0:_(s64) = COPY $vgpr0_vgpr1
157 %1:_(s64) = COPY $vgpr2_vgpr3
158 %2:_(s64) = G_AMDGPU_S_MUL_U64_U32 %0, %1
162 name: mul_s64_sext_ss
167 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
168 ; CHECK-LABEL: name: mul_s64_sext_ss
169 ; CHECK: liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
171 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr_64(s64) = COPY $sgpr0_sgpr1
172 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr_64(s64) = COPY $sgpr2_sgpr3
173 ; CHECK-NEXT: [[S_MUL_U64_:%[0-9]+]]:sgpr_64(s64) = S_MUL_U64 [[COPY]](s64), [[COPY1]](s64)
174 %0:_(s64) = COPY $sgpr0_sgpr1
175 %1:_(s64) = COPY $sgpr2_sgpr3
176 %2:_(s64) = G_AMDGPU_S_MUL_I64_I32 %0, %1
180 name: mul_s64_sext_vv
185 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
186 ; CHECK-LABEL: name: mul_s64_sext_vv
187 ; CHECK: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
189 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s64) = COPY $vgpr0_vgpr1
190 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s64) = COPY $vgpr2_vgpr3
191 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr_32(s32) = G_TRUNC [[COPY]](s64)
192 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:vgpr_32(s32) = G_TRUNC [[COPY1]](s64)
193 ; CHECK-NEXT: [[C:%[0-9]+]]:vreg_64(s64) = G_CONSTANT i64 0
194 ; CHECK-NEXT: [[AMDGPU_MAD_I64_I32_:%[0-9]+]]:vgpr(s64), [[AMDGPU_MAD_I64_I32_1:%[0-9]+]]:vreg_64 = G_AMDGPU_MAD_I64_I32 [[TRUNC]](s32), [[TRUNC1]], [[C]]
195 %0:_(s64) = COPY $vgpr0_vgpr1
196 %1:_(s64) = COPY $vgpr2_vgpr3
197 %2:_(s64) = G_AMDGPU_S_MUL_I64_I32 %0, %1