1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX6 %s
12 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
13 ; GFX6-LABEL: name: fadd_s64_vvv
14 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
16 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
17 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
18 ; GFX6-NEXT: %2:vreg_64 = nofpexcept V_ADD_F64_e64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
19 ; GFX6-NEXT: S_ENDPGM 0, implicit %2
20 %0:vgpr(s64) = COPY $vgpr0_vgpr1
21 %1:vgpr(s64) = COPY $vgpr2_vgpr3
22 %2:vgpr(s64) = G_FADD %0, %1
23 S_ENDPGM 0, implicit %2
35 liveins: $vgpr0_vgpr1, $sgpr0_sgpr1
36 ; GFX6-LABEL: name: fadd_s64_vsv
37 ; GFX6: liveins: $vgpr0_vgpr1, $sgpr0_sgpr1
39 ; GFX6-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
40 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
41 ; GFX6-NEXT: %2:vreg_64 = nofpexcept V_ADD_F64_e64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
42 ; GFX6-NEXT: S_ENDPGM 0, implicit %2
43 %0:sgpr(s64) = COPY $sgpr0_sgpr1
44 %1:vgpr(s64) = COPY $vgpr0_vgpr1
45 %2:vgpr(s64) = G_FADD %0, %1
46 S_ENDPGM 0, implicit %2
58 liveins: $vgpr0_vgpr1, $sgpr0_sgpr1
59 ; GFX6-LABEL: name: fadd_s64_vvs
60 ; GFX6: liveins: $vgpr0_vgpr1, $sgpr0_sgpr1
62 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
63 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
64 ; GFX6-NEXT: %2:vreg_64 = nofpexcept V_ADD_F64_e64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
65 ; GFX6-NEXT: S_ENDPGM 0, implicit %2
66 %0:vgpr(s64) = COPY $vgpr0_vgpr1
67 %1:sgpr(s64) = COPY $sgpr0_sgpr1
68 %2:vgpr(s64) = G_FADD %0, %1
69 S_ENDPGM 0, implicit %2
75 name: fadd_s64_vvv_fabs_lhs
81 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
82 ; GFX6-LABEL: name: fadd_s64_vvv_fabs_lhs
83 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
85 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
86 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
87 ; GFX6-NEXT: %3:vreg_64 = nofpexcept V_ADD_F64_e64 2, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
88 ; GFX6-NEXT: S_ENDPGM 0, implicit %3
89 %0:vgpr(s64) = COPY $vgpr0_vgpr1
90 %1:vgpr(s64) = COPY $vgpr2_vgpr3
91 %2:vgpr(s64) = G_FABS %0
92 %3:vgpr(s64) = G_FADD %2, %1
93 S_ENDPGM 0, implicit %3
99 name: fadd_s64_vvv_fabs_rhs
101 regBankSelected: true
105 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
106 ; GFX6-LABEL: name: fadd_s64_vvv_fabs_rhs
107 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
109 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
110 ; GFX6-NEXT: %3:vreg_64 = nofpexcept V_ADD_F64_e64 0, [[COPY]], 2, [[COPY]], 0, 0, implicit $mode, implicit $exec
111 ; GFX6-NEXT: S_ENDPGM 0, implicit %3
112 %0:vgpr(s64) = COPY $vgpr0_vgpr1
113 %1:vgpr(s64) = COPY $vgpr2_vgpr3
114 %2:vgpr(s64) = G_FABS %1
115 %3:vgpr(s64) = G_FADD %1, %2
116 S_ENDPGM 0, implicit %3
122 name: fadd_s64_vvv_fneg_fabs_lhs
124 regBankSelected: true
128 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
129 ; GFX6-LABEL: name: fadd_s64_vvv_fneg_fabs_lhs
130 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
132 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
133 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
134 ; GFX6-NEXT: %4:vreg_64 = nofpexcept V_ADD_F64_e64 3, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
135 ; GFX6-NEXT: S_ENDPGM 0, implicit %4
136 %0:vgpr(s64) = COPY $vgpr0_vgpr1
137 %1:vgpr(s64) = COPY $vgpr2_vgpr3
138 %2:vgpr(s64) = G_FABS %0
139 %3:vgpr(s64) = G_FNEG %2
140 %4:vgpr(s64) = G_FADD %3, %1
141 S_ENDPGM 0, implicit %4
147 name: fadd_s64_vvv_fneg_fabs_rhs
149 regBankSelected: true
153 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
154 ; GFX6-LABEL: name: fadd_s64_vvv_fneg_fabs_rhs
155 ; GFX6: liveins: $vgpr0_vgpr1, $vgpr2_vgpr3
157 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
158 ; GFX6-NEXT: %4:vreg_64 = nofpexcept V_ADD_F64_e64 0, [[COPY]], 3, [[COPY]], 0, 0, implicit $mode, implicit $exec
159 ; GFX6-NEXT: S_ENDPGM 0, implicit %4
160 %0:vgpr(s64) = COPY $vgpr0_vgpr1
161 %1:vgpr(s64) = COPY $vgpr0_vgpr1
162 %2:vgpr(s64) = G_FABS %1
163 %3:vgpr(s64) = G_FNEG %2
164 %4:vgpr(s64) = G_FADD %1, %3
165 S_ENDPGM 0, implicit %4
169 # Need to look through reg bank copy to find source modifiers
173 name: fadd_s64_fneg_copy_sgpr
175 regBankSelected: true
179 liveins: $vgpr0_vgpr1, $sgpr0_sgpr1
180 ; GFX6-LABEL: name: fadd_s64_fneg_copy_sgpr
181 ; GFX6: liveins: $vgpr0_vgpr1, $sgpr0_sgpr1
183 ; GFX6-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
184 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
185 ; GFX6-NEXT: [[COPY2:%[0-9]+]]:vreg_64 = COPY [[COPY1]]
186 ; GFX6-NEXT: %4:vreg_64 = nofpexcept V_ADD_F64_e64 0, [[COPY]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec
187 ; GFX6-NEXT: S_ENDPGM 0, implicit %4
188 %0:vgpr(s64) = COPY $vgpr0_vgpr1
189 %1:sgpr(s64) = COPY $sgpr0_sgpr1
190 %2:sgpr(s64) = G_FNEG %1
191 %3:vgpr(s64) = COPY %2
192 %4:vgpr(s64) = G_FADD %0, %3
193 S_ENDPGM 0, implicit %4
197 # The source modifier lookup searches through SGPR->VGPR copies. Make
198 # sure we don't violate the constant bus restriction when we look at
203 name: fadd_s64_copy_fabs_sgpr_copy_fabs_sgpr
205 regBankSelected: true
209 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
210 ; GFX6-LABEL: name: fadd_s64_copy_fabs_sgpr_copy_fabs_sgpr
211 ; GFX6: liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
213 ; GFX6-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
214 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr2_sgpr3
215 ; GFX6-NEXT: [[COPY2:%[0-9]+]]:vreg_64 = COPY [[COPY]]
216 ; GFX6-NEXT: [[COPY3:%[0-9]+]]:vreg_64 = COPY [[COPY1]]
217 ; GFX6-NEXT: %6:vreg_64 = nofpexcept V_ADD_F64_e64 2, [[COPY2]], 2, [[COPY3]], 0, 0, implicit $mode, implicit $exec
218 ; GFX6-NEXT: S_ENDPGM 0, implicit %6
219 %0:sgpr(s64) = COPY $sgpr0_sgpr1
220 %1:sgpr(s64) = COPY $sgpr2_sgpr3
221 %2:sgpr(s64) = G_FABS %0
222 %3:sgpr(s64) = G_FABS %1
223 %4:vgpr(s64) = COPY %2
224 %5:vgpr(s64) = COPY %3
225 %6:vgpr(s64) = G_FADD %4, %5
226 S_ENDPGM 0, implicit %6
232 name: fadd_s64_copy_fneg_sgpr_copy_fneg_sgpr
234 regBankSelected: true
238 liveins: $sgpr0, $sgpr1
239 ; GFX6-LABEL: name: fadd_s64_copy_fneg_sgpr_copy_fneg_sgpr
240 ; GFX6: liveins: $sgpr0, $sgpr1
242 ; GFX6-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
243 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr2_sgpr3
244 ; GFX6-NEXT: [[COPY2:%[0-9]+]]:vreg_64 = COPY [[COPY]]
245 ; GFX6-NEXT: [[COPY3:%[0-9]+]]:vreg_64 = COPY [[COPY1]]
246 ; GFX6-NEXT: %6:vreg_64 = nofpexcept V_ADD_F64_e64 1, [[COPY2]], 1, [[COPY3]], 0, 0, implicit $mode, implicit $exec
247 ; GFX6-NEXT: S_ENDPGM 0, implicit %6
248 %0:sgpr(s64) = COPY $sgpr0_sgpr1
249 %1:sgpr(s64) = COPY $sgpr2_sgpr3
250 %2:sgpr(s64) = G_FNEG %0
251 %3:sgpr(s64) = G_FNEG %1
252 %4:vgpr(s64) = COPY %2
253 %5:vgpr(s64) = COPY %3
254 %6:vgpr(s64) = G_FADD %4, %5
255 S_ENDPGM 0, implicit %6
261 name: fadd_s64_copy_fneg_fabs_sgpr_copy_fneg_fabs_sgpr
263 regBankSelected: true
267 liveins: $sgpr0, $sgpr1
268 ; GFX6-LABEL: name: fadd_s64_copy_fneg_fabs_sgpr_copy_fneg_fabs_sgpr
269 ; GFX6: liveins: $sgpr0, $sgpr1
271 ; GFX6-NEXT: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
272 ; GFX6-NEXT: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr2_sgpr3
273 ; GFX6-NEXT: [[COPY2:%[0-9]+]]:vreg_64 = COPY [[COPY]]
274 ; GFX6-NEXT: [[COPY3:%[0-9]+]]:vreg_64 = COPY [[COPY1]]
275 ; GFX6-NEXT: %8:vreg_64 = nofpexcept V_ADD_F64_e64 3, [[COPY2]], 3, [[COPY3]], 0, 0, implicit $mode, implicit $exec
276 ; GFX6-NEXT: S_ENDPGM 0, implicit %8
277 %0:sgpr(s64) = COPY $sgpr0_sgpr1
278 %1:sgpr(s64) = COPY $sgpr2_sgpr3
279 %2:sgpr(s64) = G_FABS %0
280 %3:sgpr(s64) = G_FABS %1
281 %4:sgpr(s64) = G_FNEG %2
282 %5:sgpr(s64) = G_FNEG %3
283 %6:vgpr(s64) = COPY %4
284 %7:vgpr(s64) = COPY %5
285 %8:vgpr(s64) = G_FADD %6, %7
286 S_ENDPGM 0, implicit %8