• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -run-pass=legalizer -global-isel-abort=0 -o - %s  | FileCheck -check-prefix=SI  %s
3# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer -global-isel-abort=0 -o - %s | FileCheck -check-prefix=VI %s
4# RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -run-pass=legalizer -global-isel-abort=0 -o - %s  | FileCheck -check-prefix=GFX9  %s
5
6
7---
8name: test_fabs_s32
9body: |
10  bb.0:
11    liveins: $vgpr0
12
13    ; SI-LABEL: name: test_fabs_s32
14    ; SI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
15    ; SI: [[FABS:%[0-9]+]]:_(s32) = G_FABS [[COPY]]
16    ; SI: $vgpr0 = COPY [[FABS]](s32)
17    ; VI-LABEL: name: test_fabs_s32
18    ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
19    ; VI: [[FABS:%[0-9]+]]:_(s32) = G_FABS [[COPY]]
20    ; VI: $vgpr0 = COPY [[FABS]](s32)
21    ; GFX9-LABEL: name: test_fabs_s32
22    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
23    ; GFX9: [[FABS:%[0-9]+]]:_(s32) = G_FABS [[COPY]]
24    ; GFX9: $vgpr0 = COPY [[FABS]](s32)
25    %0:_(s32) = COPY $vgpr0
26    %1:_(s32) = G_FABS %0
27    $vgpr0 = COPY %1
28
29...
30---
31name: test_fabs_s64
32body: |
33  bb.0:
34    liveins: $vgpr0
35
36    ; SI-LABEL: name: test_fabs_s64
37    ; SI: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
38    ; SI: [[FABS:%[0-9]+]]:_(s64) = G_FABS [[COPY]]
39    ; SI: $vgpr0_vgpr1 = COPY [[FABS]](s64)
40    ; VI-LABEL: name: test_fabs_s64
41    ; VI: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
42    ; VI: [[FABS:%[0-9]+]]:_(s64) = G_FABS [[COPY]]
43    ; VI: $vgpr0_vgpr1 = COPY [[FABS]](s64)
44    ; GFX9-LABEL: name: test_fabs_s64
45    ; GFX9: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1
46    ; GFX9: [[FABS:%[0-9]+]]:_(s64) = G_FABS [[COPY]]
47    ; GFX9: $vgpr0_vgpr1 = COPY [[FABS]](s64)
48    %0:_(s64) = COPY $vgpr0_vgpr1
49    %1:_(s64) = G_FABS %0
50    $vgpr0_vgpr1 = COPY %1
51...
52---
53name: test_fabs_s16
54body: |
55  bb.0:
56    liveins: $vgpr0
57
58    ; SI-LABEL: name: test_fabs_s16
59    ; SI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
60    ; SI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
61    ; SI: [[FABS:%[0-9]+]]:_(s16) = G_FABS [[TRUNC]]
62    ; SI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FABS]](s16)
63    ; SI: $vgpr0 = COPY [[ANYEXT]](s32)
64    ; VI-LABEL: name: test_fabs_s16
65    ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
66    ; VI: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
67    ; VI: [[FABS:%[0-9]+]]:_(s16) = G_FABS [[TRUNC]]
68    ; VI: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FABS]](s16)
69    ; VI: $vgpr0 = COPY [[ANYEXT]](s32)
70    ; GFX9-LABEL: name: test_fabs_s16
71    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0
72    ; GFX9: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
73    ; GFX9: [[FABS:%[0-9]+]]:_(s16) = G_FABS [[TRUNC]]
74    ; GFX9: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FABS]](s16)
75    ; GFX9: $vgpr0 = COPY [[ANYEXT]](s32)
76    %0:_(s32) = COPY $vgpr0
77    %1:_(s16) = G_TRUNC %0
78    %2:_(s16) = G_FABS %1
79    %3:_(s32) = G_ANYEXT %2
80    $vgpr0 = COPY %3
81...
82
83---
84name: test_fabs_v2s32
85body: |
86  bb.0:
87    liveins: $vgpr0_vgpr1
88
89    ; SI-LABEL: name: test_fabs_v2s32
90    ; SI: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
91    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
92    ; SI: [[FABS:%[0-9]+]]:_(s32) = G_FABS [[UV]]
93    ; SI: [[FABS1:%[0-9]+]]:_(s32) = G_FABS [[UV1]]
94    ; SI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[FABS]](s32), [[FABS1]](s32)
95    ; SI: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
96    ; VI-LABEL: name: test_fabs_v2s32
97    ; VI: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
98    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
99    ; VI: [[FABS:%[0-9]+]]:_(s32) = G_FABS [[UV]]
100    ; VI: [[FABS1:%[0-9]+]]:_(s32) = G_FABS [[UV1]]
101    ; VI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[FABS]](s32), [[FABS1]](s32)
102    ; VI: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
103    ; GFX9-LABEL: name: test_fabs_v2s32
104    ; GFX9: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1
105    ; GFX9: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
106    ; GFX9: [[FABS:%[0-9]+]]:_(s32) = G_FABS [[UV]]
107    ; GFX9: [[FABS1:%[0-9]+]]:_(s32) = G_FABS [[UV1]]
108    ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[FABS]](s32), [[FABS1]](s32)
109    ; GFX9: $vgpr0_vgpr1 = COPY [[BUILD_VECTOR]](<2 x s32>)
110    %0:_(<2 x s32>) = COPY $vgpr0_vgpr1
111    %1:_(<2 x s32>) = G_FABS %0
112    $vgpr0_vgpr1 = COPY %1
113...
114
115---
116name: test_fabs_v3s32
117body: |
118  bb.0:
119    liveins: $vgpr0_vgpr1_vgpr2
120
121    ; SI-LABEL: name: test_fabs_v3s32
122    ; SI: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
123    ; SI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
124    ; SI: [[FABS:%[0-9]+]]:_(s32) = G_FABS [[UV]]
125    ; SI: [[FABS1:%[0-9]+]]:_(s32) = G_FABS [[UV1]]
126    ; SI: [[FABS2:%[0-9]+]]:_(s32) = G_FABS [[UV2]]
127    ; SI: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[FABS]](s32), [[FABS1]](s32), [[FABS2]](s32)
128    ; SI: $vgpr0_vgpr1_vgpr2 = COPY [[BUILD_VECTOR]](<3 x s32>)
129    ; VI-LABEL: name: test_fabs_v3s32
130    ; VI: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
131    ; VI: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
132    ; VI: [[FABS:%[0-9]+]]:_(s32) = G_FABS [[UV]]
133    ; VI: [[FABS1:%[0-9]+]]:_(s32) = G_FABS [[UV1]]
134    ; VI: [[FABS2:%[0-9]+]]:_(s32) = G_FABS [[UV2]]
135    ; VI: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[FABS]](s32), [[FABS1]](s32), [[FABS2]](s32)
136    ; VI: $vgpr0_vgpr1_vgpr2 = COPY [[BUILD_VECTOR]](<3 x s32>)
137    ; GFX9-LABEL: name: test_fabs_v3s32
138    ; GFX9: [[COPY:%[0-9]+]]:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
139    ; GFX9: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32), [[UV2:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<3 x s32>)
140    ; GFX9: [[FABS:%[0-9]+]]:_(s32) = G_FABS [[UV]]
141    ; GFX9: [[FABS1:%[0-9]+]]:_(s32) = G_FABS [[UV1]]
142    ; GFX9: [[FABS2:%[0-9]+]]:_(s32) = G_FABS [[UV2]]
143    ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<3 x s32>) = G_BUILD_VECTOR [[FABS]](s32), [[FABS1]](s32), [[FABS2]](s32)
144    ; GFX9: $vgpr0_vgpr1_vgpr2 = COPY [[BUILD_VECTOR]](<3 x s32>)
145    %0:_(<3 x s32>) = COPY $vgpr0_vgpr1_vgpr2
146    %1:_(<3 x  s32>) = G_FABS %0
147    $vgpr0_vgpr1_vgpr2 = COPY %1
148...
149
150---
151name: test_fabs_v2s64
152body: |
153  bb.0:
154    liveins: $vgpr0_vgpr1_vgpr2_vgpr3
155
156    ; SI-LABEL: name: test_fabs_v2s64
157    ; SI: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
158    ; SI: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
159    ; SI: [[FABS:%[0-9]+]]:_(s64) = G_FABS [[UV]]
160    ; SI: [[FABS1:%[0-9]+]]:_(s64) = G_FABS [[UV1]]
161    ; SI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[FABS]](s64), [[FABS1]](s64)
162    ; SI: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>)
163    ; VI-LABEL: name: test_fabs_v2s64
164    ; VI: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
165    ; VI: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
166    ; VI: [[FABS:%[0-9]+]]:_(s64) = G_FABS [[UV]]
167    ; VI: [[FABS1:%[0-9]+]]:_(s64) = G_FABS [[UV1]]
168    ; VI: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[FABS]](s64), [[FABS1]](s64)
169    ; VI: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>)
170    ; GFX9-LABEL: name: test_fabs_v2s64
171    ; GFX9: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
172    ; GFX9: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>)
173    ; GFX9: [[FABS:%[0-9]+]]:_(s64) = G_FABS [[UV]]
174    ; GFX9: [[FABS1:%[0-9]+]]:_(s64) = G_FABS [[UV1]]
175    ; GFX9: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[FABS]](s64), [[FABS1]](s64)
176    ; GFX9: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x s64>)
177    %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3
178    %1:_(<2 x s64>) = G_FABS %0
179    $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1
180...
181
182---
183name: test_fabs_v2s16
184body: |
185  bb.0:
186    liveins: $vgpr0
187
188    ; SI-LABEL: name: test_fabs_v2s16
189    ; SI: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
190    ; SI: [[FABS:%[0-9]+]]:_(<2 x s16>) = G_FABS [[COPY]]
191    ; SI: $vgpr0 = COPY [[FABS]](<2 x s16>)
192    ; VI-LABEL: name: test_fabs_v2s16
193    ; VI: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
194    ; VI: [[FABS:%[0-9]+]]:_(<2 x s16>) = G_FABS [[COPY]]
195    ; VI: $vgpr0 = COPY [[FABS]](<2 x s16>)
196    ; GFX9-LABEL: name: test_fabs_v2s16
197    ; GFX9: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $vgpr0
198    ; GFX9: [[FABS:%[0-9]+]]:_(<2 x s16>) = G_FABS [[COPY]]
199    ; GFX9: $vgpr0 = COPY [[FABS]](<2 x s16>)
200    %0:_(<2 x s16>) = COPY $vgpr0
201    %1:_(<2 x s16>) = G_FABS %0
202    $vgpr0 = COPY %1
203...
204
205---
206name: test_fabs_v3s16
207body: |
208  bb.0:
209
210    ; SI-LABEL: name: test_fabs_v3s16
211    ; SI: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
212    ; SI: [[DEF1:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
213    ; SI: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[DEF]](<4 x s16>)
214    ; SI: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
215    ; SI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
216    ; SI: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
217    ; SI: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
218    ; SI: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
219    ; SI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
220    ; SI: [[COPY:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
221    ; SI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]]
222    ; SI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
223    ; SI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
224    ; SI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C]](s32)
225    ; SI: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
226    ; SI: [[BITCAST2:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
227    ; SI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
228    ; SI: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
229    ; SI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
230    ; SI: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[C2]], [[C]](s32)
231    ; SI: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]]
232    ; SI: [[BITCAST3:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32)
233    ; SI: [[DEF2:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF
234    ; SI: [[FABS:%[0-9]+]]:_(<2 x s16>) = G_FABS [[BITCAST2]]
235    ; SI: [[FABS1:%[0-9]+]]:_(<2 x s16>) = G_FABS [[BITCAST3]]
236    ; SI: [[BITCAST4:%[0-9]+]]:_(s32) = G_BITCAST [[FABS]](<2 x s16>)
237    ; SI: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST4]], [[C]](s32)
238    ; SI: [[BITCAST5:%[0-9]+]]:_(s32) = G_BITCAST [[FABS1]](<2 x s16>)
239    ; SI: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST5]], [[C]](s32)
240    ; SI: [[BITCAST6:%[0-9]+]]:_(s32) = G_BITCAST [[FABS]](<2 x s16>)
241    ; SI: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST6]], [[C]](s32)
242    ; SI: [[BITCAST7:%[0-9]+]]:_(s32) = G_BITCAST [[FABS1]](<2 x s16>)
243    ; SI: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST7]], [[C]](s32)
244    ; SI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST4]](s32)
245    ; SI: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C1]]
246    ; SI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
247    ; SI: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C1]]
248    ; SI: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND4]], [[C]](s32)
249    ; SI: [[OR2:%[0-9]+]]:_(s32) = G_OR [[AND3]], [[SHL2]]
250    ; SI: [[BITCAST8:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR2]](s32)
251    ; SI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[BITCAST5]](s32)
252    ; SI: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C1]]
253    ; SI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[BITCAST6]](s32)
254    ; SI: [[AND6:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C1]]
255    ; SI: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[AND6]], [[C]](s32)
256    ; SI: [[OR3:%[0-9]+]]:_(s32) = G_OR [[AND5]], [[SHL3]]
257    ; SI: [[BITCAST9:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR3]](s32)
258    ; SI: [[COPY7:%[0-9]+]]:_(s32) = COPY [[LSHR4]](s32)
259    ; SI: [[AND7:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C1]]
260    ; SI: [[COPY8:%[0-9]+]]:_(s32) = COPY [[BITCAST7]](s32)
261    ; SI: [[AND8:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C1]]
262    ; SI: [[SHL4:%[0-9]+]]:_(s32) = G_SHL [[AND8]], [[C]](s32)
263    ; SI: [[OR4:%[0-9]+]]:_(s32) = G_OR [[AND7]], [[SHL4]]
264    ; SI: [[BITCAST10:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR4]](s32)
265    ; SI: [[CONCAT_VECTORS:%[0-9]+]]:_(<6 x s16>) = G_CONCAT_VECTORS [[BITCAST8]](<2 x s16>), [[BITCAST9]](<2 x s16>), [[BITCAST10]](<2 x s16>)
266    ; SI: S_NOP 0, implicit [[CONCAT_VECTORS]](<6 x s16>)
267    ; VI-LABEL: name: test_fabs_v3s16
268    ; VI: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
269    ; VI: [[DEF1:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
270    ; VI: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[DEF]](<4 x s16>)
271    ; VI: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
272    ; VI: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
273    ; VI: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
274    ; VI: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
275    ; VI: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
276    ; VI: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
277    ; VI: [[COPY:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
278    ; VI: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]]
279    ; VI: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
280    ; VI: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
281    ; VI: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[AND1]], [[C]](s32)
282    ; VI: [[OR:%[0-9]+]]:_(s32) = G_OR [[AND]], [[SHL]]
283    ; VI: [[BITCAST2:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR]](s32)
284    ; VI: [[COPY2:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
285    ; VI: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
286    ; VI: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
287    ; VI: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[C2]], [[C]](s32)
288    ; VI: [[OR1:%[0-9]+]]:_(s32) = G_OR [[AND2]], [[SHL1]]
289    ; VI: [[BITCAST3:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR1]](s32)
290    ; VI: [[DEF2:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF
291    ; VI: [[FABS:%[0-9]+]]:_(<2 x s16>) = G_FABS [[BITCAST2]]
292    ; VI: [[FABS1:%[0-9]+]]:_(<2 x s16>) = G_FABS [[BITCAST3]]
293    ; VI: [[BITCAST4:%[0-9]+]]:_(s32) = G_BITCAST [[FABS]](<2 x s16>)
294    ; VI: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST4]], [[C]](s32)
295    ; VI: [[BITCAST5:%[0-9]+]]:_(s32) = G_BITCAST [[FABS1]](<2 x s16>)
296    ; VI: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST5]], [[C]](s32)
297    ; VI: [[BITCAST6:%[0-9]+]]:_(s32) = G_BITCAST [[FABS]](<2 x s16>)
298    ; VI: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST6]], [[C]](s32)
299    ; VI: [[BITCAST7:%[0-9]+]]:_(s32) = G_BITCAST [[FABS1]](<2 x s16>)
300    ; VI: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST7]], [[C]](s32)
301    ; VI: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST4]](s32)
302    ; VI: [[AND3:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C1]]
303    ; VI: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
304    ; VI: [[AND4:%[0-9]+]]:_(s32) = G_AND [[COPY4]], [[C1]]
305    ; VI: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[AND4]], [[C]](s32)
306    ; VI: [[OR2:%[0-9]+]]:_(s32) = G_OR [[AND3]], [[SHL2]]
307    ; VI: [[BITCAST8:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR2]](s32)
308    ; VI: [[COPY5:%[0-9]+]]:_(s32) = COPY [[BITCAST5]](s32)
309    ; VI: [[AND5:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C1]]
310    ; VI: [[COPY6:%[0-9]+]]:_(s32) = COPY [[BITCAST6]](s32)
311    ; VI: [[AND6:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C1]]
312    ; VI: [[SHL3:%[0-9]+]]:_(s32) = G_SHL [[AND6]], [[C]](s32)
313    ; VI: [[OR3:%[0-9]+]]:_(s32) = G_OR [[AND5]], [[SHL3]]
314    ; VI: [[BITCAST9:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR3]](s32)
315    ; VI: [[COPY7:%[0-9]+]]:_(s32) = COPY [[LSHR4]](s32)
316    ; VI: [[AND7:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C1]]
317    ; VI: [[COPY8:%[0-9]+]]:_(s32) = COPY [[BITCAST7]](s32)
318    ; VI: [[AND8:%[0-9]+]]:_(s32) = G_AND [[COPY8]], [[C1]]
319    ; VI: [[SHL4:%[0-9]+]]:_(s32) = G_SHL [[AND8]], [[C]](s32)
320    ; VI: [[OR4:%[0-9]+]]:_(s32) = G_OR [[AND7]], [[SHL4]]
321    ; VI: [[BITCAST10:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[OR4]](s32)
322    ; VI: [[CONCAT_VECTORS:%[0-9]+]]:_(<6 x s16>) = G_CONCAT_VECTORS [[BITCAST8]](<2 x s16>), [[BITCAST9]](<2 x s16>), [[BITCAST10]](<2 x s16>)
323    ; VI: S_NOP 0, implicit [[CONCAT_VECTORS]](<6 x s16>)
324    ; GFX9-LABEL: name: test_fabs_v3s16
325    ; GFX9: [[DEF:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
326    ; GFX9: [[DEF1:%[0-9]+]]:_(<4 x s16>) = G_IMPLICIT_DEF
327    ; GFX9: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[DEF]](<4 x s16>)
328    ; GFX9: [[BITCAST:%[0-9]+]]:_(s32) = G_BITCAST [[UV]](<2 x s16>)
329    ; GFX9: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
330    ; GFX9: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST]], [[C]](s32)
331    ; GFX9: [[BITCAST1:%[0-9]+]]:_(s32) = G_BITCAST [[UV1]](<2 x s16>)
332    ; GFX9: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST1]], [[C]](s32)
333    ; GFX9: [[COPY:%[0-9]+]]:_(s32) = COPY [[BITCAST]](s32)
334    ; GFX9: [[COPY1:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
335    ; GFX9: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY]](s32), [[COPY1]](s32)
336    ; GFX9: [[COPY2:%[0-9]+]]:_(s32) = COPY [[BITCAST1]](s32)
337    ; GFX9: [[DEF2:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
338    ; GFX9: [[BUILD_VECTOR_TRUNC1:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY2]](s32), [[DEF2]](s32)
339    ; GFX9: [[DEF3:%[0-9]+]]:_(<2 x s16>) = G_IMPLICIT_DEF
340    ; GFX9: [[FABS:%[0-9]+]]:_(<2 x s16>) = G_FABS [[BUILD_VECTOR_TRUNC]]
341    ; GFX9: [[FABS1:%[0-9]+]]:_(<2 x s16>) = G_FABS [[BUILD_VECTOR_TRUNC1]]
342    ; GFX9: [[BITCAST2:%[0-9]+]]:_(s32) = G_BITCAST [[FABS]](<2 x s16>)
343    ; GFX9: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST2]], [[C]](s32)
344    ; GFX9: [[BITCAST3:%[0-9]+]]:_(s32) = G_BITCAST [[FABS1]](<2 x s16>)
345    ; GFX9: [[LSHR3:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST3]], [[C]](s32)
346    ; GFX9: [[BITCAST4:%[0-9]+]]:_(s32) = G_BITCAST [[FABS]](<2 x s16>)
347    ; GFX9: [[LSHR4:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST4]], [[C]](s32)
348    ; GFX9: [[BITCAST5:%[0-9]+]]:_(s32) = G_BITCAST [[FABS1]](<2 x s16>)
349    ; GFX9: [[LSHR5:%[0-9]+]]:_(s32) = G_LSHR [[BITCAST5]], [[C]](s32)
350    ; GFX9: [[COPY3:%[0-9]+]]:_(s32) = COPY [[BITCAST2]](s32)
351    ; GFX9: [[COPY4:%[0-9]+]]:_(s32) = COPY [[LSHR2]](s32)
352    ; GFX9: [[BUILD_VECTOR_TRUNC2:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY3]](s32), [[COPY4]](s32)
353    ; GFX9: [[COPY5:%[0-9]+]]:_(s32) = COPY [[BITCAST3]](s32)
354    ; GFX9: [[COPY6:%[0-9]+]]:_(s32) = COPY [[BITCAST4]](s32)
355    ; GFX9: [[BUILD_VECTOR_TRUNC3:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY5]](s32), [[COPY6]](s32)
356    ; GFX9: [[COPY7:%[0-9]+]]:_(s32) = COPY [[LSHR4]](s32)
357    ; GFX9: [[COPY8:%[0-9]+]]:_(s32) = COPY [[BITCAST5]](s32)
358    ; GFX9: [[BUILD_VECTOR_TRUNC4:%[0-9]+]]:_(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[COPY7]](s32), [[COPY8]](s32)
359    ; GFX9: [[CONCAT_VECTORS:%[0-9]+]]:_(<6 x s16>) = G_CONCAT_VECTORS [[BUILD_VECTOR_TRUNC2]](<2 x s16>), [[BUILD_VECTOR_TRUNC3]](<2 x s16>), [[BUILD_VECTOR_TRUNC4]](<2 x s16>)
360    ; GFX9: S_NOP 0, implicit [[CONCAT_VECTORS]](<6 x s16>)
361    %0:_(<3 x s16>) = G_IMPLICIT_DEF
362    %1:_(<3 x s16>) = G_FABS %0
363    %2:_(<6 x s16>) = G_CONCAT_VECTORS %1, %1
364    S_NOP 0, implicit %2
365...
366
367---
368name: test_fabs_v4s16
369body: |
370  bb.0:
371    liveins: $vgpr0_vgpr1
372
373    ; SI-LABEL: name: test_fabs_v4s16
374    ; SI: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
375    ; SI: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
376    ; SI: [[FABS:%[0-9]+]]:_(<2 x s16>) = G_FABS [[UV]]
377    ; SI: [[FABS1:%[0-9]+]]:_(<2 x s16>) = G_FABS [[UV1]]
378    ; SI: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[FABS]](<2 x s16>), [[FABS1]](<2 x s16>)
379    ; SI: $vgpr0_vgpr1 = COPY [[CONCAT_VECTORS]](<4 x s16>)
380    ; VI-LABEL: name: test_fabs_v4s16
381    ; VI: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
382    ; VI: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
383    ; VI: [[FABS:%[0-9]+]]:_(<2 x s16>) = G_FABS [[UV]]
384    ; VI: [[FABS1:%[0-9]+]]:_(<2 x s16>) = G_FABS [[UV1]]
385    ; VI: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[FABS]](<2 x s16>), [[FABS1]](<2 x s16>)
386    ; VI: $vgpr0_vgpr1 = COPY [[CONCAT_VECTORS]](<4 x s16>)
387    ; GFX9-LABEL: name: test_fabs_v4s16
388    ; GFX9: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $vgpr0_vgpr1
389    ; GFX9: [[UV:%[0-9]+]]:_(<2 x s16>), [[UV1:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[COPY]](<4 x s16>)
390    ; GFX9: [[FABS:%[0-9]+]]:_(<2 x s16>) = G_FABS [[UV]]
391    ; GFX9: [[FABS1:%[0-9]+]]:_(<2 x s16>) = G_FABS [[UV1]]
392    ; GFX9: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s16>) = G_CONCAT_VECTORS [[FABS]](<2 x s16>), [[FABS1]](<2 x s16>)
393    ; GFX9: $vgpr0_vgpr1 = COPY [[CONCAT_VECTORS]](<4 x s16>)
394    %0:_(<4 x s16>) = COPY $vgpr0_vgpr1
395    %1:_(<4 x s16>) = G_FABS %0
396    $vgpr0_vgpr1 = COPY %1
397...
398