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: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
15 ; GFX8: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
16 ; GFX8: %4:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
17 ; GFX8: S_ENDPGM 0, implicit %4
18 %0:vgpr(s32) = COPY $vgpr0
19 %1:vgpr(s32) = COPY $vgpr1
20 %2:vgpr(s16) = G_TRUNC %0
21 %3:vgpr(s16) = G_TRUNC %1
22 %4:vgpr(s16) = G_FADD %2, %3
23 S_ENDPGM 0, implicit %4
35 liveins: $vgpr0, $sgpr0
36 ; GFX8-LABEL: name: fadd_s16_vsv
37 ; GFX8: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
38 ; GFX8: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
39 ; GFX8: %4:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
40 ; GFX8: S_ENDPGM 0, implicit %4
41 %0:sgpr(s32) = COPY $sgpr0
42 %1:vgpr(s32) = COPY $vgpr0
43 %2:sgpr(s16) = G_TRUNC %0
44 %3:vgpr(s16) = G_TRUNC %1
45 %4:vgpr(s16) = G_FADD %2, %3
46 S_ENDPGM 0, implicit %4
58 liveins: $vgpr0, $sgpr0
59 ; GFX8-LABEL: name: fadd_s16_vvs
60 ; GFX8: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
61 ; GFX8: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
62 ; GFX8: %4:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
63 ; GFX8: S_ENDPGM 0, implicit %4
64 %0:vgpr(s32) = COPY $vgpr0
65 %1:sgpr(s32) = COPY $sgpr0
66 %2:vgpr(s16) = G_TRUNC %0
67 %3:sgpr(s16) = G_TRUNC %1
68 %4:vgpr(s16) = G_FADD %2, %3
69 S_ENDPGM 0, implicit %4
75 name: fadd_s16_vvv_fabs_lhs
81 liveins: $vgpr0, $vgpr1
82 ; GFX8-LABEL: name: fadd_s16_vvv_fabs_lhs
83 ; GFX8: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
84 ; GFX8: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
85 ; GFX8: %5:vgpr_32 = nofpexcept V_ADD_F16_e64 2, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
86 ; GFX8: S_ENDPGM 0, implicit %5
87 %0:vgpr(s32) = COPY $vgpr0
88 %1:vgpr(s32) = COPY $vgpr1
89 %2:vgpr(s16) = G_TRUNC %0
90 %3:vgpr(s16) = G_TRUNC %1
91 %4:vgpr(s16) = G_FABS %2
92 %5:vgpr(s16) = G_FADD %4, %3
93 S_ENDPGM 0, implicit %5
99 name: fadd_s16_vvv_fabs_rhs
101 regBankSelected: true
105 liveins: $vgpr0, $vgpr1
106 ; GFX8-LABEL: name: fadd_s16_vvv_fabs_rhs
107 ; GFX8: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
108 ; GFX8: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
109 ; GFX8: %5:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 2, [[COPY1]], 0, 0, implicit $mode, implicit $exec
110 ; GFX8: S_ENDPGM 0, implicit %5
111 %0:vgpr(s32) = COPY $vgpr0
112 %1:vgpr(s32) = COPY $vgpr1
113 %2:vgpr(s16) = G_TRUNC %0
114 %3:vgpr(s16) = G_TRUNC %1
115 %4:vgpr(s16) = G_FABS %3
116 %5:vgpr(s16) = G_FADD %2, %4
117 S_ENDPGM 0, implicit %5
123 name: fadd_s16_vvv_fneg_fabs_lhs
125 regBankSelected: true
129 liveins: $vgpr0, $vgpr1
130 ; GFX8-LABEL: name: fadd_s16_vvv_fneg_fabs_lhs
131 ; GFX8: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
132 ; GFX8: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
133 ; GFX8: %6:vgpr_32 = nofpexcept V_ADD_F16_e64 3, [[COPY]], 0, [[COPY1]], 0, 0, implicit $mode, implicit $exec
134 ; GFX8: S_ENDPGM 0, implicit %6
135 %0:vgpr(s32) = COPY $vgpr0
136 %1:vgpr(s32) = COPY $vgpr1
137 %2:vgpr(s16) = G_TRUNC %0
138 %3:vgpr(s16) = G_TRUNC %1
139 %4:vgpr(s16) = G_FABS %2
140 %5:vgpr(s16) = G_FNEG %4
141 %6:vgpr(s16) = G_FADD %5, %3
142 S_ENDPGM 0, implicit %6
148 name: fadd_s16_vvv_fneg_fabs_rhs
150 regBankSelected: true
154 liveins: $vgpr0, $vgpr1
155 ; GFX8-LABEL: name: fadd_s16_vvv_fneg_fabs_rhs
156 ; GFX8: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
157 ; GFX8: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
158 ; GFX8: %6:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 3, [[COPY1]], 0, 0, implicit $mode, implicit $exec
159 ; GFX8: S_ENDPGM 0, implicit %6
160 %0:vgpr(s32) = COPY $vgpr0
161 %1:vgpr(s32) = COPY $vgpr1
162 %2:vgpr(s16) = G_TRUNC %0
163 %3:vgpr(s16) = G_TRUNC %1
164 %4:vgpr(s16) = G_FABS %3
165 %5:vgpr(s16) = G_FNEG %4
166 %6:vgpr(s16) = G_FADD %2, %5
167 S_ENDPGM 0, implicit %6
173 name: fadd_s16_fneg_copy_sgpr
175 regBankSelected: true
179 liveins: $vgpr0, $sgpr0
180 ; GFX8-LABEL: name: fadd_s16_fneg_copy_sgpr
181 ; GFX8: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
182 ; GFX8: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
183 ; GFX8: %5:vgpr_32 = nofpexcept V_ADD_F16_e64 0, [[COPY]], 1, [[COPY1]], 0, 0, implicit $mode, implicit $exec
184 ; GFX8: S_ENDPGM 0, implicit %5
185 %0:vgpr(s32) = COPY $vgpr0
186 %1:sgpr(s32) = COPY $sgpr0
187 %2:vgpr(s16) = G_TRUNC %0
188 %3:sgpr(s16) = G_TRUNC %1
189 %4:sgpr(s16) = G_FNEG %3
190 %5:vgpr(s16) = G_FADD %2, %4
191 S_ENDPGM 0, implicit %5