1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX6 %s
3 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX10 %s
13 liveins: $vgpr0, $vgpr1, $vgpr2
15 ; GFX6-LABEL: name: fmad_f32
16 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
17 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
18 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
19 ; GFX6: [[V_MAC_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAC_F32_e64 0, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec
20 ; GFX6: S_ENDPGM 0, implicit [[V_MAC_F32_e64_]]
21 ; GFX10-LABEL: name: fmad_f32
22 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
23 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
24 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
25 ; GFX10: [[V_MAC_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAC_F32_e64 0, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec
26 ; GFX10: S_ENDPGM 0, implicit [[V_MAC_F32_e64_]]
27 %0:vgpr(s32) = COPY $vgpr0
28 %1:vgpr(s32) = COPY $vgpr1
29 %2:vgpr(s32) = COPY $vgpr2
30 %3:vgpr(s32) = G_FMAD %0, %1, %2
31 S_ENDPGM 0, implicit %3
37 name: fmad_f32_fneg_src0
43 liveins: $vgpr0, $vgpr1, $vgpr2
45 ; GFX6-LABEL: name: fmad_f32_fneg_src0
46 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
47 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
48 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
49 ; GFX6: [[V_MAD_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAD_F32_e64 1, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec
50 ; GFX6: S_ENDPGM 0, implicit [[V_MAD_F32_e64_]]
51 ; GFX10-LABEL: name: fmad_f32_fneg_src0
52 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
53 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
54 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
55 ; GFX10: [[V_MAD_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAD_F32_e64 1, [[COPY]], 0, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec
56 ; GFX10: S_ENDPGM 0, implicit [[V_MAD_F32_e64_]]
57 %0:vgpr(s32) = COPY $vgpr0
58 %1:vgpr(s32) = COPY $vgpr1
59 %2:vgpr(s32) = COPY $vgpr2
60 %3:vgpr(s32) = G_FNEG %0
61 %4:vgpr(s32) = G_FMAD %3, %1, %2
62 S_ENDPGM 0, implicit %4
68 name: fmad_f32_fneg_src1
74 liveins: $vgpr0, $vgpr1, $vgpr2
76 ; GFX6-LABEL: name: fmad_f32_fneg_src1
77 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
78 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
79 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
80 ; GFX6: [[V_MAD_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAD_F32_e64 0, [[COPY]], 1, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec
81 ; GFX6: S_ENDPGM 0, implicit [[V_MAD_F32_e64_]]
82 ; GFX10-LABEL: name: fmad_f32_fneg_src1
83 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
84 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
85 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
86 ; GFX10: [[V_MAD_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAD_F32_e64 0, [[COPY]], 1, [[COPY1]], 0, [[COPY2]], 0, 0, implicit $mode, implicit $exec
87 ; GFX10: S_ENDPGM 0, implicit [[V_MAD_F32_e64_]]
88 %0:vgpr(s32) = COPY $vgpr0
89 %1:vgpr(s32) = COPY $vgpr1
90 %2:vgpr(s32) = COPY $vgpr2
91 %3:vgpr(s32) = G_FNEG %1
92 %4:vgpr(s32) = G_FMAD %0, %3, %2
93 S_ENDPGM 0, implicit %4
99 name: fmad_f32_fneg_src2
101 regBankSelected: true
105 liveins: $vgpr0, $vgpr1, $vgpr2
107 ; GFX6-LABEL: name: fmad_f32_fneg_src2
108 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
109 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
110 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
111 ; GFX6: [[V_MAD_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAD_F32_e64 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec
112 ; GFX6: S_ENDPGM 0, implicit [[V_MAD_F32_e64_]]
113 ; GFX10-LABEL: name: fmad_f32_fneg_src2
114 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
115 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
116 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
117 ; GFX10: [[V_MAD_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAD_F32_e64 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec
118 ; GFX10: S_ENDPGM 0, implicit [[V_MAD_F32_e64_]]
119 %0:vgpr(s32) = COPY $vgpr0
120 %1:vgpr(s32) = COPY $vgpr1
121 %2:vgpr(s32) = COPY $vgpr2
122 %3:vgpr(s32) = G_FNEG %2
123 %4:vgpr(s32) = G_FMAD %0, %1, %3
124 S_ENDPGM 0, implicit %4
130 name: fmad_f32_fabs_src2
132 regBankSelected: true
136 liveins: $vgpr0, $vgpr1, $vgpr2
138 ; GFX6-LABEL: name: fmad_f32_fabs_src2
139 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
140 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
141 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
142 ; GFX6: [[V_MAD_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAD_F32_e64 0, [[COPY]], 0, [[COPY1]], 2, [[COPY2]], 0, 0, implicit $mode, implicit $exec
143 ; GFX6: S_ENDPGM 0, implicit [[V_MAD_F32_e64_]]
144 ; GFX10-LABEL: name: fmad_f32_fabs_src2
145 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
146 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
147 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
148 ; GFX10: [[V_MAD_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAD_F32_e64 0, [[COPY]], 0, [[COPY1]], 2, [[COPY2]], 0, 0, implicit $mode, implicit $exec
149 ; GFX10: S_ENDPGM 0, implicit [[V_MAD_F32_e64_]]
150 %0:vgpr(s32) = COPY $vgpr0
151 %1:vgpr(s32) = COPY $vgpr1
152 %2:vgpr(s32) = COPY $vgpr2
153 %3:vgpr(s32) = G_FABS %2
154 %4:vgpr(s32) = G_FMAD %0, %1, %3
155 S_ENDPGM 0, implicit %4
161 name: fmad_f32_copy_fneg_src2
163 regBankSelected: true
167 liveins: $vgpr0, $vgpr1, $vgpr2
169 ; GFX6-LABEL: name: fmad_f32_copy_fneg_src2
170 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
171 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
172 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
173 ; GFX6: [[V_MAD_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAD_F32_e64 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec
174 ; GFX6: S_ENDPGM 0, implicit [[V_MAD_F32_e64_]]
175 ; GFX10-LABEL: name: fmad_f32_copy_fneg_src2
176 ; GFX10: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
177 ; GFX10: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
178 ; GFX10: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
179 ; GFX10: [[V_MAD_F32_e64_:%[0-9]+]]:vgpr_32 = V_MAD_F32_e64 0, [[COPY]], 0, [[COPY1]], 1, [[COPY2]], 0, 0, implicit $mode, implicit $exec
180 ; GFX10: S_ENDPGM 0, implicit [[V_MAD_F32_e64_]]
181 %0:vgpr(s32) = COPY $vgpr0
182 %1:vgpr(s32) = COPY $vgpr1
183 %2:vgpr(s32) = COPY $vgpr2
184 %3:vgpr(s32) = G_FNEG %2
185 %4:vgpr(s32) = COPY %3
186 %5:vgpr(s32) = G_FMAD %0, %1, %4
187 S_ENDPGM 0, implicit %5