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
3
4---
5
6name:            fadd_s16_vvv
7legalized:       true
8regBankSelected: true
9
10body: |
11  bb.0:
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
24
25...
26
27---
28
29name:            fadd_s16_vsv
30legalized:       true
31regBankSelected: true
32
33body: |
34  bb.0:
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
47
48...
49
50---
51
52name:            fadd_s16_vvs
53legalized:       true
54regBankSelected: true
55
56body: |
57  bb.0:
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
70
71...
72
73---
74
75name:            fadd_s16_vvv_fabs_lhs
76legalized:       true
77regBankSelected: true
78
79body: |
80  bb.0:
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
94
95...
96
97---
98
99name:            fadd_s16_vvv_fabs_rhs
100legalized:       true
101regBankSelected: true
102
103body: |
104  bb.0:
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
118
119...
120
121---
122
123name:            fadd_s16_vvv_fneg_fabs_lhs
124legalized:       true
125regBankSelected: true
126
127body: |
128  bb.0:
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
143
144...
145
146---
147
148name:            fadd_s16_vvv_fneg_fabs_rhs
149legalized:       true
150regBankSelected: true
151
152body: |
153  bb.0:
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
168
169...
170
171---
172
173name:            fadd_s16_fneg_copy_sgpr
174legalized:       true
175regBankSelected: true
176
177body: |
178  bb.0:
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
192
193...
194