1 # RUN: llc -march=amdgcn -mcpu=gfx900 %s -run-pass twoaddressinstruction -verify-machineinstrs -o - | FileCheck -check-prefix=GCN %s
3 # GCN-LABEL: name: test_madmk_reg_imm_f32
4 # GCN: V_MADMK_F32 killed %0.sub0, 1078523331, killed %1, implicit $exec
6 name: test_madmk_reg_imm_f32
8 - { id: 0, class: vreg_64 }
9 - { id: 1, class: vgpr_32 }
10 - { id: 2, class: vgpr_32 }
11 - { id: 3, class: vgpr_32 }
17 %2 = V_MOV_B32_e32 1078523331, implicit $exec
18 %3 = V_MAC_F32_e32 killed %0.sub0, %2, killed %1, implicit $exec
22 # GCN-LABEL: name: test_madmk_imm_reg_f32
23 # GCN: V_MADMK_F32 killed %0.sub0, 1078523331, killed %1, implicit $exec
25 name: test_madmk_imm_reg_f32
27 - { id: 0, class: vreg_64 }
28 - { id: 1, class: vgpr_32 }
29 - { id: 2, class: vgpr_32 }
30 - { id: 3, class: vgpr_32 }
36 %2 = V_MOV_B32_e32 1078523331, implicit $exec
37 %3 = V_MAC_F32_e32 %2, killed %0.sub0, killed %1, implicit $exec
41 # GCN-LABEL: name: test_madak_f32
42 # GCN: V_MADAK_F32 killed %0.sub0, %0.sub1, 1078523331, implicit $exec
46 - { id: 0, class: vreg_64 }
47 - { id: 1, class: vgpr_32 }
48 - { id: 2, class: vgpr_32 }
53 %1 = V_MOV_B32_e32 1078523331, implicit $exec
54 %2 = V_MAC_F32_e32 killed %0.sub0, %0.sub1, %1, implicit $exec
58 # GCN-LABEL: name: test_madmk_reg_imm_f16
59 # GCN: V_MADMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $exec
61 name: test_madmk_reg_imm_f16
63 - { id: 0, class: vreg_64 }
64 - { id: 1, class: vgpr_32 }
65 - { id: 2, class: vgpr_32 }
66 - { id: 3, class: vgpr_32 }
72 %2 = V_MOV_B32_e32 1078523331, implicit $exec
73 %3 = V_MAC_F16_e32 killed %0.sub0, %2, killed %1, implicit $exec
77 # GCN-LABEL: name: test_madmk_imm_reg_f16
78 # GCN: V_MADMK_F16 killed %0.sub0, 1078523331, killed %1, implicit $exec
80 name: test_madmk_imm_reg_f16
82 - { id: 0, class: vreg_64 }
83 - { id: 1, class: vgpr_32 }
84 - { id: 2, class: vgpr_32 }
85 - { id: 3, class: vgpr_32 }
91 %2 = V_MOV_B32_e32 1078523331, implicit $exec
92 %3 = V_MAC_F16_e32 %2, killed %0.sub0, killed %1, implicit $exec
96 # GCN-LABEL: name: test_madak_f16
97 # GCN: V_MADAK_F16 killed %0.sub0, %0.sub1, 1078523331, implicit $exec
101 - { id: 0, class: vreg_64 }
102 - { id: 1, class: vgpr_32 }
103 - { id: 2, class: vgpr_32 }
108 %1 = V_MOV_B32_e32 1078523331, implicit $exec
109 %2 = V_MAC_F16_e32 killed %0.sub0, %0.sub1, %1, implicit $exec
112 # Make sure constant bus restriction isn't violated if src0 is an SGPR.
114 # GCN-LABEL: name: test_madak_sgpr_src0_f32
115 # GCN: %1:vgpr_32 = V_MOV_B32_e32 1078523331, implicit $exec
116 # GCN: %2:vgpr_32 = V_MAD_F32 0, killed %0, 0, %1, 0, %3:vgpr_32, 0, 0, implicit $exec
119 name: test_madak_sgpr_src0_f32
121 - { id: 0, class: sreg_32_xm0 }
122 - { id: 1, class: vgpr_32}
123 - { id: 2, class: vgpr_32 }
124 - { id: 3, class: vgpr_32 }
129 %1 = V_MOV_B32_e32 1078523331, implicit $exec
130 %2 = V_MAC_F32_e32 killed %0, %1, %3, implicit $exec
134 # This can still fold if this is an inline immediate.
136 # GCN-LABEL: name: test_madak_inlineimm_src0_f32
137 # GCN: %1:vgpr_32 = V_MADMK_F32 1073741824, 1078523331, %2:vgpr_32, implicit $exec
140 name: test_madak_inlineimm_src0_f32
142 - { id: 0, class: vgpr_32}
143 - { id: 1, class: vgpr_32 }
144 - { id: 2, class: vgpr_32 }
148 %0 = V_MOV_B32_e32 1078523331, implicit $exec
149 %1 = V_MAC_F32_e32 1073741824, %0, %2, implicit $exec
152 # Non-inline immediate uses constant bus already.
154 # GCN-LABEL: name: test_madak_otherimm_src0_f32
155 # GCN: %1:vgpr_32 = V_MAC_F32_e32 1120403456, %0, %1, implicit $exec
158 name: test_madak_otherimm_src0_f32
160 - { id: 0, class: vgpr_32}
161 - { id: 1, class: vgpr_32 }
162 - { id: 2, class: vgpr_32 }
166 %0 = V_MOV_B32_e32 1078523331, implicit $exec
167 %1 = V_MAC_F32_e32 1120403456, %0, %2, implicit $exec
170 # Non-inline immediate uses constant bus already.
172 # GCN-LABEL: name: test_madak_other_constantlike_src0_f32
173 # GCN: %1:vgpr_32 = V_MAC_F32_e32 %stack.0, %0, %1, implicit $exec
175 name: test_madak_other_constantlike_src0_f32
177 - { id: 0, class: vgpr_32}
178 - { id: 1, class: vgpr_32 }
179 - { id: 2, class: vgpr_32 }
181 - { id: 0, name: "", type: default, offset: 0, size: 128, alignment: 8,
182 callee-saved-register: '', local-offset: 0, debug-info-variable: '',
183 debug-info-expression: '', debug-info-location: '' }
187 %0 = V_MOV_B32_e32 1078523331, implicit $exec
188 %1 = V_MAC_F32_e32 %stack.0, %0, %2, implicit $exec
192 # GCN-LABEL: name: test_madak_inline_literal_f16
193 # GCN: %2:vgpr_32 = V_MADAK_F16 16384, killed %0, 49664, implicit $exec
196 name: test_madak_inline_literal_f16
198 - { reg: '$vgpr0', virtual-reg: '%3' }
203 %3:vgpr_32 = COPY killed $vgpr0
205 %26:vgpr_32 = V_MOV_B32_e32 49664, implicit $exec
206 %28:vgpr_32 = V_MAC_F16_e32 16384, killed %3, %26, implicit $exec