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=GFX8 %s
12 liveins: $vgpr0, $vgpr1
13 ; GFX8-LABEL: name: fadd_s16_vvv
14 ; GFX8: liveins: $vgpr0, $vgpr1
16 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
17 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
18 ; GFX8-NEXT: %4:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
19 ; GFX8-NEXT: S_ENDPGM 0, implicit %4
20 %0:vgpr(s32) = COPY $vgpr0
21 %1:vgpr(s32) = COPY $vgpr1
22 %2:vgpr(s16) = G_TRUNC %0
23 %3:vgpr(s16) = G_TRUNC %1
24 %4:vgpr(s16) = G_FADD %2, %3
25 S_ENDPGM 0, implicit %4
37 liveins: $vgpr0, $sgpr0
38 ; GFX8-LABEL: name: fadd_s16_vsv
39 ; GFX8: liveins: $vgpr0, $sgpr0
41 ; GFX8-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
42 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
43 ; GFX8-NEXT: %4:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
44 ; GFX8-NEXT: S_ENDPGM 0, implicit %4
45 %0:sgpr(s32) = COPY $sgpr0
46 %1:vgpr(s32) = COPY $vgpr0
47 %2:sgpr(s16) = G_TRUNC %0
48 %3:vgpr(s16) = G_TRUNC %1
49 %4:vgpr(s16) = G_FADD %2, %3
50 S_ENDPGM 0, implicit %4
62 liveins: $vgpr0, $sgpr0
63 ; GFX8-LABEL: name: fadd_s16_vvs
64 ; GFX8: liveins: $vgpr0, $sgpr0
66 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
67 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
68 ; GFX8-NEXT: %4:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
69 ; GFX8-NEXT: S_ENDPGM 0, implicit %4
70 %0:vgpr(s32) = COPY $vgpr0
71 %1:sgpr(s32) = COPY $sgpr0
72 %2:vgpr(s16) = G_TRUNC %0
73 %3:sgpr(s16) = G_TRUNC %1
74 %4:vgpr(s16) = G_FADD %2, %3
75 S_ENDPGM 0, implicit %4
81 name: fadd_s16_vvv_fabs_lhs
87 liveins: $vgpr0, $vgpr1
88 ; GFX8-LABEL: name: fadd_s16_vvv_fabs_lhs
89 ; GFX8: liveins: $vgpr0, $vgpr1
91 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
92 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
93 ; GFX8-NEXT: %5:vgpr_32 = nofpexcept V_ADD_F16_e64 2, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
94 ; GFX8-NEXT: S_ENDPGM 0, implicit %5
95 %0:vgpr(s32) = COPY $vgpr0
96 %1:vgpr(s32) = COPY $vgpr1
97 %2:vgpr(s16) = G_TRUNC %0
98 %3:vgpr(s16) = G_TRUNC %1
99 %4:vgpr(s16) = G_FABS %2
100 %5:vgpr(s16) = G_FADD %4, %3
101 S_ENDPGM 0, implicit %5
107 name: fadd_s16_vvv_fabs_rhs
109 regBankSelected: true
113 liveins: $vgpr0, $vgpr1
114 ; GFX8-LABEL: name: fadd_s16_vvv_fabs_rhs
115 ; GFX8: liveins: $vgpr0, $vgpr1
117 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
118 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
119 ; GFX8-NEXT: %5:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 2, [[COPY1]], 0, 0, implicit $mode, implicit $exec
120 ; GFX8-NEXT: S_ENDPGM 0, implicit %5
121 %0:vgpr(s32) = COPY $vgpr0
122 %1:vgpr(s32) = COPY $vgpr1
123 %2:vgpr(s16) = G_TRUNC %0
124 %3:vgpr(s16) = G_TRUNC %1
125 %4:vgpr(s16) = G_FABS %3
126 %5:vgpr(s16) = G_FADD %2, %4
127 S_ENDPGM 0, implicit %5
133 name: fadd_s16_vvv_fneg_fabs_lhs
135 regBankSelected: true
139 liveins: $vgpr0, $vgpr1
140 ; GFX8-LABEL: name: fadd_s16_vvv_fneg_fabs_lhs
141 ; GFX8: liveins: $vgpr0, $vgpr1
143 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
144 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
145 ; GFX8-NEXT: %6:vgpr_32 = nofpexcept V_ADD_F16_e64 3, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
146 ; GFX8-NEXT: S_ENDPGM 0, implicit %6
147 %0:vgpr(s32) = COPY $vgpr0
148 %1:vgpr(s32) = COPY $vgpr1
149 %2:vgpr(s16) = G_TRUNC %0
150 %3:vgpr(s16) = G_TRUNC %1
151 %4:vgpr(s16) = G_FABS %2
152 %5:vgpr(s16) = G_FNEG %4
153 %6:vgpr(s16) = G_FADD %5, %3
154 S_ENDPGM 0, implicit %6
160 name: fadd_s16_vvv_fneg_fabs_rhs
162 regBankSelected: true
166 liveins: $vgpr0, $vgpr1
167 ; GFX8-LABEL: name: fadd_s16_vvv_fneg_fabs_rhs
168 ; GFX8: liveins: $vgpr0, $vgpr1
170 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
171 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
172 ; GFX8-NEXT: %6:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 3, [[COPY1]], 0, 0, implicit $mode, implicit $exec
173 ; GFX8-NEXT: S_ENDPGM 0, implicit %6
174 %0:vgpr(s32) = COPY $vgpr0
175 %1:vgpr(s32) = COPY $vgpr1
176 %2:vgpr(s16) = G_TRUNC %0
177 %3:vgpr(s16) = G_TRUNC %1
178 %4:vgpr(s16) = G_FABS %3
179 %5:vgpr(s16) = G_FNEG %4
180 %6:vgpr(s16) = G_FADD %2, %5
181 S_ENDPGM 0, implicit %6
187 name: fadd_s16_fneg_copy_sgpr
189 regBankSelected: true
193 liveins: $vgpr0, $sgpr0
194 ; GFX8-LABEL: name: fadd_s16_fneg_copy_sgpr
195 ; GFX8: liveins: $vgpr0, $sgpr0
197 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
198 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
199 ; GFX8-NEXT: %5:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 1, [[COPY1]], 0, 0, implicit $mode, implicit $exec
200 ; GFX8-NEXT: S_ENDPGM 0, implicit %5
201 %0:vgpr(s32) = COPY $vgpr0
202 %1:sgpr(s32) = COPY $sgpr0
203 %2:vgpr(s16) = G_TRUNC %0
204 %3:sgpr(s16) = G_TRUNC %1
205 %4:sgpr(s16) = G_FNEG %3
206 %5:vgpr(s16) = G_FADD %2, %4
207 S_ENDPGM 0, implicit %5