1 # RUN: llc -march=amdgcn -mcpu=gfx1010 %s -run-pass twoaddressinstruction -verify-machineinstrs -o - | FileCheck --check-prefixes=GCN %s
2 # RUN: llc -march=amdgcn -mcpu=gfx1010 %s -run-pass twoaddressinstruction -verify-machineinstrs -o - -early-live-intervals | FileCheck --check-prefixes=GCN %s
3 # RUN: llc -march=amdgcn -mcpu=gfx1100 %s -run-pass twoaddressinstruction -verify-machineinstrs -o - | FileCheck --check-prefixes=GCN %s
4 # RUN: llc -march=amdgcn -mcpu=gfx1100 %s -run-pass twoaddressinstruction -verify-machineinstrs -o - -early-live-intervals | FileCheck --check-prefixes=GCN %s
6 # GCN-LABEL: name: test_fmamk_reg_imm_f32
7 # GCN: %2:vgpr_32 = IMPLICIT_DEF
9 # GCN: V_FMAMK_F32 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
11 name: test_fmamk_reg_imm_f32
13 - { id: 0, class: vreg_64 }
14 - { id: 1, class: vgpr_32 }
15 - { id: 2, class: vgpr_32 }
16 - { id: 3, class: vgpr_32 }
22 %2 = V_MOV_B32_e32 1078523331, implicit $exec
23 %3 = V_FMAC_F32_e32 killed %0.sub0, %2, killed %1, implicit $mode, implicit $exec
27 # GCN-LABEL: name: test_fmamk_imm_reg_f32
28 # GCN: %2:vgpr_32 = IMPLICIT_DEF
30 # GCN: V_FMAMK_F32 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
32 name: test_fmamk_imm_reg_f32
34 - { id: 0, class: vreg_64 }
35 - { id: 1, class: vgpr_32 }
36 - { id: 2, class: vgpr_32 }
37 - { id: 3, class: vgpr_32 }
43 %2 = V_MOV_B32_e32 1078523331, implicit $exec
44 %3 = V_FMAC_F32_e32 %2, killed %0.sub0, killed %1, implicit $mode, implicit $exec
48 # GCN-LABEL: name: test_fmaak_f32
49 # GCN: %1:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
51 # GCN: V_FMAAK_F32 killed %0.sub0, %0.sub1, 1078523331, implicit $mode, implicit $exec
55 - { id: 0, class: vreg_64 }
56 - { id: 1, class: vgpr_32 }
57 - { id: 2, class: vgpr_32 }
62 %1 = V_MOV_B32_e32 1078523331, implicit $exec
63 %2 = V_FMAC_F32_e32 killed %0.sub0, %0.sub1, %1, implicit $mode, implicit $exec
64 S_ENDPGM 0, implicit %1
68 # GCN-LABEL: name: test_fmaak_sgpr_src0_f32
69 # GCN: %1:vgpr_32 = IMPLICIT_DEF
71 # GCN: %3:vgpr_32 = V_FMAMK_F32 killed %0, 1078523331, %2, implicit $mode, implicit $exec
74 name: test_fmaak_sgpr_src0_f32
76 - { id: 0, class: sreg_32_xm0 }
77 - { id: 1, class: vgpr_32}
78 - { id: 2, class: vgpr_32 }
79 - { id: 3, class: vgpr_32 }
84 %1 = V_MOV_B32_e32 1078523331, implicit $exec
86 %3 = V_FMAC_F32_e32 killed %0, %1, %2, implicit $mode, implicit $exec
87 S_ENDPGM 0, implicit %2
90 # GCN-LABEL: name: test_fmaak_inlineimm_src0_f32
91 # GCN: %0:vgpr_32 = IMPLICIT_DEF
93 # GCN: %2:vgpr_32 = V_FMAMK_F32 1073741824, 1078523331, %1, implicit $mode, implicit $exec
96 name: test_fmaak_inlineimm_src0_f32
98 - { id: 0, class: vgpr_32}
99 - { id: 1, class: vgpr_32 }
100 - { id: 2, class: vgpr_32 }
104 %0 = V_MOV_B32_e32 1078523331, implicit $exec
106 %2 = V_FMAC_F32_e32 1073741824, %0, %1, implicit $mode, implicit $exec
107 S_ENDPGM 0, implicit %1
110 # GCN-LABEL: name: test_fmaak_otherimm_src0_f32
111 # GCN: %2:vgpr_32 = V_FMAMK_F32 %0, 1120403456, %1, implicit $mode, implicit $exec
114 name: test_fmaak_otherimm_src0_f32
116 - { id: 0, class: vgpr_32}
117 - { id: 1, class: vgpr_32 }
118 - { id: 2, class: vgpr_32 }
122 %0 = V_MOV_B32_e32 1078523331, implicit $exec
124 %2 = V_FMAC_F32_e32 1120403456, %0, %1, implicit $mode, implicit $exec
125 S_ENDPGM 0, implicit %1
128 # GCN-LABEL: name: test_fmaak_other_constantlike_src0_f32
129 # GCN: %2:vgpr_32 = COPY %1
130 # GCN: %2:vgpr_32 = V_FMAC_F32_e32 %stack.0, %0, %2, implicit $mode, implicit $exec
132 name: test_fmaak_other_constantlike_src0_f32
133 tracksRegLiveness: true
135 - { id: 0, class: vgpr_32 }
136 - { id: 1, class: vgpr_32 }
137 - { id: 2, class: vgpr_32 }
139 stackPtrOffsetReg: $sgpr32
141 - { id: 0, name: "", type: default, offset: 0, size: 128, alignment: 8,
142 callee-saved-register: '', local-offset: 0, debug-info-variable: '',
143 debug-info-expression: '', debug-info-location: '' }
147 %0 = V_MOV_B32_e32 1078523331, implicit $exec
149 %2 = V_FMAC_F32_e32 %stack.0, %0, %1, implicit $mode, implicit $exec
154 # GCN-LABEL: name: test_fmamk_reg_imm_f32_2_folds
155 # GCN: %2:vgpr_32 = IMPLICIT_DEF
157 # GCN: V_FMAMK_F32 %0.sub0, 1078523331, %1, implicit $mode, implicit $exec
158 # GCN: V_FMAMK_F32 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
160 name: test_fmamk_reg_imm_f32_2_folds
162 - { id: 0, class: vreg_64 }
163 - { id: 1, class: vgpr_32 }
164 - { id: 2, class: vgpr_32 }
165 - { id: 3, class: vgpr_32 }
166 - { id: 4, class: vgpr_32 }
172 %2 = V_MOV_B32_e32 1078523331, implicit $exec
173 %3 = V_FMAC_F32_e32 %0.sub0, %2, %1, implicit $mode, implicit $exec
174 %4 = V_FMAC_F32_e32 killed %0.sub0, %2, killed %1, implicit $mode, implicit $exec
178 # GCN-LABEL: name: test_fmamk_reg_imm_f32_used_imm
179 # GCN: %2:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
180 # GCN: V_FMAMK_F32 killed %0.sub0, 1078523331, killed %1, implicit $mode, implicit $exec
182 name: test_fmamk_reg_imm_f32_used_imm
184 - { id: 0, class: vreg_64 }
185 - { id: 1, class: vgpr_32 }
186 - { id: 2, class: vgpr_32 }
187 - { id: 3, class: vgpr_32 }
193 %2 = V_MOV_B32_e32 1078523331, implicit $exec
194 %3 = V_FMAC_F32_e32 killed %0.sub0, %2, killed %1, implicit $mode, implicit $exec
199 # GCN-LABEL: name: test_fma_src0mods
200 # GCN: %3:vgpr_32 = V_FMA_F32_e64 1, %0, 0, %1, 0, %2, 0, 0, implicit $mode, implicit $exec
202 name: test_fma_src0mods
205 %0:vgpr_32 = IMPLICIT_DEF
206 %1:vgpr_32 = IMPLICIT_DEF
207 %2:vgpr_32 = IMPLICIT_DEF
208 %3:vgpr_32 = V_FMAC_F32_e64 1, %0, 0, %1, 0, %2, 0, 0, implicit $mode, implicit $exec
209 S_ENDPGM 0, implicit %2
212 # GCN-LABEL: name: test_fma_src1mods
213 # GCN: %3:vgpr_32 = V_FMA_F32_e64 0, %0, 1, %1, 0, %2, 0, 0, implicit $mode, implicit $exec
215 name: test_fma_src1mods
218 %0:vgpr_32 = IMPLICIT_DEF
219 %1:vgpr_32 = IMPLICIT_DEF
220 %2:vgpr_32 = IMPLICIT_DEF
221 %3:vgpr_32 = V_FMAC_F32_e64 0, %0, 1, %1, 0, %2, 0, 0, implicit $mode, implicit $exec
222 S_ENDPGM 0, implicit %2
225 # GCN-LABEL: name: test_fma_src2mods
226 # GCN: %3:vgpr_32 = V_FMA_F32_e64 0, %0, 0, %1, 1, %2, 0, 0, implicit $mode, implicit $exec
228 name: test_fma_src2mods
231 %0:vgpr_32 = IMPLICIT_DEF
232 %1:vgpr_32 = IMPLICIT_DEF
233 %2:vgpr_32 = IMPLICIT_DEF
234 %3:vgpr_32 = V_FMAC_F32_e64 0, %0, 0, %1, 1, %2, 0, 0, implicit $mode, implicit $exec
235 S_ENDPGM 0, implicit %2