1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefix=GPRIDX %s
3 ; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1010 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10PLUS,GFX10 %s
4 ; RUN: llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=gfx1100 -amdgpu-enable-delay-alu=0 -verify-machineinstrs < %s | FileCheck -check-prefixes=GFX10PLUS,GFX11 %s
5 ; RUN: not --crash llc -global-isel -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -verify-machineinstrs -o /dev/null %s 2>&1 | FileCheck -check-prefix=ERR %s
7 ; FIXME: Need constant bus fixup pre-gfx10 for movrel
8 ; ERR: Bad machine code: VOP* instruction violates constant bus restriction
10 define amdgpu_ps <8 x i32> @dyn_insertelement_v8i32_s_s_s(<8 x i32> inreg %vec, i32 inreg %val, i32 inreg %idx) {
11 ; GPRIDX-LABEL: dyn_insertelement_v8i32_s_s_s:
12 ; GPRIDX: ; %bb.0: ; %entry
13 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 0
14 ; GPRIDX-NEXT: s_cselect_b32 s0, s10, s2
15 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 1
16 ; GPRIDX-NEXT: s_cselect_b32 s1, s10, s3
17 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 2
18 ; GPRIDX-NEXT: s_cselect_b32 s2, s10, s4
19 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 3
20 ; GPRIDX-NEXT: s_cselect_b32 s3, s10, s5
21 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 4
22 ; GPRIDX-NEXT: s_cselect_b32 s4, s10, s6
23 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 5
24 ; GPRIDX-NEXT: s_cselect_b32 s5, s10, s7
25 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 6
26 ; GPRIDX-NEXT: s_cselect_b32 s6, s10, s8
27 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 7
28 ; GPRIDX-NEXT: s_cselect_b32 s7, s10, s9
29 ; GPRIDX-NEXT: ; return to shader part epilog
31 ; GFX10PLUS-LABEL: dyn_insertelement_v8i32_s_s_s:
32 ; GFX10PLUS: ; %bb.0: ; %entry
33 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
34 ; GFX10PLUS-NEXT: s_mov_b32 m0, s11
35 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
36 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
37 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
38 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
39 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
40 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
41 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
42 ; GFX10PLUS-NEXT: s_movreld_b32 s0, s10
43 ; GFX10PLUS-NEXT: ; return to shader part epilog
45 %insert = insertelement <8 x i32> %vec, i32 %val, i32 %idx
49 define amdgpu_ps <8 x ptr addrspace(3)> @dyn_insertelement_v8p3i8_s_s_s(<8 x ptr addrspace(3)> inreg %vec, ptr addrspace(3) inreg %val, i32 inreg %idx) {
50 ; GPRIDX-LABEL: dyn_insertelement_v8p3i8_s_s_s:
51 ; GPRIDX: ; %bb.0: ; %entry
52 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 0
53 ; GPRIDX-NEXT: s_cselect_b32 s0, s10, s2
54 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 1
55 ; GPRIDX-NEXT: s_cselect_b32 s1, s10, s3
56 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 2
57 ; GPRIDX-NEXT: s_cselect_b32 s2, s10, s4
58 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 3
59 ; GPRIDX-NEXT: s_cselect_b32 s3, s10, s5
60 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 4
61 ; GPRIDX-NEXT: s_cselect_b32 s4, s10, s6
62 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 5
63 ; GPRIDX-NEXT: s_cselect_b32 s5, s10, s7
64 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 6
65 ; GPRIDX-NEXT: s_cselect_b32 s6, s10, s8
66 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 7
67 ; GPRIDX-NEXT: s_cselect_b32 s7, s10, s9
68 ; GPRIDX-NEXT: ; return to shader part epilog
70 ; GFX10PLUS-LABEL: dyn_insertelement_v8p3i8_s_s_s:
71 ; GFX10PLUS: ; %bb.0: ; %entry
72 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
73 ; GFX10PLUS-NEXT: s_mov_b32 m0, s11
74 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
75 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
76 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
77 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
78 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
79 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
80 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
81 ; GFX10PLUS-NEXT: s_movreld_b32 s0, s10
82 ; GFX10PLUS-NEXT: ; return to shader part epilog
84 %insert = insertelement <8 x ptr addrspace(3)> %vec, ptr addrspace(3) %val, i32 %idx
85 ret <8 x ptr addrspace(3)> %insert
88 define <8 x float> @dyn_insertelement_v8f32_const_s_v_v(float %val, i32 %idx) {
89 ; GPRIDX-LABEL: dyn_insertelement_v8f32_const_s_v_v:
90 ; GPRIDX: ; %bb.0: ; %entry
91 ; GPRIDX-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
92 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
93 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, 1.0, v0, vcc
94 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
95 ; GPRIDX-NEXT: v_mov_b32_e32 v2, 0x40400000
96 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, 2.0, v0, vcc
97 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
98 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v0, vcc
99 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
100 ; GPRIDX-NEXT: v_mov_b32_e32 v4, 0x40a00000
101 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, 4.0, v0, vcc
102 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
103 ; GPRIDX-NEXT: v_mov_b32_e32 v5, 0x40c00000
104 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v0, vcc
105 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
106 ; GPRIDX-NEXT: v_mov_b32_e32 v6, 0x40e00000
107 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v0, vcc
108 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
109 ; GPRIDX-NEXT: v_mov_b32_e32 v7, 0x41000000
110 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v0, vcc
111 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v1
112 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v0, vcc
113 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v8
114 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v9
115 ; GPRIDX-NEXT: s_setpc_b64 s[30:31]
117 ; GFX10-LABEL: dyn_insertelement_v8f32_const_s_v_v:
118 ; GFX10: ; %bb.0: ; %entry
119 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
120 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
121 ; GFX10-NEXT: v_cndmask_b32_e32 v8, 1.0, v0, vcc_lo
122 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
123 ; GFX10-NEXT: v_cndmask_b32_e32 v9, 2.0, v0, vcc_lo
124 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
125 ; GFX10-NEXT: v_cndmask_b32_e32 v2, 0x40400000, v0, vcc_lo
126 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
127 ; GFX10-NEXT: v_cndmask_b32_e32 v3, 4.0, v0, vcc_lo
128 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
129 ; GFX10-NEXT: v_cndmask_b32_e32 v4, 0x40a00000, v0, vcc_lo
130 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
131 ; GFX10-NEXT: v_cndmask_b32_e32 v5, 0x40c00000, v0, vcc_lo
132 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
133 ; GFX10-NEXT: v_cndmask_b32_e32 v6, 0x40e00000, v0, vcc_lo
134 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
135 ; GFX10-NEXT: v_mov_b32_e32 v1, v9
136 ; GFX10-NEXT: v_cndmask_b32_e32 v7, 0x41000000, v0, vcc_lo
137 ; GFX10-NEXT: v_mov_b32_e32 v0, v8
138 ; GFX10-NEXT: s_setpc_b64 s[30:31]
140 ; GFX11-LABEL: dyn_insertelement_v8f32_const_s_v_v:
141 ; GFX11: ; %bb.0: ; %entry
142 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
143 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
144 ; GFX11-NEXT: v_cndmask_b32_e32 v8, 1.0, v0, vcc_lo
145 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
146 ; GFX11-NEXT: v_cndmask_b32_e32 v9, 2.0, v0, vcc_lo
147 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
148 ; GFX11-NEXT: v_cndmask_b32_e32 v2, 0x40400000, v0, vcc_lo
149 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
150 ; GFX11-NEXT: v_cndmask_b32_e32 v3, 4.0, v0, vcc_lo
151 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
152 ; GFX11-NEXT: v_cndmask_b32_e32 v4, 0x40a00000, v0, vcc_lo
153 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
154 ; GFX11-NEXT: v_cndmask_b32_e32 v5, 0x40c00000, v0, vcc_lo
155 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
156 ; GFX11-NEXT: v_cndmask_b32_e32 v6, 0x40e00000, v0, vcc_lo
157 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
158 ; GFX11-NEXT: v_mov_b32_e32 v1, v9
159 ; GFX11-NEXT: v_dual_cndmask_b32 v7, 0x41000000, v0 :: v_dual_mov_b32 v0, v8
160 ; GFX11-NEXT: s_setpc_b64 s[30:31]
162 %insert = insertelement <8 x float> <float 1.0, float 2.0, float 3.0, float 4.0, float 5.0, float 6.0, float 7.0, float 8.0>, float %val, i32 %idx
163 ret <8 x float> %insert
166 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_s_s_v(<8 x float> inreg %vec, float inreg %val, i32 %idx) {
167 ; GPRIDX-LABEL: dyn_insertelement_v8f32_s_s_v:
168 ; GPRIDX: ; %bb.0: ; %entry
169 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s2
170 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
171 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v0
172 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s3
173 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v1, v10, vcc
174 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v0
175 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s4
176 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v2, v10, vcc
177 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v0
178 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s5
179 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v3, v10, vcc
180 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v0
181 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s6
182 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v4, v10, vcc
183 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v0
184 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s7
185 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v5, v10, vcc
186 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v0
187 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s8
188 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v6, v10, vcc
189 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v0
190 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
191 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v7, v10, vcc
192 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v0
193 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v9, v10, vcc
194 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v8
195 ; GPRIDX-NEXT: ; return to shader part epilog
197 ; GFX10-LABEL: dyn_insertelement_v8f32_s_s_v:
198 ; GFX10: ; %bb.0: ; %entry
199 ; GFX10-NEXT: v_mov_b32_e32 v7, s10
200 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v0
201 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s2, v7, vcc_lo
202 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v0
203 ; GFX10-NEXT: v_cndmask_b32_e32 v1, s3, v7, vcc_lo
204 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v0
205 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v7, vcc_lo
206 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v0
207 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v7, vcc_lo
208 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v0
209 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v7, vcc_lo
210 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v0
211 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v7, vcc_lo
212 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v0
213 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v7, vcc_lo
214 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v0
215 ; GFX10-NEXT: v_mov_b32_e32 v0, v8
216 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s9, v7, vcc_lo
217 ; GFX10-NEXT: ; return to shader part epilog
219 ; GFX11-LABEL: dyn_insertelement_v8f32_s_s_v:
220 ; GFX11: ; %bb.0: ; %entry
221 ; GFX11-NEXT: v_mov_b32_e32 v7, s10
222 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v0
223 ; GFX11-NEXT: v_cndmask_b32_e32 v8, s2, v7, vcc_lo
224 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v0
225 ; GFX11-NEXT: v_cndmask_b32_e32 v1, s3, v7, vcc_lo
226 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v0
227 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v7, vcc_lo
228 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v0
229 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v7, vcc_lo
230 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v0
231 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v7, vcc_lo
232 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v0
233 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v7, vcc_lo
234 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v0
235 ; GFX11-NEXT: v_cndmask_b32_e32 v6, s8, v7, vcc_lo
236 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v0
237 ; GFX11-NEXT: v_dual_mov_b32 v0, v8 :: v_dual_cndmask_b32 v7, s9, v7
238 ; GFX11-NEXT: ; return to shader part epilog
240 %insert = insertelement <8 x float> %vec, float %val, i32 %idx
241 ret <8 x float> %insert
244 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_s_v_s(<8 x float> inreg %vec, float %val, i32 inreg %idx) {
245 ; GPRIDX-LABEL: dyn_insertelement_v8f32_s_v_s:
246 ; GPRIDX: ; %bb.0: ; %entry
247 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s2
248 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s10, 0
249 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s3
250 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v1, v0, vcc
251 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s10, 1
252 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s4
253 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v2, v0, vcc
254 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s10, 2
255 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s5
256 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v3, v0, vcc
257 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s10, 3
258 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s6
259 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v4, v0, vcc
260 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s10, 4
261 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s7
262 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v5, v0, vcc
263 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s10, 5
264 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s8
265 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v6, v0, vcc
266 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s10, 6
267 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
268 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v7, v0, vcc
269 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s10, 7
270 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v9, v0, vcc
271 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v8
272 ; GPRIDX-NEXT: ; return to shader part epilog
274 ; GFX10-LABEL: dyn_insertelement_v8f32_s_v_s:
275 ; GFX10: ; %bb.0: ; %entry
276 ; GFX10-NEXT: s_mov_b32 s0, s2
277 ; GFX10-NEXT: s_mov_b32 s1, s3
278 ; GFX10-NEXT: s_mov_b32 s2, s4
279 ; GFX10-NEXT: s_mov_b32 s3, s5
280 ; GFX10-NEXT: s_mov_b32 s4, s6
281 ; GFX10-NEXT: s_mov_b32 s5, s7
282 ; GFX10-NEXT: s_mov_b32 s6, s8
283 ; GFX10-NEXT: s_mov_b32 s7, s9
284 ; GFX10-NEXT: v_mov_b32_e32 v8, v0
285 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
286 ; GFX10-NEXT: s_mov_b32 m0, s10
287 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
288 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
289 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
290 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
291 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
292 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
293 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
294 ; GFX10-NEXT: v_movreld_b32_e32 v0, v8
295 ; GFX10-NEXT: ; return to shader part epilog
297 ; GFX11-LABEL: dyn_insertelement_v8f32_s_v_s:
298 ; GFX11: ; %bb.0: ; %entry
299 ; GFX11-NEXT: s_mov_b32 s0, s2
300 ; GFX11-NEXT: s_mov_b32 s1, s3
301 ; GFX11-NEXT: s_mov_b32 s2, s4
302 ; GFX11-NEXT: s_mov_b32 s3, s5
303 ; GFX11-NEXT: s_mov_b32 s4, s6
304 ; GFX11-NEXT: s_mov_b32 s5, s7
305 ; GFX11-NEXT: s_mov_b32 s6, s8
306 ; GFX11-NEXT: s_mov_b32 s7, s9
307 ; GFX11-NEXT: v_mov_b32_e32 v8, v0
308 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v3, s3
309 ; GFX11-NEXT: s_mov_b32 m0, s10
310 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
311 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v4, s4
312 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v6, s6
313 ; GFX11-NEXT: v_movreld_b32_e32 v0, v8
314 ; GFX11-NEXT: ; return to shader part epilog
316 %insert = insertelement <8 x float> %vec, float %val, i32 %idx
317 ret <8 x float> %insert
320 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_v_s_s(<8 x float> %vec, float inreg %val, i32 inreg %idx) {
321 ; GPRIDX-LABEL: dyn_insertelement_v8f32_v_s_s:
322 ; GPRIDX: ; %bb.0: ; %entry
323 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s2
324 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s3, 0
325 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc
326 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s3, 1
327 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc
328 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s3, 2
329 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc
330 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s3, 3
331 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc
332 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s3, 4
333 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc
334 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s3, 5
335 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc
336 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s3, 6
337 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc
338 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s3, 7
339 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc
340 ; GPRIDX-NEXT: ; return to shader part epilog
342 ; GFX10PLUS-LABEL: dyn_insertelement_v8f32_v_s_s:
343 ; GFX10PLUS: ; %bb.0: ; %entry
344 ; GFX10PLUS-NEXT: s_mov_b32 m0, s3
345 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, s2
346 ; GFX10PLUS-NEXT: ; return to shader part epilog
348 %insert = insertelement <8 x float> %vec, float %val, i32 %idx
349 ret <8 x float> %insert
352 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_s_v_v(<8 x float> inreg %vec, float %val, i32 %idx) {
353 ; GPRIDX-LABEL: dyn_insertelement_v8f32_s_v_v:
354 ; GPRIDX: ; %bb.0: ; %entry
355 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
356 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
357 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
358 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v2, v0, vcc
359 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
360 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
361 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v3, v0, vcc
362 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
363 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
364 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v4, v0, vcc
365 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
366 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
367 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
368 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
369 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
370 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v6, v0, vcc
371 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
372 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
373 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v7, v0, vcc
374 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
375 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
376 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v10, v0, vcc
377 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v1
378 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v11, v0, vcc
379 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v8
380 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v9
381 ; GPRIDX-NEXT: ; return to shader part epilog
383 ; GFX10-LABEL: dyn_insertelement_v8f32_s_v_v:
384 ; GFX10: ; %bb.0: ; %entry
385 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
386 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s2, v0, vcc_lo
387 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
388 ; GFX10-NEXT: v_cndmask_b32_e32 v9, s3, v0, vcc_lo
389 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
390 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
391 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
392 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
393 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
394 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
395 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
396 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
397 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
398 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
399 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
400 ; GFX10-NEXT: v_mov_b32_e32 v1, v9
401 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
402 ; GFX10-NEXT: v_mov_b32_e32 v0, v8
403 ; GFX10-NEXT: ; return to shader part epilog
405 ; GFX11-LABEL: dyn_insertelement_v8f32_s_v_v:
406 ; GFX11: ; %bb.0: ; %entry
407 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
408 ; GFX11-NEXT: v_cndmask_b32_e32 v8, s2, v0, vcc_lo
409 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
410 ; GFX11-NEXT: v_cndmask_b32_e32 v9, s3, v0, vcc_lo
411 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
412 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
413 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
414 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
415 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
416 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
417 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
418 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
419 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
420 ; GFX11-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
421 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
422 ; GFX11-NEXT: v_mov_b32_e32 v1, v9
423 ; GFX11-NEXT: v_dual_cndmask_b32 v7, s9, v0 :: v_dual_mov_b32 v0, v8
424 ; GFX11-NEXT: ; return to shader part epilog
426 %insert = insertelement <8 x float> %vec, float %val, i32 %idx
427 ret <8 x float> %insert
430 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_v_s_v(<8 x float> %vec, float inreg %val, i32 %idx) {
431 ; GPRIDX-LABEL: dyn_insertelement_v8f32_v_s_v:
432 ; GPRIDX: ; %bb.0: ; %entry
433 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s2
434 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v8
435 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v9, vcc
436 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v8
437 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v9, vcc
438 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v8
439 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v9, vcc
440 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v8
441 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v9, vcc
442 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v8
443 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v9, vcc
444 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v8
445 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v9, vcc
446 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v8
447 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v9, vcc
448 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v8
449 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v9, vcc
450 ; GPRIDX-NEXT: ; return to shader part epilog
452 ; GFX10PLUS-LABEL: dyn_insertelement_v8f32_v_s_v:
453 ; GFX10PLUS: ; %bb.0: ; %entry
454 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v8
455 ; GFX10PLUS-NEXT: v_cndmask_b32_e64 v0, v0, s2, vcc_lo
456 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v8
457 ; GFX10PLUS-NEXT: v_cndmask_b32_e64 v1, v1, s2, vcc_lo
458 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v8
459 ; GFX10PLUS-NEXT: v_cndmask_b32_e64 v2, v2, s2, vcc_lo
460 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v8
461 ; GFX10PLUS-NEXT: v_cndmask_b32_e64 v3, v3, s2, vcc_lo
462 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v8
463 ; GFX10PLUS-NEXT: v_cndmask_b32_e64 v4, v4, s2, vcc_lo
464 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v8
465 ; GFX10PLUS-NEXT: v_cndmask_b32_e64 v5, v5, s2, vcc_lo
466 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v8
467 ; GFX10PLUS-NEXT: v_cndmask_b32_e64 v6, v6, s2, vcc_lo
468 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v8
469 ; GFX10PLUS-NEXT: v_cndmask_b32_e64 v7, v7, s2, vcc_lo
470 ; GFX10PLUS-NEXT: ; return to shader part epilog
472 %insert = insertelement <8 x float> %vec, float %val, i32 %idx
473 ret <8 x float> %insert
476 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_v_v_s(<8 x float> %vec, float %val, i32 inreg %idx) {
477 ; GPRIDX-LABEL: dyn_insertelement_v8f32_v_v_s:
478 ; GPRIDX: ; %bb.0: ; %entry
479 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 0
480 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc
481 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 1
482 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc
483 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 2
484 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc
485 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 3
486 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc
487 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 4
488 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc
489 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 5
490 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc
491 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 6
492 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc
493 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 7
494 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc
495 ; GPRIDX-NEXT: ; return to shader part epilog
497 ; GFX10PLUS-LABEL: dyn_insertelement_v8f32_v_v_s:
498 ; GFX10PLUS: ; %bb.0: ; %entry
499 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
500 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v8
501 ; GFX10PLUS-NEXT: ; return to shader part epilog
503 %insert = insertelement <8 x float> %vec, float %val, i32 %idx
504 ret <8 x float> %insert
507 define amdgpu_ps <8 x float> @dyn_insertelement_v8p3i8_v_v_s(<8 x ptr addrspace(3)> %vec, ptr addrspace(3) %val, i32 inreg %idx) {
508 ; GPRIDX-LABEL: dyn_insertelement_v8p3i8_v_v_s:
509 ; GPRIDX: ; %bb.0: ; %entry
510 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 0
511 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc
512 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 1
513 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc
514 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 2
515 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc
516 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 3
517 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc
518 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 4
519 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc
520 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 5
521 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc
522 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 6
523 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc
524 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 7
525 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc
526 ; GPRIDX-NEXT: ; return to shader part epilog
528 ; GFX10PLUS-LABEL: dyn_insertelement_v8p3i8_v_v_s:
529 ; GFX10PLUS: ; %bb.0: ; %entry
530 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
531 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v8
532 ; GFX10PLUS-NEXT: ; return to shader part epilog
534 %insert = insertelement <8 x ptr addrspace(3)> %vec, ptr addrspace(3) %val, i32 %idx
535 %cast.0 = ptrtoint <8 x ptr addrspace(3)> %insert to <8 x i32>
536 %cast.1 = bitcast <8 x i32> %cast.0 to <8 x float>
537 ret <8 x float> %cast.1
540 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_v_v_v(<8 x float> %vec, float %val, i32 %idx) {
541 ; GPRIDX-LABEL: dyn_insertelement_v8f32_v_v_v:
542 ; GPRIDX: ; %bb.0: ; %entry
543 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v9
544 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc
545 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v9
546 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc
547 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v9
548 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc
549 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v9
550 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc
551 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v9
552 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc
553 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v9
554 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc
555 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v9
556 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc
557 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v9
558 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc
559 ; GPRIDX-NEXT: ; return to shader part epilog
561 ; GFX10PLUS-LABEL: dyn_insertelement_v8f32_v_v_v:
562 ; GFX10PLUS: ; %bb.0: ; %entry
563 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v9
564 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc_lo
565 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v9
566 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc_lo
567 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v9
568 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc_lo
569 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v9
570 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc_lo
571 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v9
572 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc_lo
573 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v9
574 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc_lo
575 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v9
576 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc_lo
577 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v9
578 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc_lo
579 ; GFX10PLUS-NEXT: ; return to shader part epilog
581 %insert = insertelement <8 x float> %vec, float %val, i32 %idx
582 ret <8 x float> %insert
585 define amdgpu_ps <8 x i64> @dyn_insertelement_v8i64_s_s_s(<8 x i64> inreg %vec, i64 inreg %val, i32 inreg %idx) {
586 ; GPRIDX-LABEL: dyn_insertelement_v8i64_s_s_s:
587 ; GPRIDX: ; %bb.0: ; %entry
588 ; GPRIDX-NEXT: s_mov_b32 s0, s2
589 ; GPRIDX-NEXT: s_mov_b32 s1, s3
590 ; GPRIDX-NEXT: s_mov_b32 s2, s4
591 ; GPRIDX-NEXT: s_mov_b32 s3, s5
592 ; GPRIDX-NEXT: s_mov_b32 s4, s6
593 ; GPRIDX-NEXT: s_mov_b32 s5, s7
594 ; GPRIDX-NEXT: s_mov_b32 s6, s8
595 ; GPRIDX-NEXT: s_mov_b32 s7, s9
596 ; GPRIDX-NEXT: s_mov_b32 s8, s10
597 ; GPRIDX-NEXT: s_mov_b32 s9, s11
598 ; GPRIDX-NEXT: s_mov_b32 s10, s12
599 ; GPRIDX-NEXT: s_mov_b32 s11, s13
600 ; GPRIDX-NEXT: s_mov_b32 s12, s14
601 ; GPRIDX-NEXT: s_mov_b32 s13, s15
602 ; GPRIDX-NEXT: s_mov_b32 s14, s16
603 ; GPRIDX-NEXT: s_mov_b32 s15, s17
604 ; GPRIDX-NEXT: s_mov_b32 m0, s20
605 ; GPRIDX-NEXT: s_nop 0
606 ; GPRIDX-NEXT: s_movreld_b64 s[0:1], s[18:19]
607 ; GPRIDX-NEXT: ; return to shader part epilog
609 ; GFX10PLUS-LABEL: dyn_insertelement_v8i64_s_s_s:
610 ; GFX10PLUS: ; %bb.0: ; %entry
611 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
612 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
613 ; GFX10PLUS-NEXT: s_mov_b32 m0, s20
614 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
615 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
616 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
617 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
618 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
619 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
620 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
621 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
622 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
623 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
624 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
625 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
626 ; GFX10PLUS-NEXT: s_mov_b32 s14, s16
627 ; GFX10PLUS-NEXT: s_mov_b32 s15, s17
628 ; GFX10PLUS-NEXT: s_movreld_b64 s[0:1], s[18:19]
629 ; GFX10PLUS-NEXT: ; return to shader part epilog
631 %insert = insertelement <8 x i64> %vec, i64 %val, i32 %idx
632 ret <8 x i64> %insert
635 define amdgpu_ps <8 x ptr addrspace(1)> @dyn_insertelement_v8p1i8_s_s_s(<8 x ptr addrspace(1)> inreg %vec, ptr addrspace(1) inreg %val, i32 inreg %idx) {
636 ; GPRIDX-LABEL: dyn_insertelement_v8p1i8_s_s_s:
637 ; GPRIDX: ; %bb.0: ; %entry
638 ; GPRIDX-NEXT: s_mov_b32 s0, s2
639 ; GPRIDX-NEXT: s_mov_b32 s1, s3
640 ; GPRIDX-NEXT: s_mov_b32 s2, s4
641 ; GPRIDX-NEXT: s_mov_b32 s3, s5
642 ; GPRIDX-NEXT: s_mov_b32 s4, s6
643 ; GPRIDX-NEXT: s_mov_b32 s5, s7
644 ; GPRIDX-NEXT: s_mov_b32 s6, s8
645 ; GPRIDX-NEXT: s_mov_b32 s7, s9
646 ; GPRIDX-NEXT: s_mov_b32 s8, s10
647 ; GPRIDX-NEXT: s_mov_b32 s9, s11
648 ; GPRIDX-NEXT: s_mov_b32 s10, s12
649 ; GPRIDX-NEXT: s_mov_b32 s11, s13
650 ; GPRIDX-NEXT: s_mov_b32 s12, s14
651 ; GPRIDX-NEXT: s_mov_b32 s13, s15
652 ; GPRIDX-NEXT: s_mov_b32 s14, s16
653 ; GPRIDX-NEXT: s_mov_b32 s15, s17
654 ; GPRIDX-NEXT: s_mov_b32 m0, s20
655 ; GPRIDX-NEXT: s_nop 0
656 ; GPRIDX-NEXT: s_movreld_b64 s[0:1], s[18:19]
657 ; GPRIDX-NEXT: ; return to shader part epilog
659 ; GFX10PLUS-LABEL: dyn_insertelement_v8p1i8_s_s_s:
660 ; GFX10PLUS: ; %bb.0: ; %entry
661 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
662 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
663 ; GFX10PLUS-NEXT: s_mov_b32 m0, s20
664 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
665 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
666 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
667 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
668 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
669 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
670 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
671 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
672 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
673 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
674 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
675 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
676 ; GFX10PLUS-NEXT: s_mov_b32 s14, s16
677 ; GFX10PLUS-NEXT: s_mov_b32 s15, s17
678 ; GFX10PLUS-NEXT: s_movreld_b64 s[0:1], s[18:19]
679 ; GFX10PLUS-NEXT: ; return to shader part epilog
681 %insert = insertelement <8 x ptr addrspace(1)> %vec, ptr addrspace(1) %val, i32 %idx
682 ret <8 x ptr addrspace(1)> %insert
685 define void @dyn_insertelement_v8f64_const_s_v_v(double %val, i32 %idx) {
686 ; GPRIDX-LABEL: dyn_insertelement_v8f64_const_s_v_v:
687 ; GPRIDX: ; %bb.0: ; %entry
688 ; GPRIDX-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
689 ; GPRIDX-NEXT: s_mov_b32 s18, 0
690 ; GPRIDX-NEXT: s_mov_b32 s16, 0
691 ; GPRIDX-NEXT: s_mov_b32 s14, 0
692 ; GPRIDX-NEXT: s_mov_b32 s12, 0
693 ; GPRIDX-NEXT: s_mov_b32 s8, 0
694 ; GPRIDX-NEXT: s_mov_b64 s[4:5], 1.0
695 ; GPRIDX-NEXT: s_mov_b32 s19, 0x40200000
696 ; GPRIDX-NEXT: s_mov_b32 s17, 0x401c0000
697 ; GPRIDX-NEXT: s_mov_b32 s15, 0x40180000
698 ; GPRIDX-NEXT: s_mov_b32 s13, 0x40140000
699 ; GPRIDX-NEXT: s_mov_b64 s[10:11], 4.0
700 ; GPRIDX-NEXT: s_mov_b32 s9, 0x40080000
701 ; GPRIDX-NEXT: s_mov_b64 s[6:7], 2.0
702 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s4
703 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s5
704 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s6
705 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s7
706 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s8
707 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s9
708 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s10
709 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s11
710 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s12
711 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s13
712 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s14
713 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s15
714 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s16
715 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s17
716 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s18
717 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s19
718 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v2
719 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[16:17], 0, v2
720 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[4:5], 2, v2
721 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[6:7], 3, v2
722 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[8:9], 4, v2
723 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[10:11], 5, v2
724 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[12:13], 6, v2
725 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[14:15], 7, v2
726 ; GPRIDX-NEXT: v_cndmask_b32_e64 v3, v3, v0, s[16:17]
727 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v0, vcc
728 ; GPRIDX-NEXT: v_cndmask_b32_e64 v4, v4, v1, s[16:17]
729 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v1, vcc
730 ; GPRIDX-NEXT: v_cndmask_b32_e64 v7, v7, v0, s[4:5]
731 ; GPRIDX-NEXT: v_cndmask_b32_e64 v9, v9, v0, s[6:7]
732 ; GPRIDX-NEXT: v_cndmask_b32_e64 v11, v11, v0, s[8:9]
733 ; GPRIDX-NEXT: v_cndmask_b32_e64 v13, v13, v0, s[10:11]
734 ; GPRIDX-NEXT: v_cndmask_b32_e64 v15, v15, v0, s[12:13]
735 ; GPRIDX-NEXT: v_cndmask_b32_e64 v17, v17, v0, s[14:15]
736 ; GPRIDX-NEXT: v_cndmask_b32_e64 v8, v8, v1, s[4:5]
737 ; GPRIDX-NEXT: v_cndmask_b32_e64 v10, v10, v1, s[6:7]
738 ; GPRIDX-NEXT: v_cndmask_b32_e64 v12, v12, v1, s[8:9]
739 ; GPRIDX-NEXT: v_cndmask_b32_e64 v14, v14, v1, s[10:11]
740 ; GPRIDX-NEXT: v_cndmask_b32_e64 v16, v16, v1, s[12:13]
741 ; GPRIDX-NEXT: v_cndmask_b32_e64 v18, v18, v1, s[14:15]
742 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[3:6], off
743 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
744 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[7:10], off
745 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
746 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[11:14], off
747 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
748 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[15:18], off
749 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
750 ; GPRIDX-NEXT: s_setpc_b64 s[30:31]
752 ; GFX10-LABEL: dyn_insertelement_v8f64_const_s_v_v:
753 ; GFX10: ; %bb.0: ; %entry
754 ; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
755 ; GFX10-NEXT: s_mov_b32 s18, 0
756 ; GFX10-NEXT: s_mov_b32 s16, 0
757 ; GFX10-NEXT: s_mov_b32 s14, 0
758 ; GFX10-NEXT: s_mov_b32 s12, 0
759 ; GFX10-NEXT: s_mov_b32 s8, 0
760 ; GFX10-NEXT: s_mov_b64 s[4:5], 1.0
761 ; GFX10-NEXT: s_mov_b32 s19, 0x40200000
762 ; GFX10-NEXT: s_mov_b32 s17, 0x401c0000
763 ; GFX10-NEXT: s_mov_b32 s15, 0x40180000
764 ; GFX10-NEXT: s_mov_b32 s13, 0x40140000
765 ; GFX10-NEXT: s_mov_b64 s[10:11], 4.0
766 ; GFX10-NEXT: s_mov_b32 s9, 0x40080000
767 ; GFX10-NEXT: s_mov_b64 s[6:7], 2.0
768 ; GFX10-NEXT: v_mov_b32_e32 v3, s4
769 ; GFX10-NEXT: v_mov_b32_e32 v4, s5
770 ; GFX10-NEXT: v_mov_b32_e32 v5, s6
771 ; GFX10-NEXT: v_mov_b32_e32 v6, s7
772 ; GFX10-NEXT: v_mov_b32_e32 v7, s8
773 ; GFX10-NEXT: v_mov_b32_e32 v8, s9
774 ; GFX10-NEXT: v_mov_b32_e32 v9, s10
775 ; GFX10-NEXT: v_mov_b32_e32 v10, s11
776 ; GFX10-NEXT: v_mov_b32_e32 v11, s12
777 ; GFX10-NEXT: v_mov_b32_e32 v12, s13
778 ; GFX10-NEXT: v_mov_b32_e32 v13, s14
779 ; GFX10-NEXT: v_mov_b32_e32 v14, s15
780 ; GFX10-NEXT: v_mov_b32_e32 v15, s16
781 ; GFX10-NEXT: v_mov_b32_e32 v16, s17
782 ; GFX10-NEXT: v_mov_b32_e32 v17, s18
783 ; GFX10-NEXT: v_mov_b32_e32 v18, s19
784 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
785 ; GFX10-NEXT: v_cmp_eq_u32_e64 s4, 1, v2
786 ; GFX10-NEXT: v_cmp_eq_u32_e64 s5, 2, v2
787 ; GFX10-NEXT: v_cmp_eq_u32_e64 s6, 3, v2
788 ; GFX10-NEXT: v_cmp_eq_u32_e64 s7, 5, v2
789 ; GFX10-NEXT: v_cmp_eq_u32_e64 s10, 4, v2
790 ; GFX10-NEXT: v_cmp_eq_u32_e64 s8, 6, v2
791 ; GFX10-NEXT: v_cmp_eq_u32_e64 s9, 7, v2
792 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc_lo
793 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, v0, s4
794 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v1, vcc_lo
795 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v1, s4
796 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, v0, s5
797 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v0, s6
798 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, v1, s5
799 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, v1, s6
800 ; GFX10-NEXT: v_cndmask_b32_e64 v11, v11, v0, s10
801 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v13, v0, s7
802 ; GFX10-NEXT: v_cndmask_b32_e64 v12, v12, v1, s10
803 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, v1, s7
804 ; GFX10-NEXT: v_cndmask_b32_e64 v15, v15, v0, s8
805 ; GFX10-NEXT: v_cndmask_b32_e64 v17, v17, v0, s9
806 ; GFX10-NEXT: v_cndmask_b32_e64 v16, v16, v1, s8
807 ; GFX10-NEXT: v_cndmask_b32_e64 v18, v18, v1, s9
808 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[3:6], off
809 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
810 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[7:10], off
811 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
812 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[11:14], off
813 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
814 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[15:18], off
815 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
816 ; GFX10-NEXT: s_setpc_b64 s[30:31]
818 ; GFX11-LABEL: dyn_insertelement_v8f64_const_s_v_v:
819 ; GFX11: ; %bb.0: ; %entry
820 ; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
821 ; GFX11-NEXT: s_mov_b32 s14, 0
822 ; GFX11-NEXT: s_mov_b32 s15, 0x40200000
823 ; GFX11-NEXT: s_mov_b32 s12, 0
824 ; GFX11-NEXT: s_mov_b32 s10, 0
825 ; GFX11-NEXT: s_mov_b32 s8, 0
826 ; GFX11-NEXT: s_mov_b32 s4, 0
827 ; GFX11-NEXT: s_mov_b64 s[0:1], 1.0
828 ; GFX11-NEXT: s_mov_b32 s13, 0x401c0000
829 ; GFX11-NEXT: s_mov_b32 s11, 0x40180000
830 ; GFX11-NEXT: s_mov_b32 s9, 0x40140000
831 ; GFX11-NEXT: s_mov_b64 s[6:7], 4.0
832 ; GFX11-NEXT: s_mov_b32 s5, 0x40080000
833 ; GFX11-NEXT: s_mov_b64 s[2:3], 2.0
834 ; GFX11-NEXT: v_dual_mov_b32 v18, s15 :: v_dual_mov_b32 v17, s14
835 ; GFX11-NEXT: v_dual_mov_b32 v4, s1 :: v_dual_mov_b32 v3, s0
836 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
837 ; GFX11-NEXT: v_dual_mov_b32 v16, s13 :: v_dual_mov_b32 v15, s12
838 ; GFX11-NEXT: v_dual_mov_b32 v14, s11 :: v_dual_mov_b32 v13, s10
839 ; GFX11-NEXT: v_dual_mov_b32 v12, s9 :: v_dual_mov_b32 v11, s8
840 ; GFX11-NEXT: v_dual_mov_b32 v10, s7 :: v_dual_mov_b32 v9, s6
841 ; GFX11-NEXT: v_dual_mov_b32 v8, s5 :: v_dual_mov_b32 v7, s4
842 ; GFX11-NEXT: v_dual_mov_b32 v6, s3 :: v_dual_mov_b32 v5, s2
843 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 1, v2
844 ; GFX11-NEXT: v_dual_cndmask_b32 v3, v3, v0 :: v_dual_cndmask_b32 v4, v4, v1
845 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
846 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 7, v2
847 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, v0, s0
848 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v1, s0
849 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 3, v2
850 ; GFX11-NEXT: v_dual_cndmask_b32 v7, v7, v0 :: v_dual_cndmask_b32 v8, v8, v1
851 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v2
852 ; GFX11-NEXT: v_cndmask_b32_e64 v17, v17, v0, s1
853 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, v0, s0
854 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, v1, s0
855 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 5, v2
856 ; GFX11-NEXT: v_dual_cndmask_b32 v11, v11, v0 :: v_dual_cndmask_b32 v12, v12, v1
857 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v2
858 ; GFX11-NEXT: v_cndmask_b32_e64 v18, v18, v1, s1
859 ; GFX11-NEXT: v_cndmask_b32_e64 v13, v13, v0, s0
860 ; GFX11-NEXT: v_cndmask_b32_e64 v14, v14, v1, s0
861 ; GFX11-NEXT: v_dual_cndmask_b32 v15, v15, v0 :: v_dual_cndmask_b32 v16, v16, v1
862 ; GFX11-NEXT: global_store_b128 v[0:1], v[3:6], off dlc
863 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
864 ; GFX11-NEXT: global_store_b128 v[0:1], v[7:10], off dlc
865 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
866 ; GFX11-NEXT: global_store_b128 v[0:1], v[11:14], off dlc
867 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
868 ; GFX11-NEXT: global_store_b128 v[0:1], v[15:18], off dlc
869 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
870 ; GFX11-NEXT: s_setpc_b64 s[30:31]
872 %insert = insertelement <8 x double> <double 1.0, double 2.0, double 3.0, double 4.0, double 5.0, double 6.0, double 7.0, double 8.0>, double %val, i32 %idx
873 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
874 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
875 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
876 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
877 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
878 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
879 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
880 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
884 define amdgpu_ps void @dyn_insertelement_v8f64_s_s_v(<8 x double> inreg %vec, double inreg %val, i32 %idx) {
885 ; GPRIDX-LABEL: dyn_insertelement_v8f64_s_s_v:
886 ; GPRIDX: ; %bb.0: ; %entry
887 ; GPRIDX-NEXT: s_mov_b32 s1, s3
888 ; GPRIDX-NEXT: s_mov_b32 s3, s5
889 ; GPRIDX-NEXT: s_mov_b32 s5, s7
890 ; GPRIDX-NEXT: s_mov_b32 s7, s9
891 ; GPRIDX-NEXT: s_mov_b32 s9, s11
892 ; GPRIDX-NEXT: s_mov_b32 s11, s13
893 ; GPRIDX-NEXT: s_mov_b32 s13, s15
894 ; GPRIDX-NEXT: s_mov_b32 s15, s17
895 ; GPRIDX-NEXT: s_mov_b32 s0, s2
896 ; GPRIDX-NEXT: s_mov_b32 s2, s4
897 ; GPRIDX-NEXT: s_mov_b32 s4, s6
898 ; GPRIDX-NEXT: s_mov_b32 s6, s8
899 ; GPRIDX-NEXT: s_mov_b32 s8, s10
900 ; GPRIDX-NEXT: s_mov_b32 s10, s12
901 ; GPRIDX-NEXT: s_mov_b32 s12, s14
902 ; GPRIDX-NEXT: s_mov_b32 s14, s16
903 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s15
904 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s14
905 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s13
906 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s12
907 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s11
908 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s10
909 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s9
910 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s8
911 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s7
912 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s6
913 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s5
914 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s4
915 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s3
916 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s2
917 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s1
918 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s0
919 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s18
920 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v0
921 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[0:1], 2, v0
922 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[2:3], 3, v0
923 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[4:5], 4, v0
924 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[6:7], 5, v0
925 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[8:9], 6, v0
926 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[10:11], 7, v0
927 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[12:13], 0, v0
928 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s19
929 ; GPRIDX-NEXT: v_cndmask_b32_e64 v1, v1, v17, s[12:13]
930 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v17, vcc
931 ; GPRIDX-NEXT: v_cndmask_b32_e64 v2, v2, v0, s[12:13]
932 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v0, vcc
933 ; GPRIDX-NEXT: v_cndmask_b32_e64 v5, v5, v17, s[0:1]
934 ; GPRIDX-NEXT: v_cndmask_b32_e64 v7, v7, v17, s[2:3]
935 ; GPRIDX-NEXT: v_cndmask_b32_e64 v9, v9, v17, s[4:5]
936 ; GPRIDX-NEXT: v_cndmask_b32_e64 v11, v11, v17, s[6:7]
937 ; GPRIDX-NEXT: v_cndmask_b32_e64 v13, v13, v17, s[8:9]
938 ; GPRIDX-NEXT: v_cndmask_b32_e64 v15, v15, v17, s[10:11]
939 ; GPRIDX-NEXT: v_cndmask_b32_e64 v6, v6, v0, s[0:1]
940 ; GPRIDX-NEXT: v_cndmask_b32_e64 v8, v8, v0, s[2:3]
941 ; GPRIDX-NEXT: v_cndmask_b32_e64 v10, v10, v0, s[4:5]
942 ; GPRIDX-NEXT: v_cndmask_b32_e64 v12, v12, v0, s[6:7]
943 ; GPRIDX-NEXT: v_cndmask_b32_e64 v14, v14, v0, s[8:9]
944 ; GPRIDX-NEXT: v_cndmask_b32_e64 v16, v16, v0, s[10:11]
945 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[1:4], off
946 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
947 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[5:8], off
948 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
949 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[9:12], off
950 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
951 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[13:16], off
952 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
953 ; GPRIDX-NEXT: s_endpgm
955 ; GFX10-LABEL: dyn_insertelement_v8f64_s_s_v:
956 ; GFX10: ; %bb.0: ; %entry
957 ; GFX10-NEXT: s_mov_b32 s1, s3
958 ; GFX10-NEXT: s_mov_b32 s3, s5
959 ; GFX10-NEXT: s_mov_b32 s5, s7
960 ; GFX10-NEXT: s_mov_b32 s7, s9
961 ; GFX10-NEXT: s_mov_b32 s9, s11
962 ; GFX10-NEXT: s_mov_b32 s11, s13
963 ; GFX10-NEXT: s_mov_b32 s13, s15
964 ; GFX10-NEXT: s_mov_b32 s15, s17
965 ; GFX10-NEXT: s_mov_b32 s0, s2
966 ; GFX10-NEXT: s_mov_b32 s2, s4
967 ; GFX10-NEXT: s_mov_b32 s4, s6
968 ; GFX10-NEXT: s_mov_b32 s6, s8
969 ; GFX10-NEXT: s_mov_b32 s8, s10
970 ; GFX10-NEXT: s_mov_b32 s10, s12
971 ; GFX10-NEXT: s_mov_b32 s12, s14
972 ; GFX10-NEXT: s_mov_b32 s14, s16
973 ; GFX10-NEXT: v_mov_b32_e32 v16, s15
974 ; GFX10-NEXT: v_mov_b32_e32 v2, s1
975 ; GFX10-NEXT: v_mov_b32_e32 v1, s0
976 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v0
977 ; GFX10-NEXT: v_mov_b32_e32 v15, s14
978 ; GFX10-NEXT: v_mov_b32_e32 v14, s13
979 ; GFX10-NEXT: v_mov_b32_e32 v13, s12
980 ; GFX10-NEXT: v_mov_b32_e32 v12, s11
981 ; GFX10-NEXT: v_mov_b32_e32 v11, s10
982 ; GFX10-NEXT: v_mov_b32_e32 v10, s9
983 ; GFX10-NEXT: v_mov_b32_e32 v9, s8
984 ; GFX10-NEXT: v_mov_b32_e32 v8, s7
985 ; GFX10-NEXT: v_mov_b32_e32 v7, s6
986 ; GFX10-NEXT: v_mov_b32_e32 v6, s5
987 ; GFX10-NEXT: v_mov_b32_e32 v5, s4
988 ; GFX10-NEXT: v_mov_b32_e32 v4, s3
989 ; GFX10-NEXT: v_mov_b32_e32 v3, s2
990 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 1, v0
991 ; GFX10-NEXT: v_cndmask_b32_e64 v1, v1, s18, vcc_lo
992 ; GFX10-NEXT: v_cndmask_b32_e64 v2, v2, s19, vcc_lo
993 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v0
994 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 2, v0
995 ; GFX10-NEXT: v_cndmask_b32_e64 v3, v3, s18, s0
996 ; GFX10-NEXT: v_cndmask_b32_e64 v4, v4, s19, s0
997 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 4, v0
998 ; GFX10-NEXT: v_cmp_eq_u32_e64 s2, 5, v0
999 ; GFX10-NEXT: v_cmp_eq_u32_e64 s3, 6, v0
1000 ; GFX10-NEXT: v_cmp_eq_u32_e64 s4, 7, v0
1001 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, s18, s1
1002 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, s19, s1
1003 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, s18, vcc_lo
1004 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, s19, vcc_lo
1005 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, s18, s0
1006 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, s19, s0
1007 ; GFX10-NEXT: v_cndmask_b32_e64 v11, v11, s18, s2
1008 ; GFX10-NEXT: v_cndmask_b32_e64 v12, v12, s19, s2
1009 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v13, s18, s3
1010 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, s19, s3
1011 ; GFX10-NEXT: v_cndmask_b32_e64 v15, v15, s18, s4
1012 ; GFX10-NEXT: v_cndmask_b32_e64 v16, v16, s19, s4
1013 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[1:4], off
1014 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1015 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[5:8], off
1016 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1017 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[9:12], off
1018 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1019 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[13:16], off
1020 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1021 ; GFX10-NEXT: s_endpgm
1023 ; GFX11-LABEL: dyn_insertelement_v8f64_s_s_v:
1024 ; GFX11: ; %bb.0: ; %entry
1025 ; GFX11-NEXT: s_mov_b32 s1, s3
1026 ; GFX11-NEXT: s_mov_b32 s3, s5
1027 ; GFX11-NEXT: s_mov_b32 s5, s7
1028 ; GFX11-NEXT: s_mov_b32 s7, s9
1029 ; GFX11-NEXT: s_mov_b32 s9, s11
1030 ; GFX11-NEXT: s_mov_b32 s11, s13
1031 ; GFX11-NEXT: s_mov_b32 s13, s15
1032 ; GFX11-NEXT: s_mov_b32 s15, s17
1033 ; GFX11-NEXT: s_mov_b32 s0, s2
1034 ; GFX11-NEXT: s_mov_b32 s2, s4
1035 ; GFX11-NEXT: s_mov_b32 s4, s6
1036 ; GFX11-NEXT: s_mov_b32 s6, s8
1037 ; GFX11-NEXT: s_mov_b32 s8, s10
1038 ; GFX11-NEXT: s_mov_b32 s10, s12
1039 ; GFX11-NEXT: s_mov_b32 s12, s14
1040 ; GFX11-NEXT: s_mov_b32 s14, s16
1041 ; GFX11-NEXT: v_dual_mov_b32 v16, s15 :: v_dual_mov_b32 v15, s14
1042 ; GFX11-NEXT: v_dual_mov_b32 v2, s1 :: v_dual_mov_b32 v1, s0
1043 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v0
1044 ; GFX11-NEXT: v_dual_mov_b32 v14, s13 :: v_dual_mov_b32 v13, s12
1045 ; GFX11-NEXT: v_dual_mov_b32 v12, s11 :: v_dual_mov_b32 v11, s10
1046 ; GFX11-NEXT: v_dual_mov_b32 v10, s9 :: v_dual_mov_b32 v9, s8
1047 ; GFX11-NEXT: v_dual_mov_b32 v8, s7 :: v_dual_mov_b32 v7, s6
1048 ; GFX11-NEXT: v_dual_mov_b32 v6, s5 :: v_dual_mov_b32 v5, s4
1049 ; GFX11-NEXT: v_dual_mov_b32 v4, s3 :: v_dual_mov_b32 v3, s2
1050 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 1, v0
1051 ; GFX11-NEXT: v_cndmask_b32_e64 v1, v1, s18, vcc_lo
1052 ; GFX11-NEXT: v_cndmask_b32_e64 v2, v2, s19, vcc_lo
1053 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v0
1054 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 7, v0
1055 ; GFX11-NEXT: v_cndmask_b32_e64 v3, v3, s18, s0
1056 ; GFX11-NEXT: v_cndmask_b32_e64 v4, v4, s19, s0
1057 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 3, v0
1058 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, s18, vcc_lo
1059 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, s19, vcc_lo
1060 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v0
1061 ; GFX11-NEXT: v_cndmask_b32_e64 v15, v15, s18, s1
1062 ; GFX11-NEXT: v_cndmask_b32_e64 v7, v7, s18, s0
1063 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v8, s19, s0
1064 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 5, v0
1065 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, s18, vcc_lo
1066 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, s19, vcc_lo
1067 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v0
1068 ; GFX11-NEXT: v_cndmask_b32_e64 v16, v16, s19, s1
1069 ; GFX11-NEXT: v_cndmask_b32_e64 v11, v11, s18, s0
1070 ; GFX11-NEXT: v_cndmask_b32_e64 v12, v12, s19, s0
1071 ; GFX11-NEXT: v_cndmask_b32_e64 v13, v13, s18, vcc_lo
1072 ; GFX11-NEXT: v_cndmask_b32_e64 v14, v14, s19, vcc_lo
1073 ; GFX11-NEXT: global_store_b128 v[0:1], v[1:4], off dlc
1074 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1075 ; GFX11-NEXT: global_store_b128 v[0:1], v[5:8], off dlc
1076 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1077 ; GFX11-NEXT: global_store_b128 v[0:1], v[9:12], off dlc
1078 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1079 ; GFX11-NEXT: global_store_b128 v[0:1], v[13:16], off dlc
1080 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1081 ; GFX11-NEXT: s_nop 0
1082 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1083 ; GFX11-NEXT: s_endpgm
1085 %insert = insertelement <8 x double> %vec, double %val, i32 %idx
1086 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
1087 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
1088 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
1089 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
1090 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
1091 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
1092 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
1093 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
1097 define amdgpu_ps void @dyn_insertelement_v8f64_s_v_s(<8 x double> inreg %vec, double %val, i32 inreg %idx) {
1098 ; GPRIDX-LABEL: dyn_insertelement_v8f64_s_v_s:
1099 ; GPRIDX: ; %bb.0: ; %entry
1100 ; GPRIDX-NEXT: s_mov_b32 s1, s3
1101 ; GPRIDX-NEXT: s_mov_b32 s3, s5
1102 ; GPRIDX-NEXT: s_mov_b32 s5, s7
1103 ; GPRIDX-NEXT: s_mov_b32 s7, s9
1104 ; GPRIDX-NEXT: s_mov_b32 s9, s11
1105 ; GPRIDX-NEXT: s_mov_b32 s11, s13
1106 ; GPRIDX-NEXT: s_mov_b32 s13, s15
1107 ; GPRIDX-NEXT: s_mov_b32 s15, s17
1108 ; GPRIDX-NEXT: s_mov_b32 s0, s2
1109 ; GPRIDX-NEXT: s_mov_b32 s2, s4
1110 ; GPRIDX-NEXT: s_mov_b32 s4, s6
1111 ; GPRIDX-NEXT: s_mov_b32 s6, s8
1112 ; GPRIDX-NEXT: s_mov_b32 s8, s10
1113 ; GPRIDX-NEXT: s_mov_b32 s10, s12
1114 ; GPRIDX-NEXT: s_mov_b32 s12, s14
1115 ; GPRIDX-NEXT: s_mov_b32 s14, s16
1116 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s15
1117 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s14
1118 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s13
1119 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s12
1120 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s11
1121 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s10
1122 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
1123 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
1124 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s7
1125 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s6
1126 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s5
1127 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s4
1128 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s3
1129 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s2
1130 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s1
1131 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s0
1132 ; GPRIDX-NEXT: s_lshl_b32 s0, s18, 1
1133 ; GPRIDX-NEXT: s_set_gpr_idx_on s0, gpr_idx(DST)
1134 ; GPRIDX-NEXT: v_mov_b32_e32 v2, v0
1135 ; GPRIDX-NEXT: v_mov_b32_e32 v3, v1
1136 ; GPRIDX-NEXT: s_set_gpr_idx_off
1137 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[2:5], off
1138 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1139 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[6:9], off
1140 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1141 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[10:13], off
1142 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1143 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[14:17], off
1144 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1145 ; GPRIDX-NEXT: s_endpgm
1147 ; GFX10-LABEL: dyn_insertelement_v8f64_s_v_s:
1148 ; GFX10: ; %bb.0: ; %entry
1149 ; GFX10-NEXT: s_mov_b32 s1, s3
1150 ; GFX10-NEXT: s_mov_b32 s3, s5
1151 ; GFX10-NEXT: s_mov_b32 s5, s7
1152 ; GFX10-NEXT: s_mov_b32 s7, s9
1153 ; GFX10-NEXT: s_mov_b32 s9, s11
1154 ; GFX10-NEXT: s_mov_b32 s11, s13
1155 ; GFX10-NEXT: s_mov_b32 s13, s15
1156 ; GFX10-NEXT: s_mov_b32 s15, s17
1157 ; GFX10-NEXT: s_mov_b32 s0, s2
1158 ; GFX10-NEXT: s_mov_b32 s2, s4
1159 ; GFX10-NEXT: s_mov_b32 s4, s6
1160 ; GFX10-NEXT: s_mov_b32 s6, s8
1161 ; GFX10-NEXT: s_mov_b32 s8, s10
1162 ; GFX10-NEXT: s_mov_b32 s10, s12
1163 ; GFX10-NEXT: s_mov_b32 s12, s14
1164 ; GFX10-NEXT: s_mov_b32 s14, s16
1165 ; GFX10-NEXT: v_mov_b32_e32 v17, s15
1166 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
1167 ; GFX10-NEXT: s_lshl_b32 m0, s18, 1
1168 ; GFX10-NEXT: v_mov_b32_e32 v16, s14
1169 ; GFX10-NEXT: v_mov_b32_e32 v15, s13
1170 ; GFX10-NEXT: v_mov_b32_e32 v14, s12
1171 ; GFX10-NEXT: v_mov_b32_e32 v13, s11
1172 ; GFX10-NEXT: v_mov_b32_e32 v12, s10
1173 ; GFX10-NEXT: v_mov_b32_e32 v11, s9
1174 ; GFX10-NEXT: v_mov_b32_e32 v10, s8
1175 ; GFX10-NEXT: v_mov_b32_e32 v9, s7
1176 ; GFX10-NEXT: v_mov_b32_e32 v8, s6
1177 ; GFX10-NEXT: v_mov_b32_e32 v7, s5
1178 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
1179 ; GFX10-NEXT: v_mov_b32_e32 v5, s3
1180 ; GFX10-NEXT: v_mov_b32_e32 v4, s2
1181 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
1182 ; GFX10-NEXT: v_movreld_b32_e32 v2, v0
1183 ; GFX10-NEXT: v_movreld_b32_e32 v3, v1
1184 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[2:5], off
1185 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1186 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[6:9], off
1187 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1188 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[10:13], off
1189 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1190 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[14:17], off
1191 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1192 ; GFX10-NEXT: s_endpgm
1194 ; GFX11-LABEL: dyn_insertelement_v8f64_s_v_s:
1195 ; GFX11: ; %bb.0: ; %entry
1196 ; GFX11-NEXT: s_mov_b32 s1, s3
1197 ; GFX11-NEXT: s_mov_b32 s3, s5
1198 ; GFX11-NEXT: s_mov_b32 s5, s7
1199 ; GFX11-NEXT: s_mov_b32 s7, s9
1200 ; GFX11-NEXT: s_mov_b32 s9, s11
1201 ; GFX11-NEXT: s_mov_b32 s11, s13
1202 ; GFX11-NEXT: s_mov_b32 s13, s15
1203 ; GFX11-NEXT: s_mov_b32 s15, s17
1204 ; GFX11-NEXT: s_mov_b32 s0, s2
1205 ; GFX11-NEXT: s_mov_b32 s2, s4
1206 ; GFX11-NEXT: s_mov_b32 s4, s6
1207 ; GFX11-NEXT: s_mov_b32 s6, s8
1208 ; GFX11-NEXT: s_mov_b32 s8, s10
1209 ; GFX11-NEXT: s_mov_b32 s10, s12
1210 ; GFX11-NEXT: s_mov_b32 s12, s14
1211 ; GFX11-NEXT: s_mov_b32 s14, s16
1212 ; GFX11-NEXT: v_dual_mov_b32 v17, s15 :: v_dual_mov_b32 v16, s14
1213 ; GFX11-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
1214 ; GFX11-NEXT: s_lshl_b32 m0, s18, 1
1215 ; GFX11-NEXT: v_dual_mov_b32 v15, s13 :: v_dual_mov_b32 v14, s12
1216 ; GFX11-NEXT: v_dual_mov_b32 v13, s11 :: v_dual_mov_b32 v12, s10
1217 ; GFX11-NEXT: v_dual_mov_b32 v11, s9 :: v_dual_mov_b32 v10, s8
1218 ; GFX11-NEXT: v_dual_mov_b32 v9, s7 :: v_dual_mov_b32 v8, s6
1219 ; GFX11-NEXT: v_dual_mov_b32 v7, s5 :: v_dual_mov_b32 v6, s4
1220 ; GFX11-NEXT: v_dual_mov_b32 v5, s3 :: v_dual_mov_b32 v4, s2
1221 ; GFX11-NEXT: v_movreld_b32_e32 v2, v0
1222 ; GFX11-NEXT: v_movreld_b32_e32 v3, v1
1223 ; GFX11-NEXT: global_store_b128 v[0:1], v[2:5], off dlc
1224 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1225 ; GFX11-NEXT: global_store_b128 v[0:1], v[6:9], off dlc
1226 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1227 ; GFX11-NEXT: global_store_b128 v[0:1], v[10:13], off dlc
1228 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1229 ; GFX11-NEXT: global_store_b128 v[0:1], v[14:17], off dlc
1230 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1231 ; GFX11-NEXT: s_nop 0
1232 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1233 ; GFX11-NEXT: s_endpgm
1235 %insert = insertelement <8 x double> %vec, double %val, i32 %idx
1236 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
1237 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
1238 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
1239 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
1240 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
1241 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
1242 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
1243 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
1247 define amdgpu_ps void @dyn_insertelement_v8f64_v_s_s(<8 x double> %vec, double inreg %val, i32 inreg %idx) {
1248 ; GPRIDX-LABEL: dyn_insertelement_v8f64_v_s_s:
1249 ; GPRIDX: ; %bb.0: ; %entry
1250 ; GPRIDX-NEXT: s_lshl_b32 s0, s4, 1
1251 ; GPRIDX-NEXT: s_set_gpr_idx_on s0, gpr_idx(DST)
1252 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s2
1253 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s3
1254 ; GPRIDX-NEXT: s_set_gpr_idx_off
1255 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
1256 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1257 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
1258 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1259 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
1260 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1261 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
1262 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1263 ; GPRIDX-NEXT: s_endpgm
1265 ; GFX10-LABEL: dyn_insertelement_v8f64_v_s_s:
1266 ; GFX10: ; %bb.0: ; %entry
1267 ; GFX10-NEXT: s_lshl_b32 m0, s4, 1
1268 ; GFX10-NEXT: v_movreld_b32_e32 v0, s2
1269 ; GFX10-NEXT: v_movreld_b32_e32 v1, s3
1270 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
1271 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1272 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
1273 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1274 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
1275 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1276 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
1277 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1278 ; GFX10-NEXT: s_endpgm
1280 ; GFX11-LABEL: dyn_insertelement_v8f64_v_s_s:
1281 ; GFX11: ; %bb.0: ; %entry
1282 ; GFX11-NEXT: s_lshl_b32 m0, s4, 1
1283 ; GFX11-NEXT: v_movreld_b32_e32 v0, s2
1284 ; GFX11-NEXT: v_movreld_b32_e32 v1, s3
1285 ; GFX11-NEXT: global_store_b128 v[0:1], v[0:3], off dlc
1286 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1287 ; GFX11-NEXT: global_store_b128 v[0:1], v[4:7], off dlc
1288 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1289 ; GFX11-NEXT: global_store_b128 v[0:1], v[8:11], off dlc
1290 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1291 ; GFX11-NEXT: global_store_b128 v[0:1], v[12:15], off dlc
1292 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1293 ; GFX11-NEXT: s_nop 0
1294 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1295 ; GFX11-NEXT: s_endpgm
1297 %insert = insertelement <8 x double> %vec, double %val, i32 %idx
1298 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
1299 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
1300 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
1301 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
1302 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
1303 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
1304 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
1305 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
1309 define amdgpu_ps void @dyn_insertelement_v8f64_s_v_v(<8 x double> inreg %vec, double %val, i32 %idx) {
1310 ; GPRIDX-LABEL: dyn_insertelement_v8f64_s_v_v:
1311 ; GPRIDX: ; %bb.0: ; %entry
1312 ; GPRIDX-NEXT: s_mov_b32 s1, s3
1313 ; GPRIDX-NEXT: s_mov_b32 s3, s5
1314 ; GPRIDX-NEXT: s_mov_b32 s5, s7
1315 ; GPRIDX-NEXT: s_mov_b32 s7, s9
1316 ; GPRIDX-NEXT: s_mov_b32 s9, s11
1317 ; GPRIDX-NEXT: s_mov_b32 s11, s13
1318 ; GPRIDX-NEXT: s_mov_b32 s13, s15
1319 ; GPRIDX-NEXT: s_mov_b32 s15, s17
1320 ; GPRIDX-NEXT: s_mov_b32 s0, s2
1321 ; GPRIDX-NEXT: s_mov_b32 s2, s4
1322 ; GPRIDX-NEXT: s_mov_b32 s4, s6
1323 ; GPRIDX-NEXT: s_mov_b32 s6, s8
1324 ; GPRIDX-NEXT: s_mov_b32 s8, s10
1325 ; GPRIDX-NEXT: s_mov_b32 s10, s12
1326 ; GPRIDX-NEXT: s_mov_b32 s12, s14
1327 ; GPRIDX-NEXT: s_mov_b32 s14, s16
1328 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s15
1329 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s14
1330 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s13
1331 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s12
1332 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s11
1333 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s10
1334 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s9
1335 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s8
1336 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s7
1337 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s6
1338 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s5
1339 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s4
1340 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s3
1341 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s2
1342 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s1
1343 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s0
1344 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v2
1345 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[12:13], 0, v2
1346 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[0:1], 2, v2
1347 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[2:3], 3, v2
1348 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[4:5], 4, v2
1349 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[6:7], 5, v2
1350 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[8:9], 6, v2
1351 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[10:11], 7, v2
1352 ; GPRIDX-NEXT: v_cndmask_b32_e64 v3, v3, v0, s[12:13]
1353 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v0, vcc
1354 ; GPRIDX-NEXT: v_cndmask_b32_e64 v4, v4, v1, s[12:13]
1355 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v1, vcc
1356 ; GPRIDX-NEXT: v_cndmask_b32_e64 v7, v7, v0, s[0:1]
1357 ; GPRIDX-NEXT: v_cndmask_b32_e64 v9, v9, v0, s[2:3]
1358 ; GPRIDX-NEXT: v_cndmask_b32_e64 v11, v11, v0, s[4:5]
1359 ; GPRIDX-NEXT: v_cndmask_b32_e64 v13, v13, v0, s[6:7]
1360 ; GPRIDX-NEXT: v_cndmask_b32_e64 v15, v15, v0, s[8:9]
1361 ; GPRIDX-NEXT: v_cndmask_b32_e64 v17, v17, v0, s[10:11]
1362 ; GPRIDX-NEXT: v_cndmask_b32_e64 v8, v8, v1, s[0:1]
1363 ; GPRIDX-NEXT: v_cndmask_b32_e64 v10, v10, v1, s[2:3]
1364 ; GPRIDX-NEXT: v_cndmask_b32_e64 v12, v12, v1, s[4:5]
1365 ; GPRIDX-NEXT: v_cndmask_b32_e64 v14, v14, v1, s[6:7]
1366 ; GPRIDX-NEXT: v_cndmask_b32_e64 v16, v16, v1, s[8:9]
1367 ; GPRIDX-NEXT: v_cndmask_b32_e64 v18, v18, v1, s[10:11]
1368 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[3:6], off
1369 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1370 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[7:10], off
1371 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1372 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[11:14], off
1373 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1374 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[15:18], off
1375 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1376 ; GPRIDX-NEXT: s_endpgm
1378 ; GFX10-LABEL: dyn_insertelement_v8f64_s_v_v:
1379 ; GFX10: ; %bb.0: ; %entry
1380 ; GFX10-NEXT: s_mov_b32 s1, s3
1381 ; GFX10-NEXT: s_mov_b32 s3, s5
1382 ; GFX10-NEXT: s_mov_b32 s5, s7
1383 ; GFX10-NEXT: s_mov_b32 s7, s9
1384 ; GFX10-NEXT: s_mov_b32 s9, s11
1385 ; GFX10-NEXT: s_mov_b32 s11, s13
1386 ; GFX10-NEXT: s_mov_b32 s13, s15
1387 ; GFX10-NEXT: s_mov_b32 s15, s17
1388 ; GFX10-NEXT: s_mov_b32 s0, s2
1389 ; GFX10-NEXT: s_mov_b32 s2, s4
1390 ; GFX10-NEXT: s_mov_b32 s4, s6
1391 ; GFX10-NEXT: s_mov_b32 s6, s8
1392 ; GFX10-NEXT: s_mov_b32 s8, s10
1393 ; GFX10-NEXT: s_mov_b32 s10, s12
1394 ; GFX10-NEXT: s_mov_b32 s12, s14
1395 ; GFX10-NEXT: s_mov_b32 s14, s16
1396 ; GFX10-NEXT: v_mov_b32_e32 v18, s15
1397 ; GFX10-NEXT: v_mov_b32_e32 v17, s14
1398 ; GFX10-NEXT: v_mov_b32_e32 v16, s13
1399 ; GFX10-NEXT: v_mov_b32_e32 v15, s12
1400 ; GFX10-NEXT: v_mov_b32_e32 v14, s11
1401 ; GFX10-NEXT: v_mov_b32_e32 v13, s10
1402 ; GFX10-NEXT: v_mov_b32_e32 v12, s9
1403 ; GFX10-NEXT: v_mov_b32_e32 v11, s8
1404 ; GFX10-NEXT: v_mov_b32_e32 v10, s7
1405 ; GFX10-NEXT: v_mov_b32_e32 v9, s6
1406 ; GFX10-NEXT: v_mov_b32_e32 v8, s5
1407 ; GFX10-NEXT: v_mov_b32_e32 v7, s4
1408 ; GFX10-NEXT: v_mov_b32_e32 v6, s3
1409 ; GFX10-NEXT: v_mov_b32_e32 v5, s2
1410 ; GFX10-NEXT: v_mov_b32_e32 v4, s1
1411 ; GFX10-NEXT: v_mov_b32_e32 v3, s0
1412 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
1413 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 1, v2
1414 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 3, v2
1415 ; GFX10-NEXT: v_cmp_eq_u32_e64 s6, 2, v2
1416 ; GFX10-NEXT: v_cmp_eq_u32_e64 s2, 4, v2
1417 ; GFX10-NEXT: v_cmp_eq_u32_e64 s3, 5, v2
1418 ; GFX10-NEXT: v_cmp_eq_u32_e64 s4, 6, v2
1419 ; GFX10-NEXT: v_cmp_eq_u32_e64 s5, 7, v2
1420 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc_lo
1421 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, v0, s0
1422 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v1, vcc_lo
1423 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v1, s0
1424 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, v0, s6
1425 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v0, s1
1426 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, v1, s6
1427 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, v1, s1
1428 ; GFX10-NEXT: v_cndmask_b32_e64 v11, v11, v0, s2
1429 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v13, v0, s3
1430 ; GFX10-NEXT: v_cndmask_b32_e64 v12, v12, v1, s2
1431 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, v1, s3
1432 ; GFX10-NEXT: v_cndmask_b32_e64 v15, v15, v0, s4
1433 ; GFX10-NEXT: v_cndmask_b32_e64 v17, v17, v0, s5
1434 ; GFX10-NEXT: v_cndmask_b32_e64 v16, v16, v1, s4
1435 ; GFX10-NEXT: v_cndmask_b32_e64 v18, v18, v1, s5
1436 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[3:6], off
1437 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1438 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[7:10], off
1439 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1440 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[11:14], off
1441 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1442 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[15:18], off
1443 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1444 ; GFX10-NEXT: s_endpgm
1446 ; GFX11-LABEL: dyn_insertelement_v8f64_s_v_v:
1447 ; GFX11: ; %bb.0: ; %entry
1448 ; GFX11-NEXT: s_mov_b32 s1, s3
1449 ; GFX11-NEXT: s_mov_b32 s3, s5
1450 ; GFX11-NEXT: s_mov_b32 s5, s7
1451 ; GFX11-NEXT: s_mov_b32 s7, s9
1452 ; GFX11-NEXT: s_mov_b32 s9, s11
1453 ; GFX11-NEXT: s_mov_b32 s11, s13
1454 ; GFX11-NEXT: s_mov_b32 s13, s15
1455 ; GFX11-NEXT: s_mov_b32 s15, s17
1456 ; GFX11-NEXT: s_mov_b32 s0, s2
1457 ; GFX11-NEXT: s_mov_b32 s2, s4
1458 ; GFX11-NEXT: s_mov_b32 s4, s6
1459 ; GFX11-NEXT: s_mov_b32 s6, s8
1460 ; GFX11-NEXT: s_mov_b32 s8, s10
1461 ; GFX11-NEXT: s_mov_b32 s10, s12
1462 ; GFX11-NEXT: s_mov_b32 s12, s14
1463 ; GFX11-NEXT: s_mov_b32 s14, s16
1464 ; GFX11-NEXT: v_dual_mov_b32 v18, s15 :: v_dual_mov_b32 v17, s14
1465 ; GFX11-NEXT: v_dual_mov_b32 v4, s1 :: v_dual_mov_b32 v3, s0
1466 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
1467 ; GFX11-NEXT: v_dual_mov_b32 v16, s13 :: v_dual_mov_b32 v15, s12
1468 ; GFX11-NEXT: v_dual_mov_b32 v14, s11 :: v_dual_mov_b32 v13, s10
1469 ; GFX11-NEXT: v_dual_mov_b32 v12, s9 :: v_dual_mov_b32 v11, s8
1470 ; GFX11-NEXT: v_dual_mov_b32 v10, s7 :: v_dual_mov_b32 v9, s6
1471 ; GFX11-NEXT: v_dual_mov_b32 v8, s5 :: v_dual_mov_b32 v7, s4
1472 ; GFX11-NEXT: v_dual_mov_b32 v6, s3 :: v_dual_mov_b32 v5, s2
1473 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 1, v2
1474 ; GFX11-NEXT: v_dual_cndmask_b32 v3, v3, v0 :: v_dual_cndmask_b32 v4, v4, v1
1475 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
1476 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 7, v2
1477 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, v0, s0
1478 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v1, s0
1479 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 3, v2
1480 ; GFX11-NEXT: v_dual_cndmask_b32 v7, v7, v0 :: v_dual_cndmask_b32 v8, v8, v1
1481 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v2
1482 ; GFX11-NEXT: v_cndmask_b32_e64 v17, v17, v0, s1
1483 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, v0, s0
1484 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, v1, s0
1485 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 5, v2
1486 ; GFX11-NEXT: v_dual_cndmask_b32 v11, v11, v0 :: v_dual_cndmask_b32 v12, v12, v1
1487 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v2
1488 ; GFX11-NEXT: v_cndmask_b32_e64 v18, v18, v1, s1
1489 ; GFX11-NEXT: v_cndmask_b32_e64 v13, v13, v0, s0
1490 ; GFX11-NEXT: v_cndmask_b32_e64 v14, v14, v1, s0
1491 ; GFX11-NEXT: v_dual_cndmask_b32 v15, v15, v0 :: v_dual_cndmask_b32 v16, v16, v1
1492 ; GFX11-NEXT: global_store_b128 v[0:1], v[3:6], off dlc
1493 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1494 ; GFX11-NEXT: global_store_b128 v[0:1], v[7:10], off dlc
1495 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1496 ; GFX11-NEXT: global_store_b128 v[0:1], v[11:14], off dlc
1497 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1498 ; GFX11-NEXT: global_store_b128 v[0:1], v[15:18], off dlc
1499 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1500 ; GFX11-NEXT: s_nop 0
1501 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1502 ; GFX11-NEXT: s_endpgm
1504 %insert = insertelement <8 x double> %vec, double %val, i32 %idx
1505 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
1506 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
1507 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
1508 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
1509 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
1510 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
1511 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
1512 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
1516 define amdgpu_ps void @dyn_insertelement_v8f64_v_s_v(<8 x double> %vec, double inreg %val, i32 %idx) {
1517 ; GPRIDX-LABEL: dyn_insertelement_v8f64_v_s_v:
1518 ; GPRIDX: ; %bb.0: ; %entry
1519 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s2
1520 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v16
1521 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[0:1], 1, v16
1522 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[14:15], 2, v16
1523 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[4:5], 3, v16
1524 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[6:7], 4, v16
1525 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[8:9], 5, v16
1526 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[10:11], 7, v16
1527 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[12:13], 6, v16
1528 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s3
1529 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v17, vcc
1530 ; GPRIDX-NEXT: v_cndmask_b32_e64 v2, v2, v17, s[0:1]
1531 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v16, vcc
1532 ; GPRIDX-NEXT: v_cndmask_b32_e64 v3, v3, v16, s[0:1]
1533 ; GPRIDX-NEXT: v_cndmask_b32_e64 v4, v4, v17, s[14:15]
1534 ; GPRIDX-NEXT: v_cndmask_b32_e64 v6, v6, v17, s[4:5]
1535 ; GPRIDX-NEXT: v_cndmask_b32_e64 v8, v8, v17, s[6:7]
1536 ; GPRIDX-NEXT: v_cndmask_b32_e64 v10, v10, v17, s[8:9]
1537 ; GPRIDX-NEXT: v_cndmask_b32_e64 v12, v12, v17, s[12:13]
1538 ; GPRIDX-NEXT: v_cndmask_b32_e64 v14, v14, v17, s[10:11]
1539 ; GPRIDX-NEXT: v_cndmask_b32_e64 v5, v5, v16, s[14:15]
1540 ; GPRIDX-NEXT: v_cndmask_b32_e64 v7, v7, v16, s[4:5]
1541 ; GPRIDX-NEXT: v_cndmask_b32_e64 v9, v9, v16, s[6:7]
1542 ; GPRIDX-NEXT: v_cndmask_b32_e64 v11, v11, v16, s[8:9]
1543 ; GPRIDX-NEXT: v_cndmask_b32_e64 v13, v13, v16, s[12:13]
1544 ; GPRIDX-NEXT: v_cndmask_b32_e64 v15, v15, v16, s[10:11]
1545 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
1546 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1547 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
1548 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1549 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
1550 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1551 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
1552 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1553 ; GPRIDX-NEXT: s_endpgm
1555 ; GFX10-LABEL: dyn_insertelement_v8f64_v_s_v:
1556 ; GFX10: ; %bb.0: ; %entry
1557 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v16
1558 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v0, s2, vcc_lo
1559 ; GFX10-NEXT: v_cndmask_b32_e64 v1, v1, s3, vcc_lo
1560 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v16
1561 ; GFX10-NEXT: v_cndmask_b32_e64 v2, v2, s2, vcc_lo
1562 ; GFX10-NEXT: v_cndmask_b32_e64 v3, v3, s3, vcc_lo
1563 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v16
1564 ; GFX10-NEXT: v_cndmask_b32_e64 v4, v4, s2, vcc_lo
1565 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, s3, vcc_lo
1566 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v16
1567 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, s2, vcc_lo
1568 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, s3, vcc_lo
1569 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v16
1570 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, s2, vcc_lo
1571 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, s3, vcc_lo
1572 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v16
1573 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, s2, vcc_lo
1574 ; GFX10-NEXT: v_cndmask_b32_e64 v11, v11, s3, vcc_lo
1575 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v16
1576 ; GFX10-NEXT: v_cndmask_b32_e64 v12, v12, s2, vcc_lo
1577 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v13, s3, vcc_lo
1578 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v16
1579 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, s2, vcc_lo
1580 ; GFX10-NEXT: v_cndmask_b32_e64 v15, v15, s3, vcc_lo
1581 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
1582 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1583 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
1584 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1585 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
1586 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1587 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
1588 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1589 ; GFX10-NEXT: s_endpgm
1591 ; GFX11-LABEL: dyn_insertelement_v8f64_v_s_v:
1592 ; GFX11: ; %bb.0: ; %entry
1593 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v16
1594 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v0, s2, vcc_lo
1595 ; GFX11-NEXT: v_cndmask_b32_e64 v1, v1, s3, vcc_lo
1596 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v16
1597 ; GFX11-NEXT: v_cndmask_b32_e64 v2, v2, s2, vcc_lo
1598 ; GFX11-NEXT: v_cndmask_b32_e64 v3, v3, s3, vcc_lo
1599 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v16
1600 ; GFX11-NEXT: v_cndmask_b32_e64 v4, v4, s2, vcc_lo
1601 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, s3, vcc_lo
1602 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v16
1603 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, s2, vcc_lo
1604 ; GFX11-NEXT: v_cndmask_b32_e64 v7, v7, s3, vcc_lo
1605 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v16
1606 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v8, s2, vcc_lo
1607 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, s3, vcc_lo
1608 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v16
1609 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, s2, vcc_lo
1610 ; GFX11-NEXT: v_cndmask_b32_e64 v11, v11, s3, vcc_lo
1611 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v16
1612 ; GFX11-NEXT: v_cndmask_b32_e64 v12, v12, s2, vcc_lo
1613 ; GFX11-NEXT: v_cndmask_b32_e64 v13, v13, s3, vcc_lo
1614 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v16
1615 ; GFX11-NEXT: v_cndmask_b32_e64 v14, v14, s2, vcc_lo
1616 ; GFX11-NEXT: v_cndmask_b32_e64 v15, v15, s3, vcc_lo
1617 ; GFX11-NEXT: global_store_b128 v[0:1], v[0:3], off dlc
1618 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1619 ; GFX11-NEXT: global_store_b128 v[0:1], v[4:7], off dlc
1620 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1621 ; GFX11-NEXT: global_store_b128 v[0:1], v[8:11], off dlc
1622 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1623 ; GFX11-NEXT: global_store_b128 v[0:1], v[12:15], off dlc
1624 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1625 ; GFX11-NEXT: s_nop 0
1626 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1627 ; GFX11-NEXT: s_endpgm
1629 %insert = insertelement <8 x double> %vec, double %val, i32 %idx
1630 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
1631 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
1632 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
1633 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
1634 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
1635 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
1636 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
1637 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
1641 define amdgpu_ps void @dyn_insertelement_v8f64_v_v_s(<8 x double> %vec, double %val, i32 inreg %idx) {
1642 ; GPRIDX-LABEL: dyn_insertelement_v8f64_v_v_s:
1643 ; GPRIDX: ; %bb.0: ; %entry
1644 ; GPRIDX-NEXT: s_lshl_b32 s0, s2, 1
1645 ; GPRIDX-NEXT: s_set_gpr_idx_on s0, gpr_idx(DST)
1646 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v16
1647 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v17
1648 ; GPRIDX-NEXT: s_set_gpr_idx_off
1649 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
1650 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1651 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
1652 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1653 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
1654 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1655 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
1656 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1657 ; GPRIDX-NEXT: s_endpgm
1659 ; GFX10-LABEL: dyn_insertelement_v8f64_v_v_s:
1660 ; GFX10: ; %bb.0: ; %entry
1661 ; GFX10-NEXT: s_lshl_b32 m0, s2, 1
1662 ; GFX10-NEXT: v_movreld_b32_e32 v0, v16
1663 ; GFX10-NEXT: v_movreld_b32_e32 v1, v17
1664 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
1665 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1666 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
1667 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1668 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
1669 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1670 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
1671 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1672 ; GFX10-NEXT: s_endpgm
1674 ; GFX11-LABEL: dyn_insertelement_v8f64_v_v_s:
1675 ; GFX11: ; %bb.0: ; %entry
1676 ; GFX11-NEXT: s_lshl_b32 m0, s2, 1
1677 ; GFX11-NEXT: v_movreld_b32_e32 v0, v16
1678 ; GFX11-NEXT: v_movreld_b32_e32 v1, v17
1679 ; GFX11-NEXT: global_store_b128 v[0:1], v[0:3], off dlc
1680 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1681 ; GFX11-NEXT: global_store_b128 v[0:1], v[4:7], off dlc
1682 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1683 ; GFX11-NEXT: global_store_b128 v[0:1], v[8:11], off dlc
1684 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1685 ; GFX11-NEXT: global_store_b128 v[0:1], v[12:15], off dlc
1686 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1687 ; GFX11-NEXT: s_nop 0
1688 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1689 ; GFX11-NEXT: s_endpgm
1691 %insert = insertelement <8 x double> %vec, double %val, i32 %idx
1692 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
1693 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
1694 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
1695 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
1696 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
1697 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
1698 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
1699 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
1703 define amdgpu_ps void @dyn_insertelement_v8f64_v_v_v(<8 x double> %vec, double %val, i32 %idx) {
1704 ; GPRIDX-LABEL: dyn_insertelement_v8f64_v_v_v:
1705 ; GPRIDX: ; %bb.0: ; %entry
1706 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v18
1707 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[0:1], 1, v18
1708 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v16, vcc
1709 ; GPRIDX-NEXT: v_cndmask_b32_e64 v2, v2, v16, s[0:1]
1710 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[2:3], 2, v18
1711 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[4:5], 3, v18
1712 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[6:7], 4, v18
1713 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[8:9], 5, v18
1714 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[10:11], 7, v18
1715 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[12:13], 6, v18
1716 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v17, vcc
1717 ; GPRIDX-NEXT: v_cndmask_b32_e64 v3, v3, v17, s[0:1]
1718 ; GPRIDX-NEXT: v_cndmask_b32_e64 v4, v4, v16, s[2:3]
1719 ; GPRIDX-NEXT: v_cndmask_b32_e64 v6, v6, v16, s[4:5]
1720 ; GPRIDX-NEXT: v_cndmask_b32_e64 v8, v8, v16, s[6:7]
1721 ; GPRIDX-NEXT: v_cndmask_b32_e64 v10, v10, v16, s[8:9]
1722 ; GPRIDX-NEXT: v_cndmask_b32_e64 v12, v12, v16, s[12:13]
1723 ; GPRIDX-NEXT: v_cndmask_b32_e64 v14, v14, v16, s[10:11]
1724 ; GPRIDX-NEXT: v_cndmask_b32_e64 v5, v5, v17, s[2:3]
1725 ; GPRIDX-NEXT: v_cndmask_b32_e64 v7, v7, v17, s[4:5]
1726 ; GPRIDX-NEXT: v_cndmask_b32_e64 v9, v9, v17, s[6:7]
1727 ; GPRIDX-NEXT: v_cndmask_b32_e64 v11, v11, v17, s[8:9]
1728 ; GPRIDX-NEXT: v_cndmask_b32_e64 v13, v13, v17, s[12:13]
1729 ; GPRIDX-NEXT: v_cndmask_b32_e64 v15, v15, v17, s[10:11]
1730 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
1731 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1732 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
1733 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1734 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
1735 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1736 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
1737 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
1738 ; GPRIDX-NEXT: s_endpgm
1740 ; GFX10-LABEL: dyn_insertelement_v8f64_v_v_v:
1741 ; GFX10: ; %bb.0: ; %entry
1742 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v18
1743 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 1, v18
1744 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 2, v18
1745 ; GFX10-NEXT: v_cmp_eq_u32_e64 s2, 3, v18
1746 ; GFX10-NEXT: v_cmp_eq_u32_e64 s3, 4, v18
1747 ; GFX10-NEXT: v_cmp_eq_u32_e64 s4, 5, v18
1748 ; GFX10-NEXT: v_cmp_eq_u32_e64 s5, 7, v18
1749 ; GFX10-NEXT: v_cmp_eq_u32_e64 s6, 6, v18
1750 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v0, v16, vcc_lo
1751 ; GFX10-NEXT: v_cndmask_b32_e64 v2, v2, v16, s0
1752 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v1, v17, vcc_lo
1753 ; GFX10-NEXT: v_cndmask_b32_e64 v3, v3, v17, s0
1754 ; GFX10-NEXT: v_cndmask_b32_e64 v4, v4, v16, s1
1755 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v16, s2
1756 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, v17, s1
1757 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, v17, s2
1758 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, v16, s3
1759 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, v16, s4
1760 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v17, s3
1761 ; GFX10-NEXT: v_cndmask_b32_e64 v11, v11, v17, s4
1762 ; GFX10-NEXT: v_cndmask_b32_e64 v12, v12, v16, s6
1763 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, v16, s5
1764 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v13, v17, s6
1765 ; GFX10-NEXT: v_cndmask_b32_e64 v15, v15, v17, s5
1766 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
1767 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1768 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
1769 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1770 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
1771 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1772 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
1773 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
1774 ; GFX10-NEXT: s_endpgm
1776 ; GFX11-LABEL: dyn_insertelement_v8f64_v_v_v:
1777 ; GFX11: ; %bb.0: ; %entry
1778 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v18
1779 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 1, v18
1780 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 2, v18
1781 ; GFX11-NEXT: v_cmp_eq_u32_e64 s2, 3, v18
1782 ; GFX11-NEXT: v_cmp_eq_u32_e64 s3, 4, v18
1783 ; GFX11-NEXT: v_cmp_eq_u32_e64 s4, 5, v18
1784 ; GFX11-NEXT: v_cmp_eq_u32_e64 s5, 7, v18
1785 ; GFX11-NEXT: v_cmp_eq_u32_e64 s6, 6, v18
1786 ; GFX11-NEXT: v_dual_cndmask_b32 v0, v0, v16 :: v_dual_cndmask_b32 v1, v1, v17
1787 ; GFX11-NEXT: v_cndmask_b32_e64 v2, v2, v16, s0
1788 ; GFX11-NEXT: v_cndmask_b32_e64 v3, v3, v17, s0
1789 ; GFX11-NEXT: v_cndmask_b32_e64 v4, v4, v16, s1
1790 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v16, s2
1791 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, v17, s1
1792 ; GFX11-NEXT: v_cndmask_b32_e64 v7, v7, v17, s2
1793 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v8, v16, s3
1794 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, v16, s4
1795 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, v17, s3
1796 ; GFX11-NEXT: v_cndmask_b32_e64 v11, v11, v17, s4
1797 ; GFX11-NEXT: v_cndmask_b32_e64 v12, v12, v16, s6
1798 ; GFX11-NEXT: v_cndmask_b32_e64 v14, v14, v16, s5
1799 ; GFX11-NEXT: v_cndmask_b32_e64 v13, v13, v17, s6
1800 ; GFX11-NEXT: v_cndmask_b32_e64 v15, v15, v17, s5
1801 ; GFX11-NEXT: global_store_b128 v[0:1], v[0:3], off dlc
1802 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1803 ; GFX11-NEXT: global_store_b128 v[0:1], v[4:7], off dlc
1804 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1805 ; GFX11-NEXT: global_store_b128 v[0:1], v[8:11], off dlc
1806 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1807 ; GFX11-NEXT: global_store_b128 v[0:1], v[12:15], off dlc
1808 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1809 ; GFX11-NEXT: s_nop 0
1810 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1811 ; GFX11-NEXT: s_endpgm
1813 %insert = insertelement <8 x double> %vec, double %val, i32 %idx
1814 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
1815 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
1816 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
1817 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
1818 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
1819 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
1820 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
1821 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
1825 define amdgpu_ps <3 x i32> @dyn_insertelement_v3i32_s_s_s(<3 x i32> inreg %vec, i32 inreg %val, i32 inreg %idx) {
1826 ; GPRIDX-LABEL: dyn_insertelement_v3i32_s_s_s:
1827 ; GPRIDX: ; %bb.0: ; %entry
1828 ; GPRIDX-NEXT: s_cmp_eq_u32 s6, 0
1829 ; GPRIDX-NEXT: s_cselect_b32 s0, s5, s2
1830 ; GPRIDX-NEXT: s_cmp_eq_u32 s6, 1
1831 ; GPRIDX-NEXT: s_cselect_b32 s1, s5, s3
1832 ; GPRIDX-NEXT: s_cmp_eq_u32 s6, 2
1833 ; GPRIDX-NEXT: s_cselect_b32 s2, s5, s4
1834 ; GPRIDX-NEXT: ; return to shader part epilog
1836 ; GFX10PLUS-LABEL: dyn_insertelement_v3i32_s_s_s:
1837 ; GFX10PLUS: ; %bb.0: ; %entry
1838 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s6, 0
1839 ; GFX10PLUS-NEXT: s_cselect_b32 s0, s5, s2
1840 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s6, 1
1841 ; GFX10PLUS-NEXT: s_cselect_b32 s1, s5, s3
1842 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s6, 2
1843 ; GFX10PLUS-NEXT: s_cselect_b32 s2, s5, s4
1844 ; GFX10PLUS-NEXT: ; return to shader part epilog
1846 %insert = insertelement <3 x i32> %vec, i32 %val, i32 %idx
1847 ret <3 x i32> %insert
1850 define amdgpu_ps <3 x float> @dyn_insertelement_v3i32_v_v_s(<3 x float> %vec, float %val, i32 inreg %idx) {
1851 ; GPRIDX-LABEL: dyn_insertelement_v3i32_v_v_s:
1852 ; GPRIDX: ; %bb.0: ; %entry
1853 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 0
1854 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v3, vcc
1855 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 1
1856 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc
1857 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 2
1858 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v3, vcc
1859 ; GPRIDX-NEXT: ; return to shader part epilog
1861 ; GFX10PLUS-LABEL: dyn_insertelement_v3i32_v_v_s:
1862 ; GFX10PLUS: ; %bb.0: ; %entry
1863 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 0
1864 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v3, vcc_lo
1865 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 1
1866 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc_lo
1867 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 2
1868 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v3, vcc_lo
1869 ; GFX10PLUS-NEXT: ; return to shader part epilog
1871 %insert = insertelement <3 x float> %vec, float %val, i32 %idx
1872 ret <3 x float> %insert
1875 define amdgpu_ps <5 x i32> @dyn_insertelement_v5i32_s_s_s(<5 x i32> inreg %vec, i32 inreg %val, i32 inreg %idx) {
1876 ; GPRIDX-LABEL: dyn_insertelement_v5i32_s_s_s:
1877 ; GPRIDX: ; %bb.0: ; %entry
1878 ; GPRIDX-NEXT: s_cmp_eq_u32 s8, 0
1879 ; GPRIDX-NEXT: s_cselect_b32 s0, s7, s2
1880 ; GPRIDX-NEXT: s_cmp_eq_u32 s8, 1
1881 ; GPRIDX-NEXT: s_cselect_b32 s1, s7, s3
1882 ; GPRIDX-NEXT: s_cmp_eq_u32 s8, 2
1883 ; GPRIDX-NEXT: s_cselect_b32 s2, s7, s4
1884 ; GPRIDX-NEXT: s_cmp_eq_u32 s8, 3
1885 ; GPRIDX-NEXT: s_cselect_b32 s3, s7, s5
1886 ; GPRIDX-NEXT: s_cmp_eq_u32 s8, 4
1887 ; GPRIDX-NEXT: s_cselect_b32 s4, s7, s6
1888 ; GPRIDX-NEXT: ; return to shader part epilog
1890 ; GFX10PLUS-LABEL: dyn_insertelement_v5i32_s_s_s:
1891 ; GFX10PLUS: ; %bb.0: ; %entry
1892 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s8, 0
1893 ; GFX10PLUS-NEXT: s_cselect_b32 s0, s7, s2
1894 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s8, 1
1895 ; GFX10PLUS-NEXT: s_cselect_b32 s1, s7, s3
1896 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s8, 2
1897 ; GFX10PLUS-NEXT: s_cselect_b32 s2, s7, s4
1898 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s8, 3
1899 ; GFX10PLUS-NEXT: s_cselect_b32 s3, s7, s5
1900 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s8, 4
1901 ; GFX10PLUS-NEXT: s_cselect_b32 s4, s7, s6
1902 ; GFX10PLUS-NEXT: ; return to shader part epilog
1904 %insert = insertelement <5 x i32> %vec, i32 %val, i32 %idx
1905 ret <5 x i32> %insert
1908 define amdgpu_ps <5 x float> @dyn_insertelement_v5i32_v_v_s(<5 x float> %vec, float %val, i32 inreg %idx) {
1909 ; GPRIDX-LABEL: dyn_insertelement_v5i32_v_v_s:
1910 ; GPRIDX: ; %bb.0: ; %entry
1911 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 0
1912 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v5, vcc
1913 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 1
1914 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v5, vcc
1915 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 2
1916 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v5, vcc
1917 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 3
1918 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v5, vcc
1919 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 4
1920 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v5, vcc
1921 ; GPRIDX-NEXT: ; return to shader part epilog
1923 ; GFX10PLUS-LABEL: dyn_insertelement_v5i32_v_v_s:
1924 ; GFX10PLUS: ; %bb.0: ; %entry
1925 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 0
1926 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v5, vcc_lo
1927 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 1
1928 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v5, vcc_lo
1929 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 2
1930 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v5, vcc_lo
1931 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 3
1932 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v5, vcc_lo
1933 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 4
1934 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v5, vcc_lo
1935 ; GFX10PLUS-NEXT: ; return to shader part epilog
1937 %insert = insertelement <5 x float> %vec, float %val, i32 %idx
1938 ret <5 x float> %insert
1941 define amdgpu_ps <32 x i32> @dyn_insertelement_v32i32_s_s_s(<32 x i32> inreg %vec, i32 inreg %val, i32 inreg %idx) {
1942 ; GPRIDX-LABEL: dyn_insertelement_v32i32_s_s_s:
1943 ; GPRIDX: ; %bb.0: ; %entry
1944 ; GPRIDX-NEXT: s_mov_b32 s0, s2
1945 ; GPRIDX-NEXT: s_mov_b32 s1, s3
1946 ; GPRIDX-NEXT: s_mov_b32 s2, s4
1947 ; GPRIDX-NEXT: s_mov_b32 s3, s5
1948 ; GPRIDX-NEXT: s_mov_b32 s4, s6
1949 ; GPRIDX-NEXT: s_mov_b32 s5, s7
1950 ; GPRIDX-NEXT: s_mov_b32 s6, s8
1951 ; GPRIDX-NEXT: s_mov_b32 s7, s9
1952 ; GPRIDX-NEXT: s_mov_b32 s8, s10
1953 ; GPRIDX-NEXT: s_mov_b32 s9, s11
1954 ; GPRIDX-NEXT: s_mov_b32 s10, s12
1955 ; GPRIDX-NEXT: s_mov_b32 s11, s13
1956 ; GPRIDX-NEXT: s_mov_b32 s12, s14
1957 ; GPRIDX-NEXT: s_mov_b32 s13, s15
1958 ; GPRIDX-NEXT: s_mov_b32 s14, s16
1959 ; GPRIDX-NEXT: s_mov_b32 s15, s17
1960 ; GPRIDX-NEXT: s_mov_b32 s16, s18
1961 ; GPRIDX-NEXT: s_mov_b32 s17, s19
1962 ; GPRIDX-NEXT: s_mov_b32 s18, s20
1963 ; GPRIDX-NEXT: s_mov_b32 s19, s21
1964 ; GPRIDX-NEXT: s_mov_b32 s20, s22
1965 ; GPRIDX-NEXT: s_mov_b32 s21, s23
1966 ; GPRIDX-NEXT: s_mov_b32 s22, s24
1967 ; GPRIDX-NEXT: s_mov_b32 s23, s25
1968 ; GPRIDX-NEXT: s_mov_b32 s24, s26
1969 ; GPRIDX-NEXT: s_mov_b32 s25, s27
1970 ; GPRIDX-NEXT: s_mov_b32 s26, s28
1971 ; GPRIDX-NEXT: s_mov_b32 s27, s29
1972 ; GPRIDX-NEXT: s_mov_b32 s28, s30
1973 ; GPRIDX-NEXT: s_mov_b32 s29, s31
1974 ; GPRIDX-NEXT: s_mov_b32 s31, s33
1975 ; GPRIDX-NEXT: s_mov_b32 s30, s32
1976 ; GPRIDX-NEXT: s_mov_b32 m0, s35
1977 ; GPRIDX-NEXT: s_nop 0
1978 ; GPRIDX-NEXT: s_movreld_b32 s0, s34
1979 ; GPRIDX-NEXT: ; return to shader part epilog
1981 ; GFX10PLUS-LABEL: dyn_insertelement_v32i32_s_s_s:
1982 ; GFX10PLUS: ; %bb.0: ; %entry
1983 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
1984 ; GFX10PLUS-NEXT: s_mov_b32 m0, s35
1985 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
1986 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
1987 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
1988 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
1989 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
1990 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
1991 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
1992 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
1993 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
1994 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
1995 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
1996 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
1997 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
1998 ; GFX10PLUS-NEXT: s_mov_b32 s14, s16
1999 ; GFX10PLUS-NEXT: s_mov_b32 s15, s17
2000 ; GFX10PLUS-NEXT: s_mov_b32 s16, s18
2001 ; GFX10PLUS-NEXT: s_mov_b32 s17, s19
2002 ; GFX10PLUS-NEXT: s_mov_b32 s18, s20
2003 ; GFX10PLUS-NEXT: s_mov_b32 s19, s21
2004 ; GFX10PLUS-NEXT: s_mov_b32 s20, s22
2005 ; GFX10PLUS-NEXT: s_mov_b32 s21, s23
2006 ; GFX10PLUS-NEXT: s_mov_b32 s22, s24
2007 ; GFX10PLUS-NEXT: s_mov_b32 s23, s25
2008 ; GFX10PLUS-NEXT: s_mov_b32 s24, s26
2009 ; GFX10PLUS-NEXT: s_mov_b32 s25, s27
2010 ; GFX10PLUS-NEXT: s_mov_b32 s26, s28
2011 ; GFX10PLUS-NEXT: s_mov_b32 s27, s29
2012 ; GFX10PLUS-NEXT: s_mov_b32 s28, s30
2013 ; GFX10PLUS-NEXT: s_mov_b32 s29, s31
2014 ; GFX10PLUS-NEXT: s_mov_b32 s31, s33
2015 ; GFX10PLUS-NEXT: s_mov_b32 s30, s32
2016 ; GFX10PLUS-NEXT: s_movreld_b32 s0, s34
2017 ; GFX10PLUS-NEXT: ; return to shader part epilog
2019 %insert = insertelement <32 x i32> %vec, i32 %val, i32 %idx
2020 ret <32 x i32> %insert
2023 define amdgpu_ps <32 x float> @dyn_insertelement_v32i32_v_v_s(<32 x float> %vec, float %val, i32 inreg %idx) {
2024 ; GPRIDX-LABEL: dyn_insertelement_v32i32_v_v_s:
2025 ; GPRIDX: ; %bb.0: ; %entry
2026 ; GPRIDX-NEXT: s_set_gpr_idx_on s2, gpr_idx(DST)
2027 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v32
2028 ; GPRIDX-NEXT: s_set_gpr_idx_off
2029 ; GPRIDX-NEXT: ; return to shader part epilog
2031 ; GFX10PLUS-LABEL: dyn_insertelement_v32i32_v_v_s:
2032 ; GFX10PLUS: ; %bb.0: ; %entry
2033 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
2034 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v32
2035 ; GFX10PLUS-NEXT: ; return to shader part epilog
2037 %insert = insertelement <32 x float> %vec, float %val, i32 %idx
2038 ret <32 x float> %insert
2041 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_s_s_s_add_1(<8 x float> inreg %vec, float inreg %val, i32 inreg %idx) {
2042 ; GPRIDX-LABEL: dyn_insertelement_v8f32_s_s_s_add_1:
2043 ; GPRIDX: ; %bb.0: ; %entry
2044 ; GPRIDX-NEXT: s_add_i32 s11, s11, 1
2045 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 0
2046 ; GPRIDX-NEXT: s_cselect_b32 s0, s10, s2
2047 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 1
2048 ; GPRIDX-NEXT: s_cselect_b32 s1, s10, s3
2049 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 2
2050 ; GPRIDX-NEXT: s_cselect_b32 s2, s10, s4
2051 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 3
2052 ; GPRIDX-NEXT: s_cselect_b32 s3, s10, s5
2053 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 4
2054 ; GPRIDX-NEXT: s_cselect_b32 s4, s10, s6
2055 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 5
2056 ; GPRIDX-NEXT: s_cselect_b32 s5, s10, s7
2057 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 6
2058 ; GPRIDX-NEXT: s_cselect_b32 s6, s10, s8
2059 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 7
2060 ; GPRIDX-NEXT: s_cselect_b32 s7, s10, s9
2061 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
2062 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
2063 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2064 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2065 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2066 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2067 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2068 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2069 ; GPRIDX-NEXT: ; return to shader part epilog
2071 ; GFX10-LABEL: dyn_insertelement_v8f32_s_s_s_add_1:
2072 ; GFX10: ; %bb.0: ; %entry
2073 ; GFX10-NEXT: s_mov_b32 s1, s3
2074 ; GFX10-NEXT: s_mov_b32 m0, s11
2075 ; GFX10-NEXT: s_mov_b32 s0, s2
2076 ; GFX10-NEXT: s_mov_b32 s2, s4
2077 ; GFX10-NEXT: s_mov_b32 s3, s5
2078 ; GFX10-NEXT: s_mov_b32 s4, s6
2079 ; GFX10-NEXT: s_mov_b32 s5, s7
2080 ; GFX10-NEXT: s_mov_b32 s6, s8
2081 ; GFX10-NEXT: s_mov_b32 s7, s9
2082 ; GFX10-NEXT: s_movreld_b32 s1, s10
2083 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2084 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2085 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
2086 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
2087 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
2088 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
2089 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
2090 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
2091 ; GFX10-NEXT: ; return to shader part epilog
2093 ; GFX11-LABEL: dyn_insertelement_v8f32_s_s_s_add_1:
2094 ; GFX11: ; %bb.0: ; %entry
2095 ; GFX11-NEXT: s_mov_b32 s1, s3
2096 ; GFX11-NEXT: s_mov_b32 m0, s11
2097 ; GFX11-NEXT: s_mov_b32 s0, s2
2098 ; GFX11-NEXT: s_mov_b32 s2, s4
2099 ; GFX11-NEXT: s_mov_b32 s3, s5
2100 ; GFX11-NEXT: s_mov_b32 s4, s6
2101 ; GFX11-NEXT: s_mov_b32 s5, s7
2102 ; GFX11-NEXT: s_mov_b32 s6, s8
2103 ; GFX11-NEXT: s_mov_b32 s7, s9
2104 ; GFX11-NEXT: s_movreld_b32 s1, s10
2105 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2106 ; GFX11-NEXT: v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
2107 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_mov_b32 v5, s5
2108 ; GFX11-NEXT: v_dual_mov_b32 v6, s6 :: v_dual_mov_b32 v7, s7
2109 ; GFX11-NEXT: ; return to shader part epilog
2111 %idx.add = add i32 %idx, 1
2112 %insert = insertelement <8 x float> %vec, float %val, i32 %idx.add
2113 ret <8 x float> %insert
2116 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_s_s_s_add_7(<8 x float> inreg %vec, float inreg %val, i32 inreg %idx) {
2117 ; GPRIDX-LABEL: dyn_insertelement_v8f32_s_s_s_add_7:
2118 ; GPRIDX: ; %bb.0: ; %entry
2119 ; GPRIDX-NEXT: s_add_i32 s11, s11, 7
2120 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 0
2121 ; GPRIDX-NEXT: s_cselect_b32 s0, s10, s2
2122 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 1
2123 ; GPRIDX-NEXT: s_cselect_b32 s1, s10, s3
2124 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 2
2125 ; GPRIDX-NEXT: s_cselect_b32 s2, s10, s4
2126 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 3
2127 ; GPRIDX-NEXT: s_cselect_b32 s3, s10, s5
2128 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 4
2129 ; GPRIDX-NEXT: s_cselect_b32 s4, s10, s6
2130 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 5
2131 ; GPRIDX-NEXT: s_cselect_b32 s5, s10, s7
2132 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 6
2133 ; GPRIDX-NEXT: s_cselect_b32 s6, s10, s8
2134 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 7
2135 ; GPRIDX-NEXT: s_cselect_b32 s7, s10, s9
2136 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
2137 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
2138 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2139 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2140 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2141 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2142 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2143 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2144 ; GPRIDX-NEXT: ; return to shader part epilog
2146 ; GFX10-LABEL: dyn_insertelement_v8f32_s_s_s_add_7:
2147 ; GFX10: ; %bb.0: ; %entry
2148 ; GFX10-NEXT: s_mov_b32 s1, s3
2149 ; GFX10-NEXT: s_mov_b32 s3, s5
2150 ; GFX10-NEXT: s_mov_b32 s5, s7
2151 ; GFX10-NEXT: s_mov_b32 s7, s9
2152 ; GFX10-NEXT: s_mov_b32 m0, s11
2153 ; GFX10-NEXT: s_mov_b32 s0, s2
2154 ; GFX10-NEXT: s_mov_b32 s2, s4
2155 ; GFX10-NEXT: s_mov_b32 s4, s6
2156 ; GFX10-NEXT: s_mov_b32 s6, s8
2157 ; GFX10-NEXT: s_movreld_b32 s7, s10
2158 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2159 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2160 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
2161 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
2162 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
2163 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
2164 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
2165 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
2166 ; GFX10-NEXT: ; return to shader part epilog
2168 ; GFX11-LABEL: dyn_insertelement_v8f32_s_s_s_add_7:
2169 ; GFX11: ; %bb.0: ; %entry
2170 ; GFX11-NEXT: s_mov_b32 s1, s3
2171 ; GFX11-NEXT: s_mov_b32 s3, s5
2172 ; GFX11-NEXT: s_mov_b32 s5, s7
2173 ; GFX11-NEXT: s_mov_b32 s7, s9
2174 ; GFX11-NEXT: s_mov_b32 m0, s11
2175 ; GFX11-NEXT: s_mov_b32 s0, s2
2176 ; GFX11-NEXT: s_mov_b32 s2, s4
2177 ; GFX11-NEXT: s_mov_b32 s4, s6
2178 ; GFX11-NEXT: s_mov_b32 s6, s8
2179 ; GFX11-NEXT: s_movreld_b32 s7, s10
2180 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2181 ; GFX11-NEXT: v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
2182 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_mov_b32 v5, s5
2183 ; GFX11-NEXT: v_dual_mov_b32 v6, s6 :: v_dual_mov_b32 v7, s7
2184 ; GFX11-NEXT: ; return to shader part epilog
2186 %idx.add = add i32 %idx, 7
2187 %insert = insertelement <8 x float> %vec, float %val, i32 %idx.add
2188 ret <8 x float> %insert
2191 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_v_v_v_add_1(<8 x float> %vec, float %val, i32 %idx) {
2192 ; GPRIDX-LABEL: dyn_insertelement_v8f32_v_v_v_add_1:
2193 ; GPRIDX: ; %bb.0: ; %entry
2194 ; GPRIDX-NEXT: v_add_u32_e32 v9, 1, v9
2195 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v9
2196 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc
2197 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v9
2198 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc
2199 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v9
2200 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc
2201 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v9
2202 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc
2203 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v9
2204 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc
2205 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v9
2206 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc
2207 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v9
2208 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc
2209 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v9
2210 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc
2211 ; GPRIDX-NEXT: ; return to shader part epilog
2213 ; GFX10PLUS-LABEL: dyn_insertelement_v8f32_v_v_v_add_1:
2214 ; GFX10PLUS: ; %bb.0: ; %entry
2215 ; GFX10PLUS-NEXT: v_add_nc_u32_e32 v9, 1, v9
2216 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v9
2217 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc_lo
2218 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v9
2219 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc_lo
2220 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v9
2221 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc_lo
2222 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v9
2223 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc_lo
2224 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v9
2225 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc_lo
2226 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v9
2227 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc_lo
2228 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v9
2229 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc_lo
2230 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v9
2231 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc_lo
2232 ; GFX10PLUS-NEXT: ; return to shader part epilog
2234 %idx.add = add i32 %idx, 1
2235 %insert = insertelement <8 x float> %vec, float %val, i32 %idx.add
2236 ret <8 x float> %insert
2239 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_v_v_v_add_7(<8 x float> %vec, float %val, i32 %idx) {
2240 ; GPRIDX-LABEL: dyn_insertelement_v8f32_v_v_v_add_7:
2241 ; GPRIDX: ; %bb.0: ; %entry
2242 ; GPRIDX-NEXT: v_add_u32_e32 v9, 7, v9
2243 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v9
2244 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc
2245 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v9
2246 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc
2247 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v9
2248 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc
2249 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v9
2250 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc
2251 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v9
2252 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc
2253 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v9
2254 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc
2255 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v9
2256 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc
2257 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v9
2258 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc
2259 ; GPRIDX-NEXT: ; return to shader part epilog
2261 ; GFX10PLUS-LABEL: dyn_insertelement_v8f32_v_v_v_add_7:
2262 ; GFX10PLUS: ; %bb.0: ; %entry
2263 ; GFX10PLUS-NEXT: v_add_nc_u32_e32 v9, 7, v9
2264 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v9
2265 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc_lo
2266 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v9
2267 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc_lo
2268 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v9
2269 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc_lo
2270 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v9
2271 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc_lo
2272 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v9
2273 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc_lo
2274 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v9
2275 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc_lo
2276 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v9
2277 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc_lo
2278 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v9
2279 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc_lo
2280 ; GFX10PLUS-NEXT: ; return to shader part epilog
2282 %idx.add = add i32 %idx, 7
2283 %insert = insertelement <8 x float> %vec, float %val, i32 %idx.add
2284 ret <8 x float> %insert
2287 define amdgpu_ps void @dyn_insertelement_v8f64_s_s_s_add_1(<8 x double> inreg %vec, double inreg %val, i32 inreg %idx) {
2288 ; GPRIDX-LABEL: dyn_insertelement_v8f64_s_s_s_add_1:
2289 ; GPRIDX: ; %bb.0: ; %entry
2290 ; GPRIDX-NEXT: s_mov_b32 s0, s2
2291 ; GPRIDX-NEXT: s_mov_b32 s1, s3
2292 ; GPRIDX-NEXT: s_mov_b32 s2, s4
2293 ; GPRIDX-NEXT: s_mov_b32 s3, s5
2294 ; GPRIDX-NEXT: s_mov_b32 s4, s6
2295 ; GPRIDX-NEXT: s_mov_b32 s5, s7
2296 ; GPRIDX-NEXT: s_mov_b32 s6, s8
2297 ; GPRIDX-NEXT: s_mov_b32 s7, s9
2298 ; GPRIDX-NEXT: s_mov_b32 s8, s10
2299 ; GPRIDX-NEXT: s_mov_b32 s9, s11
2300 ; GPRIDX-NEXT: s_mov_b32 s10, s12
2301 ; GPRIDX-NEXT: s_mov_b32 s11, s13
2302 ; GPRIDX-NEXT: s_mov_b32 s12, s14
2303 ; GPRIDX-NEXT: s_mov_b32 s13, s15
2304 ; GPRIDX-NEXT: s_mov_b32 s14, s16
2305 ; GPRIDX-NEXT: s_mov_b32 s15, s17
2306 ; GPRIDX-NEXT: s_mov_b32 m0, s20
2307 ; GPRIDX-NEXT: s_nop 0
2308 ; GPRIDX-NEXT: s_movreld_b64 s[2:3], s[18:19]
2309 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
2310 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
2311 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2312 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2313 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2314 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2315 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s4
2316 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s5
2317 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s6
2318 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s7
2319 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2320 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2321 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s8
2322 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s9
2323 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s10
2324 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s11
2325 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2326 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2327 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s12
2328 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s13
2329 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s14
2330 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s15
2331 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2332 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2333 ; GPRIDX-NEXT: s_endpgm
2335 ; GFX10-LABEL: dyn_insertelement_v8f64_s_s_s_add_1:
2336 ; GFX10: ; %bb.0: ; %entry
2337 ; GFX10-NEXT: s_mov_b32 s0, s2
2338 ; GFX10-NEXT: s_mov_b32 s1, s3
2339 ; GFX10-NEXT: s_mov_b32 s2, s4
2340 ; GFX10-NEXT: s_mov_b32 s3, s5
2341 ; GFX10-NEXT: s_mov_b32 m0, s20
2342 ; GFX10-NEXT: s_mov_b32 s4, s6
2343 ; GFX10-NEXT: s_mov_b32 s5, s7
2344 ; GFX10-NEXT: s_mov_b32 s6, s8
2345 ; GFX10-NEXT: s_mov_b32 s7, s9
2346 ; GFX10-NEXT: s_mov_b32 s8, s10
2347 ; GFX10-NEXT: s_mov_b32 s9, s11
2348 ; GFX10-NEXT: s_mov_b32 s10, s12
2349 ; GFX10-NEXT: s_mov_b32 s11, s13
2350 ; GFX10-NEXT: s_mov_b32 s12, s14
2351 ; GFX10-NEXT: s_mov_b32 s13, s15
2352 ; GFX10-NEXT: s_mov_b32 s14, s16
2353 ; GFX10-NEXT: s_mov_b32 s15, s17
2354 ; GFX10-NEXT: s_movreld_b64 s[2:3], s[18:19]
2355 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2356 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2357 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
2358 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
2359 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
2360 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
2361 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
2362 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
2363 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
2364 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
2365 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
2366 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
2367 ; GFX10-NEXT: v_mov_b32_e32 v12, s12
2368 ; GFX10-NEXT: v_mov_b32_e32 v13, s13
2369 ; GFX10-NEXT: v_mov_b32_e32 v14, s14
2370 ; GFX10-NEXT: v_mov_b32_e32 v15, s15
2371 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2372 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2373 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
2374 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2375 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
2376 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2377 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
2378 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2379 ; GFX10-NEXT: s_endpgm
2381 ; GFX11-LABEL: dyn_insertelement_v8f64_s_s_s_add_1:
2382 ; GFX11: ; %bb.0: ; %entry
2383 ; GFX11-NEXT: s_mov_b32 s0, s2
2384 ; GFX11-NEXT: s_mov_b32 s1, s3
2385 ; GFX11-NEXT: s_mov_b32 s2, s4
2386 ; GFX11-NEXT: s_mov_b32 s3, s5
2387 ; GFX11-NEXT: s_mov_b32 m0, s20
2388 ; GFX11-NEXT: s_mov_b32 s4, s6
2389 ; GFX11-NEXT: s_mov_b32 s5, s7
2390 ; GFX11-NEXT: s_mov_b32 s6, s8
2391 ; GFX11-NEXT: s_mov_b32 s7, s9
2392 ; GFX11-NEXT: s_mov_b32 s8, s10
2393 ; GFX11-NEXT: s_mov_b32 s9, s11
2394 ; GFX11-NEXT: s_mov_b32 s10, s12
2395 ; GFX11-NEXT: s_mov_b32 s11, s13
2396 ; GFX11-NEXT: s_mov_b32 s12, s14
2397 ; GFX11-NEXT: s_mov_b32 s13, s15
2398 ; GFX11-NEXT: s_mov_b32 s14, s16
2399 ; GFX11-NEXT: s_mov_b32 s15, s17
2400 ; GFX11-NEXT: s_movreld_b64 s[2:3], s[18:19]
2401 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2402 ; GFX11-NEXT: v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
2403 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_mov_b32 v5, s5
2404 ; GFX11-NEXT: v_dual_mov_b32 v6, s6 :: v_dual_mov_b32 v7, s7
2405 ; GFX11-NEXT: v_dual_mov_b32 v8, s8 :: v_dual_mov_b32 v9, s9
2406 ; GFX11-NEXT: v_dual_mov_b32 v10, s10 :: v_dual_mov_b32 v11, s11
2407 ; GFX11-NEXT: v_dual_mov_b32 v12, s12 :: v_dual_mov_b32 v13, s13
2408 ; GFX11-NEXT: v_dual_mov_b32 v14, s14 :: v_dual_mov_b32 v15, s15
2409 ; GFX11-NEXT: global_store_b128 v[0:1], v[0:3], off dlc
2410 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2411 ; GFX11-NEXT: global_store_b128 v[0:1], v[4:7], off dlc
2412 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2413 ; GFX11-NEXT: global_store_b128 v[0:1], v[8:11], off dlc
2414 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2415 ; GFX11-NEXT: global_store_b128 v[0:1], v[12:15], off dlc
2416 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2417 ; GFX11-NEXT: s_nop 0
2418 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2419 ; GFX11-NEXT: s_endpgm
2421 %idx.add = add i32 %idx, 1
2422 %insert = insertelement <8 x double> %vec, double %val, i32 %idx.add
2423 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
2424 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
2425 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
2426 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
2427 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
2428 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
2429 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
2430 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
2434 define amdgpu_ps void @dyn_insertelement_v8f64_v_v_v_add_1(<8 x double> %vec, double %val, i32 %idx) {
2435 ; GPRIDX-LABEL: dyn_insertelement_v8f64_v_v_v_add_1:
2436 ; GPRIDX: ; %bb.0: ; %entry
2437 ; GPRIDX-NEXT: v_add_u32_e32 v18, 1, v18
2438 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v18
2439 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[0:1], 1, v18
2440 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v16, vcc
2441 ; GPRIDX-NEXT: v_cndmask_b32_e64 v2, v2, v16, s[0:1]
2442 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[2:3], 2, v18
2443 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[4:5], 3, v18
2444 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[6:7], 4, v18
2445 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[8:9], 5, v18
2446 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[10:11], 7, v18
2447 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[12:13], 6, v18
2448 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v17, vcc
2449 ; GPRIDX-NEXT: v_cndmask_b32_e64 v3, v3, v17, s[0:1]
2450 ; GPRIDX-NEXT: v_cndmask_b32_e64 v4, v4, v16, s[2:3]
2451 ; GPRIDX-NEXT: v_cndmask_b32_e64 v6, v6, v16, s[4:5]
2452 ; GPRIDX-NEXT: v_cndmask_b32_e64 v8, v8, v16, s[6:7]
2453 ; GPRIDX-NEXT: v_cndmask_b32_e64 v10, v10, v16, s[8:9]
2454 ; GPRIDX-NEXT: v_cndmask_b32_e64 v12, v12, v16, s[12:13]
2455 ; GPRIDX-NEXT: v_cndmask_b32_e64 v14, v14, v16, s[10:11]
2456 ; GPRIDX-NEXT: v_cndmask_b32_e64 v5, v5, v17, s[2:3]
2457 ; GPRIDX-NEXT: v_cndmask_b32_e64 v7, v7, v17, s[4:5]
2458 ; GPRIDX-NEXT: v_cndmask_b32_e64 v9, v9, v17, s[6:7]
2459 ; GPRIDX-NEXT: v_cndmask_b32_e64 v11, v11, v17, s[8:9]
2460 ; GPRIDX-NEXT: v_cndmask_b32_e64 v13, v13, v17, s[12:13]
2461 ; GPRIDX-NEXT: v_cndmask_b32_e64 v15, v15, v17, s[10:11]
2462 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2463 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2464 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
2465 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2466 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
2467 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2468 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
2469 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2470 ; GPRIDX-NEXT: s_endpgm
2472 ; GFX10-LABEL: dyn_insertelement_v8f64_v_v_v_add_1:
2473 ; GFX10: ; %bb.0: ; %entry
2474 ; GFX10-NEXT: v_add_nc_u32_e32 v18, 1, v18
2475 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v18
2476 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 1, v18
2477 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 2, v18
2478 ; GFX10-NEXT: v_cmp_eq_u32_e64 s2, 3, v18
2479 ; GFX10-NEXT: v_cmp_eq_u32_e64 s3, 4, v18
2480 ; GFX10-NEXT: v_cmp_eq_u32_e64 s4, 5, v18
2481 ; GFX10-NEXT: v_cmp_eq_u32_e64 s5, 7, v18
2482 ; GFX10-NEXT: v_cmp_eq_u32_e64 s6, 6, v18
2483 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v0, v16, vcc_lo
2484 ; GFX10-NEXT: v_cndmask_b32_e64 v2, v2, v16, s0
2485 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v1, v17, vcc_lo
2486 ; GFX10-NEXT: v_cndmask_b32_e64 v3, v3, v17, s0
2487 ; GFX10-NEXT: v_cndmask_b32_e64 v4, v4, v16, s1
2488 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v16, s2
2489 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, v17, s1
2490 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, v17, s2
2491 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, v16, s3
2492 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, v16, s4
2493 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v17, s3
2494 ; GFX10-NEXT: v_cndmask_b32_e64 v11, v11, v17, s4
2495 ; GFX10-NEXT: v_cndmask_b32_e64 v12, v12, v16, s6
2496 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, v16, s5
2497 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v13, v17, s6
2498 ; GFX10-NEXT: v_cndmask_b32_e64 v15, v15, v17, s5
2499 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2500 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2501 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
2502 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2503 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
2504 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2505 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
2506 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2507 ; GFX10-NEXT: s_endpgm
2509 ; GFX11-LABEL: dyn_insertelement_v8f64_v_v_v_add_1:
2510 ; GFX11: ; %bb.0: ; %entry
2511 ; GFX11-NEXT: v_add_nc_u32_e32 v18, 1, v18
2512 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v18
2513 ; GFX11-NEXT: v_cndmask_b32_e32 v1, v1, v17, vcc_lo
2514 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 1, v18
2515 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 2, v18
2516 ; GFX11-NEXT: v_cmp_eq_u32_e64 s2, 3, v18
2517 ; GFX11-NEXT: v_cmp_eq_u32_e64 s3, 4, v18
2518 ; GFX11-NEXT: v_cmp_eq_u32_e64 s4, 5, v18
2519 ; GFX11-NEXT: v_cmp_eq_u32_e64 s5, 7, v18
2520 ; GFX11-NEXT: v_cmp_eq_u32_e64 s6, 6, v18
2521 ; GFX11-NEXT: v_cndmask_b32_e32 v0, v0, v16, vcc_lo
2522 ; GFX11-NEXT: v_cndmask_b32_e64 v2, v2, v16, s0
2523 ; GFX11-NEXT: v_cndmask_b32_e64 v3, v3, v17, s0
2524 ; GFX11-NEXT: v_cndmask_b32_e64 v4, v4, v16, s1
2525 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v16, s2
2526 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, v17, s1
2527 ; GFX11-NEXT: v_cndmask_b32_e64 v7, v7, v17, s2
2528 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v8, v16, s3
2529 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, v16, s4
2530 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, v17, s3
2531 ; GFX11-NEXT: v_cndmask_b32_e64 v11, v11, v17, s4
2532 ; GFX11-NEXT: v_cndmask_b32_e64 v12, v12, v16, s6
2533 ; GFX11-NEXT: v_cndmask_b32_e64 v14, v14, v16, s5
2534 ; GFX11-NEXT: v_cndmask_b32_e64 v13, v13, v17, s6
2535 ; GFX11-NEXT: v_cndmask_b32_e64 v15, v15, v17, s5
2536 ; GFX11-NEXT: global_store_b128 v[0:1], v[0:3], off dlc
2537 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2538 ; GFX11-NEXT: global_store_b128 v[0:1], v[4:7], off dlc
2539 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2540 ; GFX11-NEXT: global_store_b128 v[0:1], v[8:11], off dlc
2541 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2542 ; GFX11-NEXT: global_store_b128 v[0:1], v[12:15], off dlc
2543 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2544 ; GFX11-NEXT: s_nop 0
2545 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2546 ; GFX11-NEXT: s_endpgm
2548 %idx.add = add i32 %idx, 1
2549 %insert = insertelement <8 x double> %vec, double %val, i32 %idx.add
2550 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
2551 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
2552 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
2553 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
2554 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
2555 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
2556 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
2557 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
2561 define amdgpu_ps <9 x float> @dyn_insertelement_v9f32_s_v_s(<9 x float> inreg %vec, float %val, i32 inreg %idx) {
2562 ; GPRIDX-LABEL: dyn_insertelement_v9f32_s_v_s:
2563 ; GPRIDX: ; %bb.0: ; %entry
2564 ; GPRIDX-NEXT: s_mov_b32 s0, s2
2565 ; GPRIDX-NEXT: s_mov_b32 s1, s3
2566 ; GPRIDX-NEXT: s_mov_b32 s2, s4
2567 ; GPRIDX-NEXT: s_mov_b32 s3, s5
2568 ; GPRIDX-NEXT: s_mov_b32 s4, s6
2569 ; GPRIDX-NEXT: s_mov_b32 s5, s7
2570 ; GPRIDX-NEXT: s_mov_b32 s6, s8
2571 ; GPRIDX-NEXT: s_mov_b32 s7, s9
2572 ; GPRIDX-NEXT: s_mov_b32 s8, s10
2573 ; GPRIDX-NEXT: v_mov_b32_e32 v9, v0
2574 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
2575 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
2576 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2577 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2578 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2579 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2580 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2581 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2582 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
2583 ; GPRIDX-NEXT: s_set_gpr_idx_on s11, gpr_idx(DST)
2584 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v9
2585 ; GPRIDX-NEXT: s_set_gpr_idx_off
2586 ; GPRIDX-NEXT: ; return to shader part epilog
2588 ; GFX10-LABEL: dyn_insertelement_v9f32_s_v_s:
2589 ; GFX10: ; %bb.0: ; %entry
2590 ; GFX10-NEXT: s_mov_b32 s0, s2
2591 ; GFX10-NEXT: s_mov_b32 s1, s3
2592 ; GFX10-NEXT: s_mov_b32 s2, s4
2593 ; GFX10-NEXT: s_mov_b32 s3, s5
2594 ; GFX10-NEXT: s_mov_b32 s4, s6
2595 ; GFX10-NEXT: s_mov_b32 s5, s7
2596 ; GFX10-NEXT: s_mov_b32 s6, s8
2597 ; GFX10-NEXT: s_mov_b32 s7, s9
2598 ; GFX10-NEXT: s_mov_b32 s8, s10
2599 ; GFX10-NEXT: v_mov_b32_e32 v9, v0
2600 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2601 ; GFX10-NEXT: s_mov_b32 m0, s11
2602 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2603 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
2604 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
2605 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
2606 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
2607 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
2608 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
2609 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
2610 ; GFX10-NEXT: v_movreld_b32_e32 v0, v9
2611 ; GFX10-NEXT: ; return to shader part epilog
2613 ; GFX11-LABEL: dyn_insertelement_v9f32_s_v_s:
2614 ; GFX11: ; %bb.0: ; %entry
2615 ; GFX11-NEXT: s_mov_b32 s0, s2
2616 ; GFX11-NEXT: s_mov_b32 s1, s3
2617 ; GFX11-NEXT: s_mov_b32 s2, s4
2618 ; GFX11-NEXT: s_mov_b32 s3, s5
2619 ; GFX11-NEXT: s_mov_b32 s4, s6
2620 ; GFX11-NEXT: s_mov_b32 s5, s7
2621 ; GFX11-NEXT: s_mov_b32 s6, s8
2622 ; GFX11-NEXT: s_mov_b32 s7, s9
2623 ; GFX11-NEXT: s_mov_b32 s8, s10
2624 ; GFX11-NEXT: v_dual_mov_b32 v9, v0 :: v_dual_mov_b32 v0, s0
2625 ; GFX11-NEXT: s_mov_b32 m0, s11
2626 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
2627 ; GFX11-NEXT: v_dual_mov_b32 v3, s3 :: v_dual_mov_b32 v4, s4
2628 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v6, s6
2629 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v8, s8
2630 ; GFX11-NEXT: v_movreld_b32_e32 v0, v9
2631 ; GFX11-NEXT: ; return to shader part epilog
2633 %insert = insertelement <9 x float> %vec, float %val, i32 %idx
2634 ret <9 x float> %insert
2637 define amdgpu_ps <9 x float> @dyn_insertelement_v9f32_s_v_v(<9 x float> inreg %vec, float %val, i32 %idx) {
2638 ; GPRIDX-LABEL: dyn_insertelement_v9f32_s_v_v:
2639 ; GPRIDX: ; %bb.0: ; %entry
2640 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2641 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
2642 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2643 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v2, v0, vcc
2644 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
2645 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2646 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v3, v0, vcc
2647 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
2648 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2649 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v4, v0, vcc
2650 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
2651 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2652 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
2653 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
2654 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2655 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v6, v0, vcc
2656 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
2657 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
2658 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v7, v0, vcc
2659 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
2660 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
2661 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v8, v0, vcc
2662 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v1
2663 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s10
2664 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v11, v0, vcc
2665 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v1
2666 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v12, v0, vcc
2667 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v10
2668 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v9
2669 ; GPRIDX-NEXT: ; return to shader part epilog
2671 ; GFX10-LABEL: dyn_insertelement_v9f32_s_v_v:
2672 ; GFX10: ; %bb.0: ; %entry
2673 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
2674 ; GFX10-NEXT: v_cndmask_b32_e32 v10, s2, v0, vcc_lo
2675 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
2676 ; GFX10-NEXT: v_cndmask_b32_e32 v9, s3, v0, vcc_lo
2677 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
2678 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
2679 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
2680 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
2681 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
2682 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
2683 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
2684 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
2685 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
2686 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
2687 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
2688 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
2689 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
2690 ; GFX10-NEXT: v_mov_b32_e32 v1, v9
2691 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
2692 ; GFX10-NEXT: v_mov_b32_e32 v0, v10
2693 ; GFX10-NEXT: ; return to shader part epilog
2695 ; GFX11-LABEL: dyn_insertelement_v9f32_s_v_v:
2696 ; GFX11: ; %bb.0: ; %entry
2697 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
2698 ; GFX11-NEXT: v_cndmask_b32_e32 v10, s2, v0, vcc_lo
2699 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
2700 ; GFX11-NEXT: v_cndmask_b32_e32 v9, s3, v0, vcc_lo
2701 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
2702 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
2703 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
2704 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
2705 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
2706 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
2707 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
2708 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
2709 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
2710 ; GFX11-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
2711 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
2712 ; GFX11-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
2713 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
2714 ; GFX11-NEXT: v_dual_mov_b32 v1, v9 :: v_dual_cndmask_b32 v8, s10, v0
2715 ; GFX11-NEXT: v_mov_b32_e32 v0, v10
2716 ; GFX11-NEXT: ; return to shader part epilog
2718 %insert = insertelement <9 x float> %vec, float %val, i32 %idx
2719 ret <9 x float> %insert
2722 define amdgpu_ps <9 x float> @dyn_insertelement_v9f32_v_v_s(<9 x float> %vec, float %val, i32 inreg %idx) {
2723 ; GPRIDX-LABEL: dyn_insertelement_v9f32_v_v_s:
2724 ; GPRIDX: ; %bb.0: ; %entry
2725 ; GPRIDX-NEXT: s_set_gpr_idx_on s2, gpr_idx(DST)
2726 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v9
2727 ; GPRIDX-NEXT: s_set_gpr_idx_off
2728 ; GPRIDX-NEXT: ; return to shader part epilog
2730 ; GFX10PLUS-LABEL: dyn_insertelement_v9f32_v_v_s:
2731 ; GFX10PLUS: ; %bb.0: ; %entry
2732 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
2733 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v9
2734 ; GFX10PLUS-NEXT: ; return to shader part epilog
2736 %insert = insertelement <9 x float> %vec, float %val, i32 %idx
2737 ret <9 x float> %insert
2740 define amdgpu_ps <9 x float> @dyn_insertelement_v9f32_v_v_v(<9 x float> %vec, float %val, i32 %idx) {
2741 ; GPRIDX-LABEL: dyn_insertelement_v9f32_v_v_v:
2742 ; GPRIDX: ; %bb.0: ; %entry
2743 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v10
2744 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v9, vcc
2745 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v10
2746 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v9, vcc
2747 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v10
2748 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v9, vcc
2749 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v10
2750 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v9, vcc
2751 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v10
2752 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v9, vcc
2753 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v10
2754 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v9, vcc
2755 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v10
2756 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v9, vcc
2757 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v10
2758 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v9, vcc
2759 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v10
2760 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v9, vcc
2761 ; GPRIDX-NEXT: ; return to shader part epilog
2763 ; GFX10PLUS-LABEL: dyn_insertelement_v9f32_v_v_v:
2764 ; GFX10PLUS: ; %bb.0: ; %entry
2765 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v10
2766 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v9, vcc_lo
2767 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v10
2768 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v9, vcc_lo
2769 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v10
2770 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v9, vcc_lo
2771 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v10
2772 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v9, vcc_lo
2773 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v10
2774 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v9, vcc_lo
2775 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v10
2776 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v9, vcc_lo
2777 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v10
2778 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v9, vcc_lo
2779 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v10
2780 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v9, vcc_lo
2781 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v10
2782 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v8, v8, v9, vcc_lo
2783 ; GFX10PLUS-NEXT: ; return to shader part epilog
2785 %insert = insertelement <9 x float> %vec, float %val, i32 %idx
2786 ret <9 x float> %insert
2789 define amdgpu_ps <10 x float> @dyn_insertelement_v10f32_s_v_s(<10 x float> inreg %vec, float %val, i32 inreg %idx) {
2790 ; GPRIDX-LABEL: dyn_insertelement_v10f32_s_v_s:
2791 ; GPRIDX: ; %bb.0: ; %entry
2792 ; GPRIDX-NEXT: s_mov_b32 s0, s2
2793 ; GPRIDX-NEXT: s_mov_b32 s1, s3
2794 ; GPRIDX-NEXT: s_mov_b32 s2, s4
2795 ; GPRIDX-NEXT: s_mov_b32 s3, s5
2796 ; GPRIDX-NEXT: s_mov_b32 s4, s6
2797 ; GPRIDX-NEXT: s_mov_b32 s5, s7
2798 ; GPRIDX-NEXT: s_mov_b32 s6, s8
2799 ; GPRIDX-NEXT: s_mov_b32 s7, s9
2800 ; GPRIDX-NEXT: s_mov_b32 s8, s10
2801 ; GPRIDX-NEXT: s_mov_b32 s9, s11
2802 ; GPRIDX-NEXT: v_mov_b32_e32 v10, v0
2803 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
2804 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
2805 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2806 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2807 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2808 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2809 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2810 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2811 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
2812 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
2813 ; GPRIDX-NEXT: s_set_gpr_idx_on s12, gpr_idx(DST)
2814 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v10
2815 ; GPRIDX-NEXT: s_set_gpr_idx_off
2816 ; GPRIDX-NEXT: ; return to shader part epilog
2818 ; GFX10-LABEL: dyn_insertelement_v10f32_s_v_s:
2819 ; GFX10: ; %bb.0: ; %entry
2820 ; GFX10-NEXT: s_mov_b32 s0, s2
2821 ; GFX10-NEXT: s_mov_b32 s1, s3
2822 ; GFX10-NEXT: s_mov_b32 s2, s4
2823 ; GFX10-NEXT: s_mov_b32 s3, s5
2824 ; GFX10-NEXT: s_mov_b32 s4, s6
2825 ; GFX10-NEXT: s_mov_b32 s5, s7
2826 ; GFX10-NEXT: s_mov_b32 s6, s8
2827 ; GFX10-NEXT: s_mov_b32 s7, s9
2828 ; GFX10-NEXT: s_mov_b32 s8, s10
2829 ; GFX10-NEXT: s_mov_b32 s9, s11
2830 ; GFX10-NEXT: v_mov_b32_e32 v10, v0
2831 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2832 ; GFX10-NEXT: s_mov_b32 m0, s12
2833 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2834 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
2835 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
2836 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
2837 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
2838 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
2839 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
2840 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
2841 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
2842 ; GFX10-NEXT: v_movreld_b32_e32 v0, v10
2843 ; GFX10-NEXT: ; return to shader part epilog
2845 ; GFX11-LABEL: dyn_insertelement_v10f32_s_v_s:
2846 ; GFX11: ; %bb.0: ; %entry
2847 ; GFX11-NEXT: s_mov_b32 s0, s2
2848 ; GFX11-NEXT: s_mov_b32 s1, s3
2849 ; GFX11-NEXT: s_mov_b32 s2, s4
2850 ; GFX11-NEXT: s_mov_b32 s3, s5
2851 ; GFX11-NEXT: s_mov_b32 s4, s6
2852 ; GFX11-NEXT: s_mov_b32 s5, s7
2853 ; GFX11-NEXT: s_mov_b32 s6, s8
2854 ; GFX11-NEXT: s_mov_b32 s7, s9
2855 ; GFX11-NEXT: s_mov_b32 s8, s10
2856 ; GFX11-NEXT: s_mov_b32 s9, s11
2857 ; GFX11-NEXT: v_mov_b32_e32 v10, v0
2858 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v3, s3
2859 ; GFX11-NEXT: s_mov_b32 m0, s12
2860 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
2861 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v4, s4
2862 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v6, s6
2863 ; GFX11-NEXT: v_dual_mov_b32 v9, s9 :: v_dual_mov_b32 v8, s8
2864 ; GFX11-NEXT: v_movreld_b32_e32 v0, v10
2865 ; GFX11-NEXT: ; return to shader part epilog
2867 %insert = insertelement <10 x float> %vec, float %val, i32 %idx
2868 ret <10 x float> %insert
2871 define amdgpu_ps <10 x float> @dyn_insertelement_v10f32_s_v_v(<10 x float> inreg %vec, float %val, i32 %idx) {
2872 ; GPRIDX-LABEL: dyn_insertelement_v10f32_s_v_v:
2873 ; GPRIDX: ; %bb.0: ; %entry
2874 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2875 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
2876 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2877 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v2, v0, vcc
2878 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
2879 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2880 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v3, v0, vcc
2881 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
2882 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2883 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v4, v0, vcc
2884 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
2885 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2886 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
2887 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
2888 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2889 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v6, v0, vcc
2890 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
2891 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
2892 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v7, v0, vcc
2893 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
2894 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
2895 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v8, v0, vcc
2896 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v1
2897 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s10
2898 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v9, v0, vcc
2899 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v1
2900 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s11
2901 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v12, v0, vcc
2902 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v1
2903 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v13, v0, vcc
2904 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v10
2905 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v11
2906 ; GPRIDX-NEXT: ; return to shader part epilog
2908 ; GFX10-LABEL: dyn_insertelement_v10f32_s_v_v:
2909 ; GFX10: ; %bb.0: ; %entry
2910 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
2911 ; GFX10-NEXT: v_cndmask_b32_e32 v10, s2, v0, vcc_lo
2912 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
2913 ; GFX10-NEXT: v_cndmask_b32_e32 v11, s3, v0, vcc_lo
2914 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
2915 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
2916 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
2917 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
2918 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
2919 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
2920 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
2921 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
2922 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
2923 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
2924 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
2925 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
2926 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
2927 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
2928 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
2929 ; GFX10-NEXT: v_mov_b32_e32 v1, v11
2930 ; GFX10-NEXT: v_cndmask_b32_e32 v9, s11, v0, vcc_lo
2931 ; GFX10-NEXT: v_mov_b32_e32 v0, v10
2932 ; GFX10-NEXT: ; return to shader part epilog
2934 ; GFX11-LABEL: dyn_insertelement_v10f32_s_v_v:
2935 ; GFX11: ; %bb.0: ; %entry
2936 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
2937 ; GFX11-NEXT: v_cndmask_b32_e32 v10, s2, v0, vcc_lo
2938 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
2939 ; GFX11-NEXT: v_cndmask_b32_e32 v11, s3, v0, vcc_lo
2940 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
2941 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
2942 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
2943 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
2944 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
2945 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
2946 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
2947 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
2948 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
2949 ; GFX11-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
2950 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
2951 ; GFX11-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
2952 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
2953 ; GFX11-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
2954 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
2955 ; GFX11-NEXT: v_mov_b32_e32 v1, v11
2956 ; GFX11-NEXT: v_dual_cndmask_b32 v9, s11, v0 :: v_dual_mov_b32 v0, v10
2957 ; GFX11-NEXT: ; return to shader part epilog
2959 %insert = insertelement <10 x float> %vec, float %val, i32 %idx
2960 ret <10 x float> %insert
2963 define amdgpu_ps <10 x float> @dyn_insertelement_v10f32_v_v_s(<10 x float> %vec, float %val, i32 inreg %idx) {
2964 ; GPRIDX-LABEL: dyn_insertelement_v10f32_v_v_s:
2965 ; GPRIDX: ; %bb.0: ; %entry
2966 ; GPRIDX-NEXT: s_set_gpr_idx_on s2, gpr_idx(DST)
2967 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v10
2968 ; GPRIDX-NEXT: s_set_gpr_idx_off
2969 ; GPRIDX-NEXT: ; return to shader part epilog
2971 ; GFX10PLUS-LABEL: dyn_insertelement_v10f32_v_v_s:
2972 ; GFX10PLUS: ; %bb.0: ; %entry
2973 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
2974 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v10
2975 ; GFX10PLUS-NEXT: ; return to shader part epilog
2977 %insert = insertelement <10 x float> %vec, float %val, i32 %idx
2978 ret <10 x float> %insert
2981 define amdgpu_ps <10 x float> @dyn_insertelement_v10f32_v_v_v(<10 x float> %vec, float %val, i32 %idx) {
2982 ; GPRIDX-LABEL: dyn_insertelement_v10f32_v_v_v:
2983 ; GPRIDX: ; %bb.0: ; %entry
2984 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v11
2985 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v10, vcc
2986 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v11
2987 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v10, vcc
2988 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v11
2989 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v10, vcc
2990 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v11
2991 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v10, vcc
2992 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v11
2993 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v10, vcc
2994 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v11
2995 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v10, vcc
2996 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v11
2997 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v10, vcc
2998 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v11
2999 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v10, vcc
3000 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v11
3001 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v10, vcc
3002 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v11
3003 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v10, vcc
3004 ; GPRIDX-NEXT: ; return to shader part epilog
3006 ; GFX10PLUS-LABEL: dyn_insertelement_v10f32_v_v_v:
3007 ; GFX10PLUS: ; %bb.0: ; %entry
3008 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v11
3009 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v10, vcc_lo
3010 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v11
3011 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v10, vcc_lo
3012 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v11
3013 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v10, vcc_lo
3014 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v11
3015 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v10, vcc_lo
3016 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v11
3017 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v10, vcc_lo
3018 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v11
3019 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v10, vcc_lo
3020 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v11
3021 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v10, vcc_lo
3022 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v11
3023 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v10, vcc_lo
3024 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v11
3025 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v8, v8, v10, vcc_lo
3026 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v11
3027 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v9, v9, v10, vcc_lo
3028 ; GFX10PLUS-NEXT: ; return to shader part epilog
3030 %insert = insertelement <10 x float> %vec, float %val, i32 %idx
3031 ret <10 x float> %insert
3034 define amdgpu_ps <11 x float> @dyn_insertelement_v11f32_s_v_s(<11 x float> inreg %vec, float %val, i32 inreg %idx) {
3035 ; GPRIDX-LABEL: dyn_insertelement_v11f32_s_v_s:
3036 ; GPRIDX: ; %bb.0: ; %entry
3037 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3038 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3039 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3040 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3041 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3042 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3043 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3044 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3045 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3046 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3047 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3048 ; GPRIDX-NEXT: v_mov_b32_e32 v11, v0
3049 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
3050 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
3051 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3052 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3053 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3054 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3055 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3056 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3057 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3058 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3059 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3060 ; GPRIDX-NEXT: s_set_gpr_idx_on s13, gpr_idx(DST)
3061 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v11
3062 ; GPRIDX-NEXT: s_set_gpr_idx_off
3063 ; GPRIDX-NEXT: ; return to shader part epilog
3065 ; GFX10-LABEL: dyn_insertelement_v11f32_s_v_s:
3066 ; GFX10: ; %bb.0: ; %entry
3067 ; GFX10-NEXT: s_mov_b32 s0, s2
3068 ; GFX10-NEXT: s_mov_b32 s1, s3
3069 ; GFX10-NEXT: s_mov_b32 s2, s4
3070 ; GFX10-NEXT: s_mov_b32 s3, s5
3071 ; GFX10-NEXT: s_mov_b32 s4, s6
3072 ; GFX10-NEXT: s_mov_b32 s5, s7
3073 ; GFX10-NEXT: s_mov_b32 s6, s8
3074 ; GFX10-NEXT: s_mov_b32 s7, s9
3075 ; GFX10-NEXT: s_mov_b32 s8, s10
3076 ; GFX10-NEXT: s_mov_b32 s9, s11
3077 ; GFX10-NEXT: s_mov_b32 s10, s12
3078 ; GFX10-NEXT: v_mov_b32_e32 v11, v0
3079 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3080 ; GFX10-NEXT: s_mov_b32 m0, s13
3081 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3082 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
3083 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
3084 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
3085 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
3086 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
3087 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
3088 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
3089 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
3090 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
3091 ; GFX10-NEXT: v_movreld_b32_e32 v0, v11
3092 ; GFX10-NEXT: ; return to shader part epilog
3094 ; GFX11-LABEL: dyn_insertelement_v11f32_s_v_s:
3095 ; GFX11: ; %bb.0: ; %entry
3096 ; GFX11-NEXT: s_mov_b32 s0, s2
3097 ; GFX11-NEXT: s_mov_b32 s1, s3
3098 ; GFX11-NEXT: s_mov_b32 s2, s4
3099 ; GFX11-NEXT: s_mov_b32 s3, s5
3100 ; GFX11-NEXT: s_mov_b32 s4, s6
3101 ; GFX11-NEXT: s_mov_b32 s5, s7
3102 ; GFX11-NEXT: s_mov_b32 s6, s8
3103 ; GFX11-NEXT: s_mov_b32 s7, s9
3104 ; GFX11-NEXT: s_mov_b32 s8, s10
3105 ; GFX11-NEXT: s_mov_b32 s9, s11
3106 ; GFX11-NEXT: s_mov_b32 s10, s12
3107 ; GFX11-NEXT: v_dual_mov_b32 v11, v0 :: v_dual_mov_b32 v0, s0
3108 ; GFX11-NEXT: s_mov_b32 m0, s13
3109 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
3110 ; GFX11-NEXT: v_dual_mov_b32 v3, s3 :: v_dual_mov_b32 v4, s4
3111 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v6, s6
3112 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v8, s8
3113 ; GFX11-NEXT: v_dual_mov_b32 v9, s9 :: v_dual_mov_b32 v10, s10
3114 ; GFX11-NEXT: v_movreld_b32_e32 v0, v11
3115 ; GFX11-NEXT: ; return to shader part epilog
3117 %insert = insertelement <11 x float> %vec, float %val, i32 %idx
3118 ret <11 x float> %insert
3121 define amdgpu_ps <11 x float> @dyn_insertelement_v11f32_s_v_v(<11 x float> inreg %vec, float %val, i32 %idx) {
3122 ; GPRIDX-LABEL: dyn_insertelement_v11f32_s_v_v:
3123 ; GPRIDX: ; %bb.0: ; %entry
3124 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3125 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
3126 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3127 ; GPRIDX-NEXT: v_cndmask_b32_e32 v12, v2, v0, vcc
3128 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
3129 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3130 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v3, v0, vcc
3131 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
3132 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3133 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v4, v0, vcc
3134 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
3135 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3136 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
3137 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
3138 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3139 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v6, v0, vcc
3140 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
3141 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3142 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v7, v0, vcc
3143 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
3144 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3145 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v8, v0, vcc
3146 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v1
3147 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3148 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v9, v0, vcc
3149 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v1
3150 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s11
3151 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v10, v0, vcc
3152 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v1
3153 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s12
3154 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v13, v0, vcc
3155 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 10, v1
3156 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v14, v0, vcc
3157 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v12
3158 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v11
3159 ; GPRIDX-NEXT: ; return to shader part epilog
3161 ; GFX10-LABEL: dyn_insertelement_v11f32_s_v_v:
3162 ; GFX10: ; %bb.0: ; %entry
3163 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
3164 ; GFX10-NEXT: v_cndmask_b32_e32 v12, s2, v0, vcc_lo
3165 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
3166 ; GFX10-NEXT: v_cndmask_b32_e32 v11, s3, v0, vcc_lo
3167 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
3168 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
3169 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
3170 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
3171 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
3172 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
3173 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
3174 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
3175 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
3176 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
3177 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
3178 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
3179 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
3180 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
3181 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
3182 ; GFX10-NEXT: v_cndmask_b32_e32 v9, s11, v0, vcc_lo
3183 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v1
3184 ; GFX10-NEXT: v_mov_b32_e32 v1, v11
3185 ; GFX10-NEXT: v_cndmask_b32_e32 v10, s12, v0, vcc_lo
3186 ; GFX10-NEXT: v_mov_b32_e32 v0, v12
3187 ; GFX10-NEXT: ; return to shader part epilog
3189 ; GFX11-LABEL: dyn_insertelement_v11f32_s_v_v:
3190 ; GFX11: ; %bb.0: ; %entry
3191 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
3192 ; GFX11-NEXT: v_cndmask_b32_e32 v12, s2, v0, vcc_lo
3193 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
3194 ; GFX11-NEXT: v_cndmask_b32_e32 v11, s3, v0, vcc_lo
3195 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
3196 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
3197 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
3198 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
3199 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
3200 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
3201 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
3202 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
3203 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
3204 ; GFX11-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
3205 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
3206 ; GFX11-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
3207 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
3208 ; GFX11-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
3209 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
3210 ; GFX11-NEXT: v_cndmask_b32_e32 v9, s11, v0, vcc_lo
3211 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v1
3212 ; GFX11-NEXT: v_dual_mov_b32 v1, v11 :: v_dual_cndmask_b32 v10, s12, v0
3213 ; GFX11-NEXT: v_mov_b32_e32 v0, v12
3214 ; GFX11-NEXT: ; return to shader part epilog
3216 %insert = insertelement <11 x float> %vec, float %val, i32 %idx
3217 ret <11 x float> %insert
3220 define amdgpu_ps <11 x float> @dyn_insertelement_v11f32_v_v_s(<11 x float> %vec, float %val, i32 inreg %idx) {
3221 ; GPRIDX-LABEL: dyn_insertelement_v11f32_v_v_s:
3222 ; GPRIDX: ; %bb.0: ; %entry
3223 ; GPRIDX-NEXT: s_set_gpr_idx_on s2, gpr_idx(DST)
3224 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v11
3225 ; GPRIDX-NEXT: s_set_gpr_idx_off
3226 ; GPRIDX-NEXT: ; return to shader part epilog
3228 ; GFX10PLUS-LABEL: dyn_insertelement_v11f32_v_v_s:
3229 ; GFX10PLUS: ; %bb.0: ; %entry
3230 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
3231 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v11
3232 ; GFX10PLUS-NEXT: ; return to shader part epilog
3234 %insert = insertelement <11 x float> %vec, float %val, i32 %idx
3235 ret <11 x float> %insert
3238 define amdgpu_ps <11 x float> @dyn_insertelement_v11f32_v_v_v(<11 x float> %vec, float %val, i32 %idx) {
3239 ; GPRIDX-LABEL: dyn_insertelement_v11f32_v_v_v:
3240 ; GPRIDX: ; %bb.0: ; %entry
3241 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v12
3242 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v11, vcc
3243 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v12
3244 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v11, vcc
3245 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v12
3246 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v11, vcc
3247 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v12
3248 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v11, vcc
3249 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v12
3250 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v11, vcc
3251 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v12
3252 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v11, vcc
3253 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v12
3254 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v11, vcc
3255 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v12
3256 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v11, vcc
3257 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v12
3258 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v11, vcc
3259 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v12
3260 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v11, vcc
3261 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 10, v12
3262 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v10, v11, vcc
3263 ; GPRIDX-NEXT: ; return to shader part epilog
3265 ; GFX10PLUS-LABEL: dyn_insertelement_v11f32_v_v_v:
3266 ; GFX10PLUS: ; %bb.0: ; %entry
3267 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v12
3268 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v11, vcc_lo
3269 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v12
3270 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v11, vcc_lo
3271 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v12
3272 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v11, vcc_lo
3273 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v12
3274 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v11, vcc_lo
3275 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v12
3276 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v11, vcc_lo
3277 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v12
3278 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v11, vcc_lo
3279 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v12
3280 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v11, vcc_lo
3281 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v12
3282 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v11, vcc_lo
3283 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v12
3284 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v8, v8, v11, vcc_lo
3285 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v12
3286 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v9, v9, v11, vcc_lo
3287 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v12
3288 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v10, v10, v11, vcc_lo
3289 ; GFX10PLUS-NEXT: ; return to shader part epilog
3291 %insert = insertelement <11 x float> %vec, float %val, i32 %idx
3292 ret <11 x float> %insert
3295 define amdgpu_ps <12 x float> @dyn_insertelement_v12f32_s_v_s(<12 x float> inreg %vec, float %val, i32 inreg %idx) {
3296 ; GPRIDX-LABEL: dyn_insertelement_v12f32_s_v_s:
3297 ; GPRIDX: ; %bb.0: ; %entry
3298 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3299 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3300 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3301 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3302 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3303 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3304 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3305 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3306 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3307 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3308 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3309 ; GPRIDX-NEXT: s_mov_b32 s11, s13
3310 ; GPRIDX-NEXT: v_mov_b32_e32 v12, v0
3311 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
3312 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
3313 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3314 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3315 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3316 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3317 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3318 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3319 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3320 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3321 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3322 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
3323 ; GPRIDX-NEXT: s_set_gpr_idx_on s14, gpr_idx(DST)
3324 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v12
3325 ; GPRIDX-NEXT: s_set_gpr_idx_off
3326 ; GPRIDX-NEXT: ; return to shader part epilog
3328 ; GFX10-LABEL: dyn_insertelement_v12f32_s_v_s:
3329 ; GFX10: ; %bb.0: ; %entry
3330 ; GFX10-NEXT: s_mov_b32 s0, s2
3331 ; GFX10-NEXT: s_mov_b32 s1, s3
3332 ; GFX10-NEXT: s_mov_b32 s2, s4
3333 ; GFX10-NEXT: s_mov_b32 s3, s5
3334 ; GFX10-NEXT: s_mov_b32 s4, s6
3335 ; GFX10-NEXT: s_mov_b32 s5, s7
3336 ; GFX10-NEXT: s_mov_b32 s6, s8
3337 ; GFX10-NEXT: s_mov_b32 s7, s9
3338 ; GFX10-NEXT: s_mov_b32 s8, s10
3339 ; GFX10-NEXT: s_mov_b32 s9, s11
3340 ; GFX10-NEXT: s_mov_b32 s10, s12
3341 ; GFX10-NEXT: s_mov_b32 s11, s13
3342 ; GFX10-NEXT: v_mov_b32_e32 v12, v0
3343 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3344 ; GFX10-NEXT: s_mov_b32 m0, s14
3345 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3346 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
3347 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
3348 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
3349 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
3350 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
3351 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
3352 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
3353 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
3354 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
3355 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
3356 ; GFX10-NEXT: v_movreld_b32_e32 v0, v12
3357 ; GFX10-NEXT: ; return to shader part epilog
3359 ; GFX11-LABEL: dyn_insertelement_v12f32_s_v_s:
3360 ; GFX11: ; %bb.0: ; %entry
3361 ; GFX11-NEXT: s_mov_b32 s0, s2
3362 ; GFX11-NEXT: s_mov_b32 s1, s3
3363 ; GFX11-NEXT: s_mov_b32 s2, s4
3364 ; GFX11-NEXT: s_mov_b32 s3, s5
3365 ; GFX11-NEXT: s_mov_b32 s4, s6
3366 ; GFX11-NEXT: s_mov_b32 s5, s7
3367 ; GFX11-NEXT: s_mov_b32 s6, s8
3368 ; GFX11-NEXT: s_mov_b32 s7, s9
3369 ; GFX11-NEXT: s_mov_b32 s8, s10
3370 ; GFX11-NEXT: s_mov_b32 s9, s11
3371 ; GFX11-NEXT: s_mov_b32 s10, s12
3372 ; GFX11-NEXT: s_mov_b32 s11, s13
3373 ; GFX11-NEXT: v_mov_b32_e32 v12, v0
3374 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v3, s3
3375 ; GFX11-NEXT: s_mov_b32 m0, s14
3376 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
3377 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v4, s4
3378 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v6, s6
3379 ; GFX11-NEXT: v_dual_mov_b32 v9, s9 :: v_dual_mov_b32 v8, s8
3380 ; GFX11-NEXT: v_dual_mov_b32 v11, s11 :: v_dual_mov_b32 v10, s10
3381 ; GFX11-NEXT: v_movreld_b32_e32 v0, v12
3382 ; GFX11-NEXT: ; return to shader part epilog
3384 %insert = insertelement <12 x float> %vec, float %val, i32 %idx
3385 ret <12 x float> %insert
3388 define amdgpu_ps <12 x float> @dyn_insertelement_v12f32_s_v_v(<12 x float> inreg %vec, float %val, i32 %idx) {
3389 ; GPRIDX-LABEL: dyn_insertelement_v12f32_s_v_v:
3390 ; GPRIDX: ; %bb.0: ; %entry
3391 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3392 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
3393 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3394 ; GPRIDX-NEXT: v_cndmask_b32_e32 v12, v2, v0, vcc
3395 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
3396 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3397 ; GPRIDX-NEXT: v_cndmask_b32_e32 v13, v3, v0, vcc
3398 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
3399 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3400 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v4, v0, vcc
3401 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
3402 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3403 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
3404 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
3405 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3406 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v6, v0, vcc
3407 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
3408 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3409 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v7, v0, vcc
3410 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
3411 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3412 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v8, v0, vcc
3413 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v1
3414 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3415 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v9, v0, vcc
3416 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v1
3417 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
3418 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v10, v0, vcc
3419 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v1
3420 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s12
3421 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v11, v0, vcc
3422 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 10, v1
3423 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s13
3424 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v14, v0, vcc
3425 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 11, v1
3426 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v15, v0, vcc
3427 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v12
3428 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v13
3429 ; GPRIDX-NEXT: ; return to shader part epilog
3431 ; GFX10-LABEL: dyn_insertelement_v12f32_s_v_v:
3432 ; GFX10: ; %bb.0: ; %entry
3433 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
3434 ; GFX10-NEXT: v_cndmask_b32_e32 v12, s2, v0, vcc_lo
3435 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
3436 ; GFX10-NEXT: v_cndmask_b32_e32 v13, s3, v0, vcc_lo
3437 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
3438 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
3439 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
3440 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
3441 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
3442 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
3443 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
3444 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
3445 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
3446 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
3447 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
3448 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
3449 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
3450 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
3451 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
3452 ; GFX10-NEXT: v_cndmask_b32_e32 v9, s11, v0, vcc_lo
3453 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v1
3454 ; GFX10-NEXT: v_cndmask_b32_e32 v10, s12, v0, vcc_lo
3455 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 11, v1
3456 ; GFX10-NEXT: v_mov_b32_e32 v1, v13
3457 ; GFX10-NEXT: v_cndmask_b32_e32 v11, s13, v0, vcc_lo
3458 ; GFX10-NEXT: v_mov_b32_e32 v0, v12
3459 ; GFX10-NEXT: ; return to shader part epilog
3461 ; GFX11-LABEL: dyn_insertelement_v12f32_s_v_v:
3462 ; GFX11: ; %bb.0: ; %entry
3463 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
3464 ; GFX11-NEXT: v_cndmask_b32_e32 v12, s2, v0, vcc_lo
3465 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
3466 ; GFX11-NEXT: v_cndmask_b32_e32 v13, s3, v0, vcc_lo
3467 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
3468 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
3469 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
3470 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
3471 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
3472 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
3473 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
3474 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
3475 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
3476 ; GFX11-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
3477 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
3478 ; GFX11-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
3479 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
3480 ; GFX11-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
3481 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
3482 ; GFX11-NEXT: v_cndmask_b32_e32 v9, s11, v0, vcc_lo
3483 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v1
3484 ; GFX11-NEXT: v_cndmask_b32_e32 v10, s12, v0, vcc_lo
3485 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 11, v1
3486 ; GFX11-NEXT: v_mov_b32_e32 v1, v13
3487 ; GFX11-NEXT: v_dual_cndmask_b32 v11, s13, v0 :: v_dual_mov_b32 v0, v12
3488 ; GFX11-NEXT: ; return to shader part epilog
3490 %insert = insertelement <12 x float> %vec, float %val, i32 %idx
3491 ret <12 x float> %insert
3494 define amdgpu_ps <12 x float> @dyn_insertelement_v12f32_v_v_s(<12 x float> %vec, float %val, i32 inreg %idx) {
3495 ; GPRIDX-LABEL: dyn_insertelement_v12f32_v_v_s:
3496 ; GPRIDX: ; %bb.0: ; %entry
3497 ; GPRIDX-NEXT: s_set_gpr_idx_on s2, gpr_idx(DST)
3498 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v12
3499 ; GPRIDX-NEXT: s_set_gpr_idx_off
3500 ; GPRIDX-NEXT: ; return to shader part epilog
3502 ; GFX10PLUS-LABEL: dyn_insertelement_v12f32_v_v_s:
3503 ; GFX10PLUS: ; %bb.0: ; %entry
3504 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
3505 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v12
3506 ; GFX10PLUS-NEXT: ; return to shader part epilog
3508 %insert = insertelement <12 x float> %vec, float %val, i32 %idx
3509 ret <12 x float> %insert
3512 define amdgpu_ps <12 x float> @dyn_insertelement_v12f32_v_v_v(<12 x float> %vec, float %val, i32 %idx) {
3513 ; GPRIDX-LABEL: dyn_insertelement_v12f32_v_v_v:
3514 ; GPRIDX: ; %bb.0: ; %entry
3515 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v13
3516 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v12, vcc
3517 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v13
3518 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v12, vcc
3519 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v13
3520 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v12, vcc
3521 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v13
3522 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v12, vcc
3523 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v13
3524 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v12, vcc
3525 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v13
3526 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v12, vcc
3527 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v13
3528 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v12, vcc
3529 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v13
3530 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v12, vcc
3531 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v13
3532 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v12, vcc
3533 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v13
3534 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v12, vcc
3535 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 10, v13
3536 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v10, v12, vcc
3537 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 11, v13
3538 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v11, v12, vcc
3539 ; GPRIDX-NEXT: ; return to shader part epilog
3541 ; GFX10PLUS-LABEL: dyn_insertelement_v12f32_v_v_v:
3542 ; GFX10PLUS: ; %bb.0: ; %entry
3543 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v13
3544 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v12, vcc_lo
3545 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v13
3546 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v12, vcc_lo
3547 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v13
3548 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v12, vcc_lo
3549 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v13
3550 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v12, vcc_lo
3551 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v13
3552 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v12, vcc_lo
3553 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v13
3554 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v12, vcc_lo
3555 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v13
3556 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v12, vcc_lo
3557 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v13
3558 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v12, vcc_lo
3559 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v13
3560 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v8, v8, v12, vcc_lo
3561 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v13
3562 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v9, v9, v12, vcc_lo
3563 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v13
3564 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v10, v10, v12, vcc_lo
3565 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 11, v13
3566 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v11, v11, v12, vcc_lo
3567 ; GFX10PLUS-NEXT: ; return to shader part epilog
3569 %insert = insertelement <12 x float> %vec, float %val, i32 %idx
3570 ret <12 x float> %insert
3573 define amdgpu_ps <16 x i32> @dyn_insertelement_v16i32_s_s_s(<16 x i32> inreg %vec, i32 inreg %val, i32 inreg %idx) {
3574 ; GPRIDX-LABEL: dyn_insertelement_v16i32_s_s_s:
3575 ; GPRIDX: ; %bb.0: ; %entry
3576 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3577 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3578 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3579 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3580 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3581 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3582 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3583 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3584 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3585 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3586 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3587 ; GPRIDX-NEXT: s_mov_b32 s11, s13
3588 ; GPRIDX-NEXT: s_mov_b32 s12, s14
3589 ; GPRIDX-NEXT: s_mov_b32 s13, s15
3590 ; GPRIDX-NEXT: s_mov_b32 s14, s16
3591 ; GPRIDX-NEXT: s_mov_b32 s15, s17
3592 ; GPRIDX-NEXT: s_mov_b32 m0, s19
3593 ; GPRIDX-NEXT: s_nop 0
3594 ; GPRIDX-NEXT: s_movreld_b32 s0, s18
3595 ; GPRIDX-NEXT: ; return to shader part epilog
3597 ; GFX10PLUS-LABEL: dyn_insertelement_v16i32_s_s_s:
3598 ; GFX10PLUS: ; %bb.0: ; %entry
3599 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
3600 ; GFX10PLUS-NEXT: s_mov_b32 m0, s19
3601 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
3602 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
3603 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
3604 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
3605 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
3606 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
3607 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
3608 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
3609 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
3610 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
3611 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
3612 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
3613 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
3614 ; GFX10PLUS-NEXT: s_mov_b32 s14, s16
3615 ; GFX10PLUS-NEXT: s_mov_b32 s15, s17
3616 ; GFX10PLUS-NEXT: s_movreld_b32 s0, s18
3617 ; GFX10PLUS-NEXT: ; return to shader part epilog
3619 %insert = insertelement <16 x i32> %vec, i32 %val, i32 %idx
3620 ret <16 x i32> %insert
3623 define amdgpu_ps <16 x float> @dyn_insertelement_v16f32_s_s_s(<16 x float> inreg %vec, float inreg %val, i32 inreg %idx) {
3624 ; GPRIDX-LABEL: dyn_insertelement_v16f32_s_s_s:
3625 ; GPRIDX: ; %bb.0: ; %entry
3626 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3627 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3628 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3629 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3630 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3631 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3632 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3633 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3634 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3635 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3636 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3637 ; GPRIDX-NEXT: s_mov_b32 s11, s13
3638 ; GPRIDX-NEXT: s_mov_b32 s12, s14
3639 ; GPRIDX-NEXT: s_mov_b32 s13, s15
3640 ; GPRIDX-NEXT: s_mov_b32 s14, s16
3641 ; GPRIDX-NEXT: s_mov_b32 s15, s17
3642 ; GPRIDX-NEXT: s_mov_b32 m0, s19
3643 ; GPRIDX-NEXT: s_nop 0
3644 ; GPRIDX-NEXT: s_movreld_b32 s0, s18
3645 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
3646 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
3647 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3648 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3649 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3650 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3651 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3652 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3653 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3654 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3655 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3656 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
3657 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s12
3658 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s13
3659 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s14
3660 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s15
3661 ; GPRIDX-NEXT: ; return to shader part epilog
3663 ; GFX10-LABEL: dyn_insertelement_v16f32_s_s_s:
3664 ; GFX10: ; %bb.0: ; %entry
3665 ; GFX10-NEXT: s_mov_b32 s0, s2
3666 ; GFX10-NEXT: s_mov_b32 m0, s19
3667 ; GFX10-NEXT: s_mov_b32 s1, s3
3668 ; GFX10-NEXT: s_mov_b32 s2, s4
3669 ; GFX10-NEXT: s_mov_b32 s3, s5
3670 ; GFX10-NEXT: s_mov_b32 s4, s6
3671 ; GFX10-NEXT: s_mov_b32 s5, s7
3672 ; GFX10-NEXT: s_mov_b32 s6, s8
3673 ; GFX10-NEXT: s_mov_b32 s7, s9
3674 ; GFX10-NEXT: s_mov_b32 s8, s10
3675 ; GFX10-NEXT: s_mov_b32 s9, s11
3676 ; GFX10-NEXT: s_mov_b32 s10, s12
3677 ; GFX10-NEXT: s_mov_b32 s11, s13
3678 ; GFX10-NEXT: s_mov_b32 s12, s14
3679 ; GFX10-NEXT: s_mov_b32 s13, s15
3680 ; GFX10-NEXT: s_mov_b32 s14, s16
3681 ; GFX10-NEXT: s_mov_b32 s15, s17
3682 ; GFX10-NEXT: s_movreld_b32 s0, s18
3683 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3684 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3685 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
3686 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
3687 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
3688 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
3689 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
3690 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
3691 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
3692 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
3693 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
3694 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
3695 ; GFX10-NEXT: v_mov_b32_e32 v12, s12
3696 ; GFX10-NEXT: v_mov_b32_e32 v13, s13
3697 ; GFX10-NEXT: v_mov_b32_e32 v14, s14
3698 ; GFX10-NEXT: v_mov_b32_e32 v15, s15
3699 ; GFX10-NEXT: ; return to shader part epilog
3701 ; GFX11-LABEL: dyn_insertelement_v16f32_s_s_s:
3702 ; GFX11: ; %bb.0: ; %entry
3703 ; GFX11-NEXT: s_mov_b32 s0, s2
3704 ; GFX11-NEXT: s_mov_b32 m0, s19
3705 ; GFX11-NEXT: s_mov_b32 s1, s3
3706 ; GFX11-NEXT: s_mov_b32 s2, s4
3707 ; GFX11-NEXT: s_mov_b32 s3, s5
3708 ; GFX11-NEXT: s_mov_b32 s4, s6
3709 ; GFX11-NEXT: s_mov_b32 s5, s7
3710 ; GFX11-NEXT: s_mov_b32 s6, s8
3711 ; GFX11-NEXT: s_mov_b32 s7, s9
3712 ; GFX11-NEXT: s_mov_b32 s8, s10
3713 ; GFX11-NEXT: s_mov_b32 s9, s11
3714 ; GFX11-NEXT: s_mov_b32 s10, s12
3715 ; GFX11-NEXT: s_mov_b32 s11, s13
3716 ; GFX11-NEXT: s_mov_b32 s12, s14
3717 ; GFX11-NEXT: s_mov_b32 s13, s15
3718 ; GFX11-NEXT: s_mov_b32 s14, s16
3719 ; GFX11-NEXT: s_mov_b32 s15, s17
3720 ; GFX11-NEXT: s_movreld_b32 s0, s18
3721 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3722 ; GFX11-NEXT: v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
3723 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_mov_b32 v5, s5
3724 ; GFX11-NEXT: v_dual_mov_b32 v6, s6 :: v_dual_mov_b32 v7, s7
3725 ; GFX11-NEXT: v_dual_mov_b32 v8, s8 :: v_dual_mov_b32 v9, s9
3726 ; GFX11-NEXT: v_dual_mov_b32 v10, s10 :: v_dual_mov_b32 v11, s11
3727 ; GFX11-NEXT: v_dual_mov_b32 v12, s12 :: v_dual_mov_b32 v13, s13
3728 ; GFX11-NEXT: v_dual_mov_b32 v14, s14 :: v_dual_mov_b32 v15, s15
3729 ; GFX11-NEXT: ; return to shader part epilog
3731 %insert = insertelement <16 x float> %vec, float %val, i32 %idx
3732 ret <16 x float> %insert
3735 define amdgpu_ps <32 x float> @dyn_insertelement_v32f32_s_s_s(<32 x float> inreg %vec, float inreg %val, i32 inreg %idx) {
3736 ; GPRIDX-LABEL: dyn_insertelement_v32f32_s_s_s:
3737 ; GPRIDX: ; %bb.0: ; %entry
3738 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3739 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3740 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3741 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3742 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3743 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3744 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3745 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3746 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3747 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3748 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3749 ; GPRIDX-NEXT: s_mov_b32 s11, s13
3750 ; GPRIDX-NEXT: s_mov_b32 s12, s14
3751 ; GPRIDX-NEXT: s_mov_b32 s13, s15
3752 ; GPRIDX-NEXT: s_mov_b32 s14, s16
3753 ; GPRIDX-NEXT: s_mov_b32 s15, s17
3754 ; GPRIDX-NEXT: s_mov_b32 s16, s18
3755 ; GPRIDX-NEXT: s_mov_b32 s17, s19
3756 ; GPRIDX-NEXT: s_mov_b32 s18, s20
3757 ; GPRIDX-NEXT: s_mov_b32 s19, s21
3758 ; GPRIDX-NEXT: s_mov_b32 s20, s22
3759 ; GPRIDX-NEXT: s_mov_b32 s21, s23
3760 ; GPRIDX-NEXT: s_mov_b32 s22, s24
3761 ; GPRIDX-NEXT: s_mov_b32 s23, s25
3762 ; GPRIDX-NEXT: s_mov_b32 s24, s26
3763 ; GPRIDX-NEXT: s_mov_b32 s25, s27
3764 ; GPRIDX-NEXT: s_mov_b32 s26, s28
3765 ; GPRIDX-NEXT: s_mov_b32 s27, s29
3766 ; GPRIDX-NEXT: s_mov_b32 s28, s30
3767 ; GPRIDX-NEXT: s_mov_b32 s29, s31
3768 ; GPRIDX-NEXT: s_mov_b32 s31, s33
3769 ; GPRIDX-NEXT: s_mov_b32 s30, s32
3770 ; GPRIDX-NEXT: s_mov_b32 m0, s35
3771 ; GPRIDX-NEXT: s_nop 0
3772 ; GPRIDX-NEXT: s_movreld_b32 s0, s34
3773 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
3774 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
3775 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3776 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3777 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3778 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3779 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3780 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3781 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3782 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3783 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3784 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
3785 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s12
3786 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s13
3787 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s14
3788 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s15
3789 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s16
3790 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s17
3791 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s18
3792 ; GPRIDX-NEXT: v_mov_b32_e32 v19, s19
3793 ; GPRIDX-NEXT: v_mov_b32_e32 v20, s20
3794 ; GPRIDX-NEXT: v_mov_b32_e32 v21, s21
3795 ; GPRIDX-NEXT: v_mov_b32_e32 v22, s22
3796 ; GPRIDX-NEXT: v_mov_b32_e32 v23, s23
3797 ; GPRIDX-NEXT: v_mov_b32_e32 v24, s24
3798 ; GPRIDX-NEXT: v_mov_b32_e32 v25, s25
3799 ; GPRIDX-NEXT: v_mov_b32_e32 v26, s26
3800 ; GPRIDX-NEXT: v_mov_b32_e32 v27, s27
3801 ; GPRIDX-NEXT: v_mov_b32_e32 v28, s28
3802 ; GPRIDX-NEXT: v_mov_b32_e32 v29, s29
3803 ; GPRIDX-NEXT: v_mov_b32_e32 v30, s30
3804 ; GPRIDX-NEXT: v_mov_b32_e32 v31, s31
3805 ; GPRIDX-NEXT: ; return to shader part epilog
3807 ; GFX10-LABEL: dyn_insertelement_v32f32_s_s_s:
3808 ; GFX10: ; %bb.0: ; %entry
3809 ; GFX10-NEXT: s_mov_b32 s0, s2
3810 ; GFX10-NEXT: s_mov_b32 m0, s35
3811 ; GFX10-NEXT: s_mov_b32 s1, s3
3812 ; GFX10-NEXT: s_mov_b32 s2, s4
3813 ; GFX10-NEXT: s_mov_b32 s3, s5
3814 ; GFX10-NEXT: s_mov_b32 s4, s6
3815 ; GFX10-NEXT: s_mov_b32 s5, s7
3816 ; GFX10-NEXT: s_mov_b32 s6, s8
3817 ; GFX10-NEXT: s_mov_b32 s7, s9
3818 ; GFX10-NEXT: s_mov_b32 s8, s10
3819 ; GFX10-NEXT: s_mov_b32 s9, s11
3820 ; GFX10-NEXT: s_mov_b32 s10, s12
3821 ; GFX10-NEXT: s_mov_b32 s11, s13
3822 ; GFX10-NEXT: s_mov_b32 s12, s14
3823 ; GFX10-NEXT: s_mov_b32 s13, s15
3824 ; GFX10-NEXT: s_mov_b32 s14, s16
3825 ; GFX10-NEXT: s_mov_b32 s15, s17
3826 ; GFX10-NEXT: s_mov_b32 s16, s18
3827 ; GFX10-NEXT: s_mov_b32 s17, s19
3828 ; GFX10-NEXT: s_mov_b32 s18, s20
3829 ; GFX10-NEXT: s_mov_b32 s19, s21
3830 ; GFX10-NEXT: s_mov_b32 s20, s22
3831 ; GFX10-NEXT: s_mov_b32 s21, s23
3832 ; GFX10-NEXT: s_mov_b32 s22, s24
3833 ; GFX10-NEXT: s_mov_b32 s23, s25
3834 ; GFX10-NEXT: s_mov_b32 s24, s26
3835 ; GFX10-NEXT: s_mov_b32 s25, s27
3836 ; GFX10-NEXT: s_mov_b32 s26, s28
3837 ; GFX10-NEXT: s_mov_b32 s27, s29
3838 ; GFX10-NEXT: s_mov_b32 s28, s30
3839 ; GFX10-NEXT: s_mov_b32 s29, s31
3840 ; GFX10-NEXT: s_mov_b32 s31, s33
3841 ; GFX10-NEXT: s_mov_b32 s30, s32
3842 ; GFX10-NEXT: s_movreld_b32 s0, s34
3843 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3844 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3845 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
3846 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
3847 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
3848 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
3849 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
3850 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
3851 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
3852 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
3853 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
3854 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
3855 ; GFX10-NEXT: v_mov_b32_e32 v12, s12
3856 ; GFX10-NEXT: v_mov_b32_e32 v13, s13
3857 ; GFX10-NEXT: v_mov_b32_e32 v14, s14
3858 ; GFX10-NEXT: v_mov_b32_e32 v15, s15
3859 ; GFX10-NEXT: v_mov_b32_e32 v16, s16
3860 ; GFX10-NEXT: v_mov_b32_e32 v17, s17
3861 ; GFX10-NEXT: v_mov_b32_e32 v18, s18
3862 ; GFX10-NEXT: v_mov_b32_e32 v19, s19
3863 ; GFX10-NEXT: v_mov_b32_e32 v20, s20
3864 ; GFX10-NEXT: v_mov_b32_e32 v21, s21
3865 ; GFX10-NEXT: v_mov_b32_e32 v22, s22
3866 ; GFX10-NEXT: v_mov_b32_e32 v23, s23
3867 ; GFX10-NEXT: v_mov_b32_e32 v24, s24
3868 ; GFX10-NEXT: v_mov_b32_e32 v25, s25
3869 ; GFX10-NEXT: v_mov_b32_e32 v26, s26
3870 ; GFX10-NEXT: v_mov_b32_e32 v27, s27
3871 ; GFX10-NEXT: v_mov_b32_e32 v28, s28
3872 ; GFX10-NEXT: v_mov_b32_e32 v29, s29
3873 ; GFX10-NEXT: v_mov_b32_e32 v30, s30
3874 ; GFX10-NEXT: v_mov_b32_e32 v31, s31
3875 ; GFX10-NEXT: ; return to shader part epilog
3877 ; GFX11-LABEL: dyn_insertelement_v32f32_s_s_s:
3878 ; GFX11: ; %bb.0: ; %entry
3879 ; GFX11-NEXT: s_mov_b32 s0, s2
3880 ; GFX11-NEXT: s_mov_b32 m0, s35
3881 ; GFX11-NEXT: s_mov_b32 s1, s3
3882 ; GFX11-NEXT: s_mov_b32 s2, s4
3883 ; GFX11-NEXT: s_mov_b32 s3, s5
3884 ; GFX11-NEXT: s_mov_b32 s4, s6
3885 ; GFX11-NEXT: s_mov_b32 s5, s7
3886 ; GFX11-NEXT: s_mov_b32 s6, s8
3887 ; GFX11-NEXT: s_mov_b32 s7, s9
3888 ; GFX11-NEXT: s_mov_b32 s8, s10
3889 ; GFX11-NEXT: s_mov_b32 s9, s11
3890 ; GFX11-NEXT: s_mov_b32 s10, s12
3891 ; GFX11-NEXT: s_mov_b32 s11, s13
3892 ; GFX11-NEXT: s_mov_b32 s12, s14
3893 ; GFX11-NEXT: s_mov_b32 s13, s15
3894 ; GFX11-NEXT: s_mov_b32 s14, s16
3895 ; GFX11-NEXT: s_mov_b32 s15, s17
3896 ; GFX11-NEXT: s_mov_b32 s16, s18
3897 ; GFX11-NEXT: s_mov_b32 s17, s19
3898 ; GFX11-NEXT: s_mov_b32 s18, s20
3899 ; GFX11-NEXT: s_mov_b32 s19, s21
3900 ; GFX11-NEXT: s_mov_b32 s20, s22
3901 ; GFX11-NEXT: s_mov_b32 s21, s23
3902 ; GFX11-NEXT: s_mov_b32 s22, s24
3903 ; GFX11-NEXT: s_mov_b32 s23, s25
3904 ; GFX11-NEXT: s_mov_b32 s24, s26
3905 ; GFX11-NEXT: s_mov_b32 s25, s27
3906 ; GFX11-NEXT: s_mov_b32 s26, s28
3907 ; GFX11-NEXT: s_mov_b32 s27, s29
3908 ; GFX11-NEXT: s_mov_b32 s28, s30
3909 ; GFX11-NEXT: s_mov_b32 s29, s31
3910 ; GFX11-NEXT: s_mov_b32 s31, s33
3911 ; GFX11-NEXT: s_mov_b32 s30, s32
3912 ; GFX11-NEXT: s_movreld_b32 s0, s34
3913 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3914 ; GFX11-NEXT: v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
3915 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_mov_b32 v5, s5
3916 ; GFX11-NEXT: v_dual_mov_b32 v6, s6 :: v_dual_mov_b32 v7, s7
3917 ; GFX11-NEXT: v_dual_mov_b32 v8, s8 :: v_dual_mov_b32 v9, s9
3918 ; GFX11-NEXT: v_dual_mov_b32 v10, s10 :: v_dual_mov_b32 v11, s11
3919 ; GFX11-NEXT: v_dual_mov_b32 v12, s12 :: v_dual_mov_b32 v13, s13
3920 ; GFX11-NEXT: v_dual_mov_b32 v14, s14 :: v_dual_mov_b32 v15, s15
3921 ; GFX11-NEXT: v_dual_mov_b32 v16, s16 :: v_dual_mov_b32 v17, s17
3922 ; GFX11-NEXT: v_dual_mov_b32 v18, s18 :: v_dual_mov_b32 v19, s19
3923 ; GFX11-NEXT: v_dual_mov_b32 v20, s20 :: v_dual_mov_b32 v21, s21
3924 ; GFX11-NEXT: v_dual_mov_b32 v22, s22 :: v_dual_mov_b32 v23, s23
3925 ; GFX11-NEXT: v_dual_mov_b32 v24, s24 :: v_dual_mov_b32 v25, s25
3926 ; GFX11-NEXT: v_dual_mov_b32 v26, s26 :: v_dual_mov_b32 v27, s27
3927 ; GFX11-NEXT: v_dual_mov_b32 v28, s28 :: v_dual_mov_b32 v29, s29
3928 ; GFX11-NEXT: v_dual_mov_b32 v30, s30 :: v_dual_mov_b32 v31, s31
3929 ; GFX11-NEXT: ; return to shader part epilog
3931 %insert = insertelement <32 x float> %vec, float %val, i32 %idx
3932 ret <32 x float> %insert
3935 define amdgpu_ps <16 x i64> @dyn_insertelement_v16i64_s_s_s(<16 x i64> inreg %vec, i64 inreg %val, i32 inreg %idx) {
3936 ; GPRIDX-LABEL: dyn_insertelement_v16i64_s_s_s:
3937 ; GPRIDX: ; %bb.0: ; %entry
3938 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3939 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3940 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3941 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3942 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3943 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3944 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3945 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3946 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3947 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3948 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3949 ; GPRIDX-NEXT: s_mov_b32 s11, s13
3950 ; GPRIDX-NEXT: s_mov_b32 s12, s14
3951 ; GPRIDX-NEXT: s_mov_b32 s13, s15
3952 ; GPRIDX-NEXT: s_mov_b32 s14, s16
3953 ; GPRIDX-NEXT: s_mov_b32 s15, s17
3954 ; GPRIDX-NEXT: s_mov_b32 s16, s18
3955 ; GPRIDX-NEXT: s_mov_b32 s17, s19
3956 ; GPRIDX-NEXT: s_mov_b32 s18, s20
3957 ; GPRIDX-NEXT: s_mov_b32 s19, s21
3958 ; GPRIDX-NEXT: s_mov_b32 s20, s22
3959 ; GPRIDX-NEXT: s_mov_b32 s21, s23
3960 ; GPRIDX-NEXT: s_mov_b32 s22, s24
3961 ; GPRIDX-NEXT: s_mov_b32 s23, s25
3962 ; GPRIDX-NEXT: s_mov_b32 s24, s26
3963 ; GPRIDX-NEXT: s_mov_b32 s25, s27
3964 ; GPRIDX-NEXT: s_mov_b32 s26, s28
3965 ; GPRIDX-NEXT: s_mov_b32 s27, s29
3966 ; GPRIDX-NEXT: s_mov_b32 s28, s30
3967 ; GPRIDX-NEXT: s_mov_b32 s29, s31
3968 ; GPRIDX-NEXT: s_mov_b32 s31, s33
3969 ; GPRIDX-NEXT: s_mov_b32 s30, s32
3970 ; GPRIDX-NEXT: s_mov_b32 m0, s36
3971 ; GPRIDX-NEXT: s_nop 0
3972 ; GPRIDX-NEXT: s_movreld_b64 s[0:1], s[34:35]
3973 ; GPRIDX-NEXT: ; return to shader part epilog
3975 ; GFX10PLUS-LABEL: dyn_insertelement_v16i64_s_s_s:
3976 ; GFX10PLUS: ; %bb.0: ; %entry
3977 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
3978 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
3979 ; GFX10PLUS-NEXT: s_mov_b32 m0, s36
3980 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
3981 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
3982 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
3983 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
3984 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
3985 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
3986 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
3987 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
3988 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
3989 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
3990 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
3991 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
3992 ; GFX10PLUS-NEXT: s_mov_b32 s14, s16
3993 ; GFX10PLUS-NEXT: s_mov_b32 s15, s17
3994 ; GFX10PLUS-NEXT: s_mov_b32 s16, s18
3995 ; GFX10PLUS-NEXT: s_mov_b32 s17, s19
3996 ; GFX10PLUS-NEXT: s_mov_b32 s18, s20
3997 ; GFX10PLUS-NEXT: s_mov_b32 s19, s21
3998 ; GFX10PLUS-NEXT: s_mov_b32 s20, s22
3999 ; GFX10PLUS-NEXT: s_mov_b32 s21, s23
4000 ; GFX10PLUS-NEXT: s_mov_b32 s22, s24
4001 ; GFX10PLUS-NEXT: s_mov_b32 s23, s25
4002 ; GFX10PLUS-NEXT: s_mov_b32 s24, s26
4003 ; GFX10PLUS-NEXT: s_mov_b32 s25, s27
4004 ; GFX10PLUS-NEXT: s_mov_b32 s26, s28
4005 ; GFX10PLUS-NEXT: s_mov_b32 s27, s29
4006 ; GFX10PLUS-NEXT: s_mov_b32 s28, s30
4007 ; GFX10PLUS-NEXT: s_mov_b32 s29, s31
4008 ; GFX10PLUS-NEXT: s_mov_b32 s31, s33
4009 ; GFX10PLUS-NEXT: s_mov_b32 s30, s32
4010 ; GFX10PLUS-NEXT: s_movreld_b64 s[0:1], s[34:35]
4011 ; GFX10PLUS-NEXT: ; return to shader part epilog
4013 %insert = insertelement <16 x i64> %vec, i64 %val, i32 %idx
4014 ret <16 x i64> %insert
4017 define amdgpu_ps <16 x double> @dyn_insertelement_v16f64_s_s_s(<16 x double> inreg %vec, double inreg %val, i32 inreg %idx) {
4018 ; GPRIDX-LABEL: dyn_insertelement_v16f64_s_s_s:
4019 ; GPRIDX: ; %bb.0: ; %entry
4020 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4021 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4022 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4023 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4024 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4025 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4026 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4027 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4028 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4029 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4030 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4031 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4032 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4033 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4034 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4035 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4036 ; GPRIDX-NEXT: s_mov_b32 s16, s18
4037 ; GPRIDX-NEXT: s_mov_b32 s17, s19
4038 ; GPRIDX-NEXT: s_mov_b32 s18, s20
4039 ; GPRIDX-NEXT: s_mov_b32 s19, s21
4040 ; GPRIDX-NEXT: s_mov_b32 s20, s22
4041 ; GPRIDX-NEXT: s_mov_b32 s21, s23
4042 ; GPRIDX-NEXT: s_mov_b32 s22, s24
4043 ; GPRIDX-NEXT: s_mov_b32 s23, s25
4044 ; GPRIDX-NEXT: s_mov_b32 s24, s26
4045 ; GPRIDX-NEXT: s_mov_b32 s25, s27
4046 ; GPRIDX-NEXT: s_mov_b32 s26, s28
4047 ; GPRIDX-NEXT: s_mov_b32 s27, s29
4048 ; GPRIDX-NEXT: s_mov_b32 s28, s30
4049 ; GPRIDX-NEXT: s_mov_b32 s29, s31
4050 ; GPRIDX-NEXT: s_mov_b32 s31, s33
4051 ; GPRIDX-NEXT: s_mov_b32 s30, s32
4052 ; GPRIDX-NEXT: s_mov_b32 m0, s36
4053 ; GPRIDX-NEXT: s_nop 0
4054 ; GPRIDX-NEXT: s_movreld_b64 s[0:1], s[34:35]
4055 ; GPRIDX-NEXT: ; return to shader part epilog
4057 ; GFX10PLUS-LABEL: dyn_insertelement_v16f64_s_s_s:
4058 ; GFX10PLUS: ; %bb.0: ; %entry
4059 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
4060 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
4061 ; GFX10PLUS-NEXT: s_mov_b32 m0, s36
4062 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
4063 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
4064 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
4065 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
4066 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
4067 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
4068 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
4069 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
4070 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
4071 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
4072 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
4073 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
4074 ; GFX10PLUS-NEXT: s_mov_b32 s14, s16
4075 ; GFX10PLUS-NEXT: s_mov_b32 s15, s17
4076 ; GFX10PLUS-NEXT: s_mov_b32 s16, s18
4077 ; GFX10PLUS-NEXT: s_mov_b32 s17, s19
4078 ; GFX10PLUS-NEXT: s_mov_b32 s18, s20
4079 ; GFX10PLUS-NEXT: s_mov_b32 s19, s21
4080 ; GFX10PLUS-NEXT: s_mov_b32 s20, s22
4081 ; GFX10PLUS-NEXT: s_mov_b32 s21, s23
4082 ; GFX10PLUS-NEXT: s_mov_b32 s22, s24
4083 ; GFX10PLUS-NEXT: s_mov_b32 s23, s25
4084 ; GFX10PLUS-NEXT: s_mov_b32 s24, s26
4085 ; GFX10PLUS-NEXT: s_mov_b32 s25, s27
4086 ; GFX10PLUS-NEXT: s_mov_b32 s26, s28
4087 ; GFX10PLUS-NEXT: s_mov_b32 s27, s29
4088 ; GFX10PLUS-NEXT: s_mov_b32 s28, s30
4089 ; GFX10PLUS-NEXT: s_mov_b32 s29, s31
4090 ; GFX10PLUS-NEXT: s_mov_b32 s31, s33
4091 ; GFX10PLUS-NEXT: s_mov_b32 s30, s32
4092 ; GFX10PLUS-NEXT: s_movreld_b64 s[0:1], s[34:35]
4093 ; GFX10PLUS-NEXT: ; return to shader part epilog
4095 %insert = insertelement <16 x double> %vec, double %val, i32 %idx
4096 ret <16 x double> %insert
4099 define amdgpu_ps <16 x i32> @dyn_insertelement_v16i32_s_v_s(<16 x i32> inreg %vec, i32 %val, i32 inreg %idx) {
4100 ; GPRIDX-LABEL: dyn_insertelement_v16i32_s_v_s:
4101 ; GPRIDX: ; %bb.0: ; %entry
4102 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4103 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4104 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4105 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4106 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4107 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4108 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4109 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4110 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4111 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4112 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4113 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4114 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4115 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4116 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4117 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4118 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s15
4119 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s14
4120 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s13
4121 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s12
4122 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s11
4123 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s10
4124 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s9
4125 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s8
4126 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s7
4127 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s6
4128 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s5
4129 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s4
4130 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s3
4131 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s2
4132 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s1
4133 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s0
4134 ; GPRIDX-NEXT: s_set_gpr_idx_on s18, gpr_idx(DST)
4135 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v0
4136 ; GPRIDX-NEXT: s_set_gpr_idx_off
4137 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v1
4138 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v2
4139 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v3
4140 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v4
4141 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v5
4142 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v6
4143 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v7
4144 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v8
4145 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v9
4146 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v10
4147 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v11
4148 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v12
4149 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v13
4150 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v14
4151 ; GPRIDX-NEXT: v_readfirstlane_b32 s14, v15
4152 ; GPRIDX-NEXT: v_readfirstlane_b32 s15, v16
4153 ; GPRIDX-NEXT: ; return to shader part epilog
4155 ; GFX10-LABEL: dyn_insertelement_v16i32_s_v_s:
4156 ; GFX10: ; %bb.0: ; %entry
4157 ; GFX10-NEXT: s_mov_b32 s1, s3
4158 ; GFX10-NEXT: s_mov_b32 s3, s5
4159 ; GFX10-NEXT: s_mov_b32 s5, s7
4160 ; GFX10-NEXT: s_mov_b32 s7, s9
4161 ; GFX10-NEXT: s_mov_b32 s9, s11
4162 ; GFX10-NEXT: s_mov_b32 s11, s13
4163 ; GFX10-NEXT: s_mov_b32 s13, s15
4164 ; GFX10-NEXT: s_mov_b32 s15, s17
4165 ; GFX10-NEXT: s_mov_b32 s0, s2
4166 ; GFX10-NEXT: s_mov_b32 s2, s4
4167 ; GFX10-NEXT: s_mov_b32 s4, s6
4168 ; GFX10-NEXT: s_mov_b32 s6, s8
4169 ; GFX10-NEXT: s_mov_b32 s8, s10
4170 ; GFX10-NEXT: s_mov_b32 s10, s12
4171 ; GFX10-NEXT: s_mov_b32 s12, s14
4172 ; GFX10-NEXT: s_mov_b32 s14, s16
4173 ; GFX10-NEXT: v_mov_b32_e32 v16, s15
4174 ; GFX10-NEXT: v_mov_b32_e32 v1, s0
4175 ; GFX10-NEXT: s_mov_b32 m0, s18
4176 ; GFX10-NEXT: v_mov_b32_e32 v15, s14
4177 ; GFX10-NEXT: v_mov_b32_e32 v14, s13
4178 ; GFX10-NEXT: v_mov_b32_e32 v13, s12
4179 ; GFX10-NEXT: v_mov_b32_e32 v12, s11
4180 ; GFX10-NEXT: v_mov_b32_e32 v11, s10
4181 ; GFX10-NEXT: v_mov_b32_e32 v10, s9
4182 ; GFX10-NEXT: v_mov_b32_e32 v9, s8
4183 ; GFX10-NEXT: v_mov_b32_e32 v8, s7
4184 ; GFX10-NEXT: v_mov_b32_e32 v7, s6
4185 ; GFX10-NEXT: v_mov_b32_e32 v6, s5
4186 ; GFX10-NEXT: v_mov_b32_e32 v5, s4
4187 ; GFX10-NEXT: v_mov_b32_e32 v4, s3
4188 ; GFX10-NEXT: v_mov_b32_e32 v3, s2
4189 ; GFX10-NEXT: v_mov_b32_e32 v2, s1
4190 ; GFX10-NEXT: v_movreld_b32_e32 v1, v0
4191 ; GFX10-NEXT: v_readfirstlane_b32 s0, v1
4192 ; GFX10-NEXT: v_readfirstlane_b32 s1, v2
4193 ; GFX10-NEXT: v_readfirstlane_b32 s2, v3
4194 ; GFX10-NEXT: v_readfirstlane_b32 s3, v4
4195 ; GFX10-NEXT: v_readfirstlane_b32 s4, v5
4196 ; GFX10-NEXT: v_readfirstlane_b32 s5, v6
4197 ; GFX10-NEXT: v_readfirstlane_b32 s6, v7
4198 ; GFX10-NEXT: v_readfirstlane_b32 s7, v8
4199 ; GFX10-NEXT: v_readfirstlane_b32 s8, v9
4200 ; GFX10-NEXT: v_readfirstlane_b32 s9, v10
4201 ; GFX10-NEXT: v_readfirstlane_b32 s10, v11
4202 ; GFX10-NEXT: v_readfirstlane_b32 s11, v12
4203 ; GFX10-NEXT: v_readfirstlane_b32 s12, v13
4204 ; GFX10-NEXT: v_readfirstlane_b32 s13, v14
4205 ; GFX10-NEXT: v_readfirstlane_b32 s14, v15
4206 ; GFX10-NEXT: v_readfirstlane_b32 s15, v16
4207 ; GFX10-NEXT: ; return to shader part epilog
4209 ; GFX11-LABEL: dyn_insertelement_v16i32_s_v_s:
4210 ; GFX11: ; %bb.0: ; %entry
4211 ; GFX11-NEXT: s_mov_b32 s1, s3
4212 ; GFX11-NEXT: s_mov_b32 s3, s5
4213 ; GFX11-NEXT: s_mov_b32 s5, s7
4214 ; GFX11-NEXT: s_mov_b32 s7, s9
4215 ; GFX11-NEXT: s_mov_b32 s9, s11
4216 ; GFX11-NEXT: s_mov_b32 s11, s13
4217 ; GFX11-NEXT: s_mov_b32 s13, s15
4218 ; GFX11-NEXT: s_mov_b32 s15, s17
4219 ; GFX11-NEXT: s_mov_b32 s0, s2
4220 ; GFX11-NEXT: s_mov_b32 s2, s4
4221 ; GFX11-NEXT: s_mov_b32 s4, s6
4222 ; GFX11-NEXT: s_mov_b32 s6, s8
4223 ; GFX11-NEXT: s_mov_b32 s8, s10
4224 ; GFX11-NEXT: s_mov_b32 s10, s12
4225 ; GFX11-NEXT: s_mov_b32 s12, s14
4226 ; GFX11-NEXT: s_mov_b32 s14, s16
4227 ; GFX11-NEXT: v_dual_mov_b32 v16, s15 :: v_dual_mov_b32 v15, s14
4228 ; GFX11-NEXT: v_dual_mov_b32 v2, s1 :: v_dual_mov_b32 v1, s0
4229 ; GFX11-NEXT: s_mov_b32 m0, s18
4230 ; GFX11-NEXT: v_dual_mov_b32 v14, s13 :: v_dual_mov_b32 v13, s12
4231 ; GFX11-NEXT: v_dual_mov_b32 v12, s11 :: v_dual_mov_b32 v11, s10
4232 ; GFX11-NEXT: v_dual_mov_b32 v10, s9 :: v_dual_mov_b32 v9, s8
4233 ; GFX11-NEXT: v_dual_mov_b32 v8, s7 :: v_dual_mov_b32 v7, s6
4234 ; GFX11-NEXT: v_dual_mov_b32 v6, s5 :: v_dual_mov_b32 v5, s4
4235 ; GFX11-NEXT: v_dual_mov_b32 v4, s3 :: v_dual_mov_b32 v3, s2
4236 ; GFX11-NEXT: v_movreld_b32_e32 v1, v0
4237 ; GFX11-NEXT: v_readfirstlane_b32 s0, v1
4238 ; GFX11-NEXT: v_readfirstlane_b32 s1, v2
4239 ; GFX11-NEXT: v_readfirstlane_b32 s2, v3
4240 ; GFX11-NEXT: v_readfirstlane_b32 s3, v4
4241 ; GFX11-NEXT: v_readfirstlane_b32 s4, v5
4242 ; GFX11-NEXT: v_readfirstlane_b32 s5, v6
4243 ; GFX11-NEXT: v_readfirstlane_b32 s6, v7
4244 ; GFX11-NEXT: v_readfirstlane_b32 s7, v8
4245 ; GFX11-NEXT: v_readfirstlane_b32 s8, v9
4246 ; GFX11-NEXT: v_readfirstlane_b32 s9, v10
4247 ; GFX11-NEXT: v_readfirstlane_b32 s10, v11
4248 ; GFX11-NEXT: v_readfirstlane_b32 s11, v12
4249 ; GFX11-NEXT: v_readfirstlane_b32 s12, v13
4250 ; GFX11-NEXT: v_readfirstlane_b32 s13, v14
4251 ; GFX11-NEXT: v_readfirstlane_b32 s14, v15
4252 ; GFX11-NEXT: v_readfirstlane_b32 s15, v16
4253 ; GFX11-NEXT: ; return to shader part epilog
4255 %insert = insertelement <16 x i32> %vec, i32 %val, i32 %idx
4256 ret <16 x i32> %insert
4259 define amdgpu_ps <16 x float> @dyn_insertelement_v16f32_s_v_s(<16 x float> inreg %vec, float %val, i32 inreg %idx) {
4260 ; GPRIDX-LABEL: dyn_insertelement_v16f32_s_v_s:
4261 ; GPRIDX: ; %bb.0: ; %entry
4262 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4263 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4264 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4265 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4266 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4267 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4268 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4269 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4270 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4271 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4272 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4273 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4274 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4275 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4276 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4277 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4278 ; GPRIDX-NEXT: v_mov_b32_e32 v16, v0
4279 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
4280 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
4281 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
4282 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
4283 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
4284 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
4285 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
4286 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
4287 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
4288 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
4289 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
4290 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
4291 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s12
4292 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s13
4293 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s14
4294 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s15
4295 ; GPRIDX-NEXT: s_set_gpr_idx_on s18, gpr_idx(DST)
4296 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v16
4297 ; GPRIDX-NEXT: s_set_gpr_idx_off
4298 ; GPRIDX-NEXT: ; return to shader part epilog
4300 ; GFX10-LABEL: dyn_insertelement_v16f32_s_v_s:
4301 ; GFX10: ; %bb.0: ; %entry
4302 ; GFX10-NEXT: s_mov_b32 s0, s2
4303 ; GFX10-NEXT: s_mov_b32 s1, s3
4304 ; GFX10-NEXT: s_mov_b32 s2, s4
4305 ; GFX10-NEXT: s_mov_b32 s3, s5
4306 ; GFX10-NEXT: s_mov_b32 s4, s6
4307 ; GFX10-NEXT: s_mov_b32 s5, s7
4308 ; GFX10-NEXT: s_mov_b32 s6, s8
4309 ; GFX10-NEXT: s_mov_b32 s7, s9
4310 ; GFX10-NEXT: s_mov_b32 s8, s10
4311 ; GFX10-NEXT: s_mov_b32 s9, s11
4312 ; GFX10-NEXT: s_mov_b32 s10, s12
4313 ; GFX10-NEXT: s_mov_b32 s11, s13
4314 ; GFX10-NEXT: s_mov_b32 s12, s14
4315 ; GFX10-NEXT: s_mov_b32 s13, s15
4316 ; GFX10-NEXT: s_mov_b32 s14, s16
4317 ; GFX10-NEXT: s_mov_b32 s15, s17
4318 ; GFX10-NEXT: v_mov_b32_e32 v16, v0
4319 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
4320 ; GFX10-NEXT: s_mov_b32 m0, s18
4321 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
4322 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
4323 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
4324 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
4325 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
4326 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
4327 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
4328 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
4329 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
4330 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
4331 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
4332 ; GFX10-NEXT: v_mov_b32_e32 v12, s12
4333 ; GFX10-NEXT: v_mov_b32_e32 v13, s13
4334 ; GFX10-NEXT: v_mov_b32_e32 v14, s14
4335 ; GFX10-NEXT: v_mov_b32_e32 v15, s15
4336 ; GFX10-NEXT: v_movreld_b32_e32 v0, v16
4337 ; GFX10-NEXT: ; return to shader part epilog
4339 ; GFX11-LABEL: dyn_insertelement_v16f32_s_v_s:
4340 ; GFX11: ; %bb.0: ; %entry
4341 ; GFX11-NEXT: s_mov_b32 s0, s2
4342 ; GFX11-NEXT: s_mov_b32 s1, s3
4343 ; GFX11-NEXT: s_mov_b32 s2, s4
4344 ; GFX11-NEXT: s_mov_b32 s3, s5
4345 ; GFX11-NEXT: s_mov_b32 s4, s6
4346 ; GFX11-NEXT: s_mov_b32 s5, s7
4347 ; GFX11-NEXT: s_mov_b32 s6, s8
4348 ; GFX11-NEXT: s_mov_b32 s7, s9
4349 ; GFX11-NEXT: s_mov_b32 s8, s10
4350 ; GFX11-NEXT: s_mov_b32 s9, s11
4351 ; GFX11-NEXT: s_mov_b32 s10, s12
4352 ; GFX11-NEXT: s_mov_b32 s11, s13
4353 ; GFX11-NEXT: s_mov_b32 s12, s14
4354 ; GFX11-NEXT: s_mov_b32 s13, s15
4355 ; GFX11-NEXT: s_mov_b32 s14, s16
4356 ; GFX11-NEXT: s_mov_b32 s15, s17
4357 ; GFX11-NEXT: v_mov_b32_e32 v16, v0
4358 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v3, s3
4359 ; GFX11-NEXT: s_mov_b32 m0, s18
4360 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
4361 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v4, s4
4362 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v6, s6
4363 ; GFX11-NEXT: v_dual_mov_b32 v9, s9 :: v_dual_mov_b32 v8, s8
4364 ; GFX11-NEXT: v_dual_mov_b32 v11, s11 :: v_dual_mov_b32 v10, s10
4365 ; GFX11-NEXT: v_dual_mov_b32 v13, s13 :: v_dual_mov_b32 v12, s12
4366 ; GFX11-NEXT: v_dual_mov_b32 v15, s15 :: v_dual_mov_b32 v14, s14
4367 ; GFX11-NEXT: v_movreld_b32_e32 v0, v16
4368 ; GFX11-NEXT: ; return to shader part epilog
4370 %insert = insertelement <16 x float> %vec, float %val, i32 %idx
4371 ret <16 x float> %insert
4374 define amdgpu_ps <32 x float> @dyn_insertelement_v32f32_s_v_s(<32 x float> inreg %vec, float %val, i32 inreg %idx) {
4375 ; GPRIDX-LABEL: dyn_insertelement_v32f32_s_v_s:
4376 ; GPRIDX: ; %bb.0: ; %entry
4377 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4378 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4379 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4380 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4381 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4382 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4383 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4384 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4385 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4386 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4387 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4388 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4389 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4390 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4391 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4392 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4393 ; GPRIDX-NEXT: s_mov_b32 s16, s18
4394 ; GPRIDX-NEXT: s_mov_b32 s17, s19
4395 ; GPRIDX-NEXT: s_mov_b32 s18, s20
4396 ; GPRIDX-NEXT: s_mov_b32 s19, s21
4397 ; GPRIDX-NEXT: s_mov_b32 s20, s22
4398 ; GPRIDX-NEXT: s_mov_b32 s21, s23
4399 ; GPRIDX-NEXT: s_mov_b32 s22, s24
4400 ; GPRIDX-NEXT: s_mov_b32 s23, s25
4401 ; GPRIDX-NEXT: s_mov_b32 s24, s26
4402 ; GPRIDX-NEXT: s_mov_b32 s25, s27
4403 ; GPRIDX-NEXT: s_mov_b32 s26, s28
4404 ; GPRIDX-NEXT: s_mov_b32 s27, s29
4405 ; GPRIDX-NEXT: s_mov_b32 s28, s30
4406 ; GPRIDX-NEXT: s_mov_b32 s29, s31
4407 ; GPRIDX-NEXT: s_mov_b32 s31, s33
4408 ; GPRIDX-NEXT: s_mov_b32 s30, s32
4409 ; GPRIDX-NEXT: v_mov_b32_e32 v32, v0
4410 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
4411 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
4412 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
4413 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
4414 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
4415 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
4416 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
4417 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
4418 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
4419 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
4420 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
4421 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
4422 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s12
4423 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s13
4424 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s14
4425 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s15
4426 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s16
4427 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s17
4428 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s18
4429 ; GPRIDX-NEXT: v_mov_b32_e32 v19, s19
4430 ; GPRIDX-NEXT: v_mov_b32_e32 v20, s20
4431 ; GPRIDX-NEXT: v_mov_b32_e32 v21, s21
4432 ; GPRIDX-NEXT: v_mov_b32_e32 v22, s22
4433 ; GPRIDX-NEXT: v_mov_b32_e32 v23, s23
4434 ; GPRIDX-NEXT: v_mov_b32_e32 v24, s24
4435 ; GPRIDX-NEXT: v_mov_b32_e32 v25, s25
4436 ; GPRIDX-NEXT: v_mov_b32_e32 v26, s26
4437 ; GPRIDX-NEXT: v_mov_b32_e32 v27, s27
4438 ; GPRIDX-NEXT: v_mov_b32_e32 v28, s28
4439 ; GPRIDX-NEXT: v_mov_b32_e32 v29, s29
4440 ; GPRIDX-NEXT: v_mov_b32_e32 v30, s30
4441 ; GPRIDX-NEXT: v_mov_b32_e32 v31, s31
4442 ; GPRIDX-NEXT: s_set_gpr_idx_on s34, gpr_idx(DST)
4443 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v32
4444 ; GPRIDX-NEXT: s_set_gpr_idx_off
4445 ; GPRIDX-NEXT: ; return to shader part epilog
4447 ; GFX10-LABEL: dyn_insertelement_v32f32_s_v_s:
4448 ; GFX10: ; %bb.0: ; %entry
4449 ; GFX10-NEXT: s_mov_b32 s0, s2
4450 ; GFX10-NEXT: s_mov_b32 s1, s3
4451 ; GFX10-NEXT: s_mov_b32 s2, s4
4452 ; GFX10-NEXT: s_mov_b32 s3, s5
4453 ; GFX10-NEXT: s_mov_b32 s4, s6
4454 ; GFX10-NEXT: s_mov_b32 s5, s7
4455 ; GFX10-NEXT: s_mov_b32 s6, s8
4456 ; GFX10-NEXT: s_mov_b32 s7, s9
4457 ; GFX10-NEXT: s_mov_b32 s8, s10
4458 ; GFX10-NEXT: s_mov_b32 s9, s11
4459 ; GFX10-NEXT: s_mov_b32 s10, s12
4460 ; GFX10-NEXT: s_mov_b32 s11, s13
4461 ; GFX10-NEXT: s_mov_b32 s12, s14
4462 ; GFX10-NEXT: s_mov_b32 s13, s15
4463 ; GFX10-NEXT: s_mov_b32 s14, s16
4464 ; GFX10-NEXT: s_mov_b32 s15, s17
4465 ; GFX10-NEXT: s_mov_b32 s16, s18
4466 ; GFX10-NEXT: s_mov_b32 s17, s19
4467 ; GFX10-NEXT: s_mov_b32 s18, s20
4468 ; GFX10-NEXT: s_mov_b32 s19, s21
4469 ; GFX10-NEXT: s_mov_b32 s20, s22
4470 ; GFX10-NEXT: s_mov_b32 s21, s23
4471 ; GFX10-NEXT: s_mov_b32 s22, s24
4472 ; GFX10-NEXT: s_mov_b32 s23, s25
4473 ; GFX10-NEXT: s_mov_b32 s24, s26
4474 ; GFX10-NEXT: s_mov_b32 s25, s27
4475 ; GFX10-NEXT: s_mov_b32 s26, s28
4476 ; GFX10-NEXT: s_mov_b32 s27, s29
4477 ; GFX10-NEXT: s_mov_b32 s28, s30
4478 ; GFX10-NEXT: s_mov_b32 s29, s31
4479 ; GFX10-NEXT: s_mov_b32 s31, s33
4480 ; GFX10-NEXT: s_mov_b32 s30, s32
4481 ; GFX10-NEXT: v_mov_b32_e32 v32, v0
4482 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
4483 ; GFX10-NEXT: s_mov_b32 m0, s34
4484 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
4485 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
4486 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
4487 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
4488 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
4489 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
4490 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
4491 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
4492 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
4493 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
4494 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
4495 ; GFX10-NEXT: v_mov_b32_e32 v12, s12
4496 ; GFX10-NEXT: v_mov_b32_e32 v13, s13
4497 ; GFX10-NEXT: v_mov_b32_e32 v14, s14
4498 ; GFX10-NEXT: v_mov_b32_e32 v15, s15
4499 ; GFX10-NEXT: v_mov_b32_e32 v16, s16
4500 ; GFX10-NEXT: v_mov_b32_e32 v17, s17
4501 ; GFX10-NEXT: v_mov_b32_e32 v18, s18
4502 ; GFX10-NEXT: v_mov_b32_e32 v19, s19
4503 ; GFX10-NEXT: v_mov_b32_e32 v20, s20
4504 ; GFX10-NEXT: v_mov_b32_e32 v21, s21
4505 ; GFX10-NEXT: v_mov_b32_e32 v22, s22
4506 ; GFX10-NEXT: v_mov_b32_e32 v23, s23
4507 ; GFX10-NEXT: v_mov_b32_e32 v24, s24
4508 ; GFX10-NEXT: v_mov_b32_e32 v25, s25
4509 ; GFX10-NEXT: v_mov_b32_e32 v26, s26
4510 ; GFX10-NEXT: v_mov_b32_e32 v27, s27
4511 ; GFX10-NEXT: v_mov_b32_e32 v28, s28
4512 ; GFX10-NEXT: v_mov_b32_e32 v29, s29
4513 ; GFX10-NEXT: v_mov_b32_e32 v30, s30
4514 ; GFX10-NEXT: v_mov_b32_e32 v31, s31
4515 ; GFX10-NEXT: v_movreld_b32_e32 v0, v32
4516 ; GFX10-NEXT: ; return to shader part epilog
4518 ; GFX11-LABEL: dyn_insertelement_v32f32_s_v_s:
4519 ; GFX11: ; %bb.0: ; %entry
4520 ; GFX11-NEXT: s_mov_b32 s0, s2
4521 ; GFX11-NEXT: s_mov_b32 s1, s3
4522 ; GFX11-NEXT: s_mov_b32 s2, s4
4523 ; GFX11-NEXT: s_mov_b32 s3, s5
4524 ; GFX11-NEXT: s_mov_b32 s4, s6
4525 ; GFX11-NEXT: s_mov_b32 s5, s7
4526 ; GFX11-NEXT: s_mov_b32 s6, s8
4527 ; GFX11-NEXT: s_mov_b32 s7, s9
4528 ; GFX11-NEXT: s_mov_b32 s8, s10
4529 ; GFX11-NEXT: s_mov_b32 s9, s11
4530 ; GFX11-NEXT: s_mov_b32 s10, s12
4531 ; GFX11-NEXT: s_mov_b32 s11, s13
4532 ; GFX11-NEXT: s_mov_b32 s12, s14
4533 ; GFX11-NEXT: s_mov_b32 s13, s15
4534 ; GFX11-NEXT: s_mov_b32 s14, s16
4535 ; GFX11-NEXT: s_mov_b32 s15, s17
4536 ; GFX11-NEXT: s_mov_b32 s16, s18
4537 ; GFX11-NEXT: s_mov_b32 s17, s19
4538 ; GFX11-NEXT: s_mov_b32 s18, s20
4539 ; GFX11-NEXT: s_mov_b32 s19, s21
4540 ; GFX11-NEXT: s_mov_b32 s20, s22
4541 ; GFX11-NEXT: s_mov_b32 s21, s23
4542 ; GFX11-NEXT: s_mov_b32 s22, s24
4543 ; GFX11-NEXT: s_mov_b32 s23, s25
4544 ; GFX11-NEXT: s_mov_b32 s24, s26
4545 ; GFX11-NEXT: s_mov_b32 s25, s27
4546 ; GFX11-NEXT: s_mov_b32 s26, s28
4547 ; GFX11-NEXT: s_mov_b32 s27, s29
4548 ; GFX11-NEXT: s_mov_b32 s28, s30
4549 ; GFX11-NEXT: s_mov_b32 s29, s31
4550 ; GFX11-NEXT: s_mov_b32 s31, s33
4551 ; GFX11-NEXT: s_mov_b32 s30, s32
4552 ; GFX11-NEXT: v_mov_b32_e32 v32, v0
4553 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v3, s3
4554 ; GFX11-NEXT: s_mov_b32 m0, s34
4555 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
4556 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v4, s4
4557 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v6, s6
4558 ; GFX11-NEXT: v_dual_mov_b32 v9, s9 :: v_dual_mov_b32 v8, s8
4559 ; GFX11-NEXT: v_dual_mov_b32 v11, s11 :: v_dual_mov_b32 v10, s10
4560 ; GFX11-NEXT: v_dual_mov_b32 v13, s13 :: v_dual_mov_b32 v12, s12
4561 ; GFX11-NEXT: v_dual_mov_b32 v15, s15 :: v_dual_mov_b32 v14, s14
4562 ; GFX11-NEXT: v_dual_mov_b32 v17, s17 :: v_dual_mov_b32 v16, s16
4563 ; GFX11-NEXT: v_dual_mov_b32 v19, s19 :: v_dual_mov_b32 v18, s18
4564 ; GFX11-NEXT: v_dual_mov_b32 v21, s21 :: v_dual_mov_b32 v20, s20
4565 ; GFX11-NEXT: v_dual_mov_b32 v23, s23 :: v_dual_mov_b32 v22, s22
4566 ; GFX11-NEXT: v_dual_mov_b32 v25, s25 :: v_dual_mov_b32 v24, s24
4567 ; GFX11-NEXT: v_dual_mov_b32 v27, s27 :: v_dual_mov_b32 v26, s26
4568 ; GFX11-NEXT: v_dual_mov_b32 v29, s29 :: v_dual_mov_b32 v28, s28
4569 ; GFX11-NEXT: v_dual_mov_b32 v31, s31 :: v_dual_mov_b32 v30, s30
4570 ; GFX11-NEXT: v_movreld_b32_e32 v0, v32
4571 ; GFX11-NEXT: ; return to shader part epilog
4573 %insert = insertelement <32 x float> %vec, float %val, i32 %idx
4574 ret <32 x float> %insert
4577 define amdgpu_ps <16 x i64> @dyn_insertelement_v16i64_s_v_s(<16 x i64> inreg %vec, i64 %val, i32 inreg %idx) {
4578 ; GPRIDX-LABEL: dyn_insertelement_v16i64_s_v_s:
4579 ; GPRIDX: ; %bb.0: ; %entry
4580 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4581 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4582 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4583 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4584 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4585 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4586 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4587 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4588 ; GPRIDX-NEXT: s_mov_b32 s17, s19
4589 ; GPRIDX-NEXT: s_mov_b32 s19, s21
4590 ; GPRIDX-NEXT: s_mov_b32 s21, s23
4591 ; GPRIDX-NEXT: s_mov_b32 s23, s25
4592 ; GPRIDX-NEXT: s_mov_b32 s25, s27
4593 ; GPRIDX-NEXT: s_mov_b32 s27, s29
4594 ; GPRIDX-NEXT: s_mov_b32 s29, s31
4595 ; GPRIDX-NEXT: s_mov_b32 s31, s33
4596 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4597 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4598 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4599 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4600 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4601 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4602 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4603 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4604 ; GPRIDX-NEXT: s_mov_b32 s16, s18
4605 ; GPRIDX-NEXT: s_mov_b32 s18, s20
4606 ; GPRIDX-NEXT: s_mov_b32 s20, s22
4607 ; GPRIDX-NEXT: s_mov_b32 s22, s24
4608 ; GPRIDX-NEXT: s_mov_b32 s24, s26
4609 ; GPRIDX-NEXT: s_mov_b32 s26, s28
4610 ; GPRIDX-NEXT: s_mov_b32 s28, s30
4611 ; GPRIDX-NEXT: s_mov_b32 s30, s32
4612 ; GPRIDX-NEXT: v_mov_b32_e32 v33, s31
4613 ; GPRIDX-NEXT: s_lshl_b32 s33, s34, 1
4614 ; GPRIDX-NEXT: v_mov_b32_e32 v32, s30
4615 ; GPRIDX-NEXT: v_mov_b32_e32 v31, s29
4616 ; GPRIDX-NEXT: v_mov_b32_e32 v30, s28
4617 ; GPRIDX-NEXT: v_mov_b32_e32 v29, s27
4618 ; GPRIDX-NEXT: v_mov_b32_e32 v28, s26
4619 ; GPRIDX-NEXT: v_mov_b32_e32 v27, s25
4620 ; GPRIDX-NEXT: v_mov_b32_e32 v26, s24
4621 ; GPRIDX-NEXT: v_mov_b32_e32 v25, s23
4622 ; GPRIDX-NEXT: v_mov_b32_e32 v24, s22
4623 ; GPRIDX-NEXT: v_mov_b32_e32 v23, s21
4624 ; GPRIDX-NEXT: v_mov_b32_e32 v22, s20
4625 ; GPRIDX-NEXT: v_mov_b32_e32 v21, s19
4626 ; GPRIDX-NEXT: v_mov_b32_e32 v20, s18
4627 ; GPRIDX-NEXT: v_mov_b32_e32 v19, s17
4628 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s16
4629 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s15
4630 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s14
4631 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s13
4632 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s12
4633 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s11
4634 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s10
4635 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
4636 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
4637 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s7
4638 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s6
4639 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s5
4640 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s4
4641 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s3
4642 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s2
4643 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s1
4644 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s0
4645 ; GPRIDX-NEXT: s_set_gpr_idx_on s33, gpr_idx(DST)
4646 ; GPRIDX-NEXT: v_mov_b32_e32 v2, v0
4647 ; GPRIDX-NEXT: v_mov_b32_e32 v3, v1
4648 ; GPRIDX-NEXT: s_set_gpr_idx_off
4649 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v2
4650 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v3
4651 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v4
4652 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v5
4653 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v6
4654 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v7
4655 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v8
4656 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v9
4657 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v10
4658 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v11
4659 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v12
4660 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v13
4661 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v14
4662 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v15
4663 ; GPRIDX-NEXT: v_readfirstlane_b32 s14, v16
4664 ; GPRIDX-NEXT: v_readfirstlane_b32 s15, v17
4665 ; GPRIDX-NEXT: v_readfirstlane_b32 s16, v18
4666 ; GPRIDX-NEXT: v_readfirstlane_b32 s17, v19
4667 ; GPRIDX-NEXT: v_readfirstlane_b32 s18, v20
4668 ; GPRIDX-NEXT: v_readfirstlane_b32 s19, v21
4669 ; GPRIDX-NEXT: v_readfirstlane_b32 s20, v22
4670 ; GPRIDX-NEXT: v_readfirstlane_b32 s21, v23
4671 ; GPRIDX-NEXT: v_readfirstlane_b32 s22, v24
4672 ; GPRIDX-NEXT: v_readfirstlane_b32 s23, v25
4673 ; GPRIDX-NEXT: v_readfirstlane_b32 s24, v26
4674 ; GPRIDX-NEXT: v_readfirstlane_b32 s25, v27
4675 ; GPRIDX-NEXT: v_readfirstlane_b32 s26, v28
4676 ; GPRIDX-NEXT: v_readfirstlane_b32 s27, v29
4677 ; GPRIDX-NEXT: v_readfirstlane_b32 s28, v30
4678 ; GPRIDX-NEXT: v_readfirstlane_b32 s29, v31
4679 ; GPRIDX-NEXT: v_readfirstlane_b32 s30, v32
4680 ; GPRIDX-NEXT: v_readfirstlane_b32 s31, v33
4681 ; GPRIDX-NEXT: ; return to shader part epilog
4683 ; GFX10-LABEL: dyn_insertelement_v16i64_s_v_s:
4684 ; GFX10: ; %bb.0: ; %entry
4685 ; GFX10-NEXT: s_mov_b32 s1, s3
4686 ; GFX10-NEXT: s_mov_b32 s3, s5
4687 ; GFX10-NEXT: s_mov_b32 s5, s7
4688 ; GFX10-NEXT: s_mov_b32 s7, s9
4689 ; GFX10-NEXT: s_mov_b32 s9, s11
4690 ; GFX10-NEXT: s_mov_b32 s11, s13
4691 ; GFX10-NEXT: s_mov_b32 s13, s15
4692 ; GFX10-NEXT: s_mov_b32 s15, s17
4693 ; GFX10-NEXT: s_mov_b32 s17, s19
4694 ; GFX10-NEXT: s_mov_b32 s19, s21
4695 ; GFX10-NEXT: s_mov_b32 s21, s23
4696 ; GFX10-NEXT: s_mov_b32 s23, s25
4697 ; GFX10-NEXT: s_mov_b32 s25, s27
4698 ; GFX10-NEXT: s_mov_b32 s27, s29
4699 ; GFX10-NEXT: s_mov_b32 s29, s31
4700 ; GFX10-NEXT: s_mov_b32 s31, s33
4701 ; GFX10-NEXT: s_mov_b32 s0, s2
4702 ; GFX10-NEXT: s_mov_b32 s2, s4
4703 ; GFX10-NEXT: s_mov_b32 s4, s6
4704 ; GFX10-NEXT: s_mov_b32 s6, s8
4705 ; GFX10-NEXT: s_mov_b32 s8, s10
4706 ; GFX10-NEXT: s_mov_b32 s10, s12
4707 ; GFX10-NEXT: s_mov_b32 s12, s14
4708 ; GFX10-NEXT: s_mov_b32 s14, s16
4709 ; GFX10-NEXT: s_mov_b32 s16, s18
4710 ; GFX10-NEXT: s_mov_b32 s18, s20
4711 ; GFX10-NEXT: s_mov_b32 s20, s22
4712 ; GFX10-NEXT: s_mov_b32 s22, s24
4713 ; GFX10-NEXT: s_mov_b32 s24, s26
4714 ; GFX10-NEXT: s_mov_b32 s26, s28
4715 ; GFX10-NEXT: s_mov_b32 s28, s30
4716 ; GFX10-NEXT: s_mov_b32 s30, s32
4717 ; GFX10-NEXT: v_mov_b32_e32 v33, s31
4718 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
4719 ; GFX10-NEXT: s_lshl_b32 m0, s34, 1
4720 ; GFX10-NEXT: v_mov_b32_e32 v32, s30
4721 ; GFX10-NEXT: v_mov_b32_e32 v31, s29
4722 ; GFX10-NEXT: v_mov_b32_e32 v30, s28
4723 ; GFX10-NEXT: v_mov_b32_e32 v29, s27
4724 ; GFX10-NEXT: v_mov_b32_e32 v28, s26
4725 ; GFX10-NEXT: v_mov_b32_e32 v27, s25
4726 ; GFX10-NEXT: v_mov_b32_e32 v26, s24
4727 ; GFX10-NEXT: v_mov_b32_e32 v25, s23
4728 ; GFX10-NEXT: v_mov_b32_e32 v24, s22
4729 ; GFX10-NEXT: v_mov_b32_e32 v23, s21
4730 ; GFX10-NEXT: v_mov_b32_e32 v22, s20
4731 ; GFX10-NEXT: v_mov_b32_e32 v21, s19
4732 ; GFX10-NEXT: v_mov_b32_e32 v20, s18
4733 ; GFX10-NEXT: v_mov_b32_e32 v19, s17
4734 ; GFX10-NEXT: v_mov_b32_e32 v18, s16
4735 ; GFX10-NEXT: v_mov_b32_e32 v17, s15
4736 ; GFX10-NEXT: v_mov_b32_e32 v16, s14
4737 ; GFX10-NEXT: v_mov_b32_e32 v15, s13
4738 ; GFX10-NEXT: v_mov_b32_e32 v14, s12
4739 ; GFX10-NEXT: v_mov_b32_e32 v13, s11
4740 ; GFX10-NEXT: v_mov_b32_e32 v12, s10
4741 ; GFX10-NEXT: v_mov_b32_e32 v11, s9
4742 ; GFX10-NEXT: v_mov_b32_e32 v10, s8
4743 ; GFX10-NEXT: v_mov_b32_e32 v9, s7
4744 ; GFX10-NEXT: v_mov_b32_e32 v8, s6
4745 ; GFX10-NEXT: v_mov_b32_e32 v7, s5
4746 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
4747 ; GFX10-NEXT: v_mov_b32_e32 v5, s3
4748 ; GFX10-NEXT: v_mov_b32_e32 v4, s2
4749 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
4750 ; GFX10-NEXT: v_movreld_b32_e32 v2, v0
4751 ; GFX10-NEXT: v_movreld_b32_e32 v3, v1
4752 ; GFX10-NEXT: v_readfirstlane_b32 s0, v2
4753 ; GFX10-NEXT: v_readfirstlane_b32 s1, v3
4754 ; GFX10-NEXT: v_readfirstlane_b32 s2, v4
4755 ; GFX10-NEXT: v_readfirstlane_b32 s3, v5
4756 ; GFX10-NEXT: v_readfirstlane_b32 s4, v6
4757 ; GFX10-NEXT: v_readfirstlane_b32 s5, v7
4758 ; GFX10-NEXT: v_readfirstlane_b32 s6, v8
4759 ; GFX10-NEXT: v_readfirstlane_b32 s7, v9
4760 ; GFX10-NEXT: v_readfirstlane_b32 s8, v10
4761 ; GFX10-NEXT: v_readfirstlane_b32 s9, v11
4762 ; GFX10-NEXT: v_readfirstlane_b32 s10, v12
4763 ; GFX10-NEXT: v_readfirstlane_b32 s11, v13
4764 ; GFX10-NEXT: v_readfirstlane_b32 s12, v14
4765 ; GFX10-NEXT: v_readfirstlane_b32 s13, v15
4766 ; GFX10-NEXT: v_readfirstlane_b32 s14, v16
4767 ; GFX10-NEXT: v_readfirstlane_b32 s15, v17
4768 ; GFX10-NEXT: v_readfirstlane_b32 s16, v18
4769 ; GFX10-NEXT: v_readfirstlane_b32 s17, v19
4770 ; GFX10-NEXT: v_readfirstlane_b32 s18, v20
4771 ; GFX10-NEXT: v_readfirstlane_b32 s19, v21
4772 ; GFX10-NEXT: v_readfirstlane_b32 s20, v22
4773 ; GFX10-NEXT: v_readfirstlane_b32 s21, v23
4774 ; GFX10-NEXT: v_readfirstlane_b32 s22, v24
4775 ; GFX10-NEXT: v_readfirstlane_b32 s23, v25
4776 ; GFX10-NEXT: v_readfirstlane_b32 s24, v26
4777 ; GFX10-NEXT: v_readfirstlane_b32 s25, v27
4778 ; GFX10-NEXT: v_readfirstlane_b32 s26, v28
4779 ; GFX10-NEXT: v_readfirstlane_b32 s27, v29
4780 ; GFX10-NEXT: v_readfirstlane_b32 s28, v30
4781 ; GFX10-NEXT: v_readfirstlane_b32 s29, v31
4782 ; GFX10-NEXT: v_readfirstlane_b32 s30, v32
4783 ; GFX10-NEXT: v_readfirstlane_b32 s31, v33
4784 ; GFX10-NEXT: ; return to shader part epilog
4786 ; GFX11-LABEL: dyn_insertelement_v16i64_s_v_s:
4787 ; GFX11: ; %bb.0: ; %entry
4788 ; GFX11-NEXT: s_mov_b32 s1, s3
4789 ; GFX11-NEXT: s_mov_b32 s3, s5
4790 ; GFX11-NEXT: s_mov_b32 s5, s7
4791 ; GFX11-NEXT: s_mov_b32 s7, s9
4792 ; GFX11-NEXT: s_mov_b32 s9, s11
4793 ; GFX11-NEXT: s_mov_b32 s11, s13
4794 ; GFX11-NEXT: s_mov_b32 s13, s15
4795 ; GFX11-NEXT: s_mov_b32 s15, s17
4796 ; GFX11-NEXT: s_mov_b32 s17, s19
4797 ; GFX11-NEXT: s_mov_b32 s19, s21
4798 ; GFX11-NEXT: s_mov_b32 s21, s23
4799 ; GFX11-NEXT: s_mov_b32 s23, s25
4800 ; GFX11-NEXT: s_mov_b32 s25, s27
4801 ; GFX11-NEXT: s_mov_b32 s27, s29
4802 ; GFX11-NEXT: s_mov_b32 s29, s31
4803 ; GFX11-NEXT: s_mov_b32 s31, s33
4804 ; GFX11-NEXT: s_mov_b32 s0, s2
4805 ; GFX11-NEXT: s_mov_b32 s2, s4
4806 ; GFX11-NEXT: s_mov_b32 s4, s6
4807 ; GFX11-NEXT: s_mov_b32 s6, s8
4808 ; GFX11-NEXT: s_mov_b32 s8, s10
4809 ; GFX11-NEXT: s_mov_b32 s10, s12
4810 ; GFX11-NEXT: s_mov_b32 s12, s14
4811 ; GFX11-NEXT: s_mov_b32 s14, s16
4812 ; GFX11-NEXT: s_mov_b32 s16, s18
4813 ; GFX11-NEXT: s_mov_b32 s18, s20
4814 ; GFX11-NEXT: s_mov_b32 s20, s22
4815 ; GFX11-NEXT: s_mov_b32 s22, s24
4816 ; GFX11-NEXT: s_mov_b32 s24, s26
4817 ; GFX11-NEXT: s_mov_b32 s26, s28
4818 ; GFX11-NEXT: s_mov_b32 s28, s30
4819 ; GFX11-NEXT: s_mov_b32 s30, s32
4820 ; GFX11-NEXT: v_dual_mov_b32 v33, s31 :: v_dual_mov_b32 v32, s30
4821 ; GFX11-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
4822 ; GFX11-NEXT: s_lshl_b32 m0, s34, 1
4823 ; GFX11-NEXT: v_dual_mov_b32 v31, s29 :: v_dual_mov_b32 v30, s28
4824 ; GFX11-NEXT: v_dual_mov_b32 v29, s27 :: v_dual_mov_b32 v28, s26
4825 ; GFX11-NEXT: v_dual_mov_b32 v27, s25 :: v_dual_mov_b32 v26, s24
4826 ; GFX11-NEXT: v_dual_mov_b32 v25, s23 :: v_dual_mov_b32 v24, s22
4827 ; GFX11-NEXT: v_dual_mov_b32 v23, s21 :: v_dual_mov_b32 v22, s20
4828 ; GFX11-NEXT: v_dual_mov_b32 v21, s19 :: v_dual_mov_b32 v20, s18
4829 ; GFX11-NEXT: v_dual_mov_b32 v19, s17 :: v_dual_mov_b32 v18, s16
4830 ; GFX11-NEXT: v_dual_mov_b32 v17, s15 :: v_dual_mov_b32 v16, s14
4831 ; GFX11-NEXT: v_dual_mov_b32 v15, s13 :: v_dual_mov_b32 v14, s12
4832 ; GFX11-NEXT: v_dual_mov_b32 v13, s11 :: v_dual_mov_b32 v12, s10
4833 ; GFX11-NEXT: v_dual_mov_b32 v11, s9 :: v_dual_mov_b32 v10, s8
4834 ; GFX11-NEXT: v_dual_mov_b32 v9, s7 :: v_dual_mov_b32 v8, s6
4835 ; GFX11-NEXT: v_dual_mov_b32 v7, s5 :: v_dual_mov_b32 v6, s4
4836 ; GFX11-NEXT: v_dual_mov_b32 v5, s3 :: v_dual_mov_b32 v4, s2
4837 ; GFX11-NEXT: v_movreld_b32_e32 v2, v0
4838 ; GFX11-NEXT: v_movreld_b32_e32 v3, v1
4839 ; GFX11-NEXT: v_readfirstlane_b32 s0, v2
4840 ; GFX11-NEXT: v_readfirstlane_b32 s1, v3
4841 ; GFX11-NEXT: v_readfirstlane_b32 s2, v4
4842 ; GFX11-NEXT: v_readfirstlane_b32 s3, v5
4843 ; GFX11-NEXT: v_readfirstlane_b32 s4, v6
4844 ; GFX11-NEXT: v_readfirstlane_b32 s5, v7
4845 ; GFX11-NEXT: v_readfirstlane_b32 s6, v8
4846 ; GFX11-NEXT: v_readfirstlane_b32 s7, v9
4847 ; GFX11-NEXT: v_readfirstlane_b32 s8, v10
4848 ; GFX11-NEXT: v_readfirstlane_b32 s9, v11
4849 ; GFX11-NEXT: v_readfirstlane_b32 s10, v12
4850 ; GFX11-NEXT: v_readfirstlane_b32 s11, v13
4851 ; GFX11-NEXT: v_readfirstlane_b32 s12, v14
4852 ; GFX11-NEXT: v_readfirstlane_b32 s13, v15
4853 ; GFX11-NEXT: v_readfirstlane_b32 s14, v16
4854 ; GFX11-NEXT: v_readfirstlane_b32 s15, v17
4855 ; GFX11-NEXT: v_readfirstlane_b32 s16, v18
4856 ; GFX11-NEXT: v_readfirstlane_b32 s17, v19
4857 ; GFX11-NEXT: v_readfirstlane_b32 s18, v20
4858 ; GFX11-NEXT: v_readfirstlane_b32 s19, v21
4859 ; GFX11-NEXT: v_readfirstlane_b32 s20, v22
4860 ; GFX11-NEXT: v_readfirstlane_b32 s21, v23
4861 ; GFX11-NEXT: v_readfirstlane_b32 s22, v24
4862 ; GFX11-NEXT: v_readfirstlane_b32 s23, v25
4863 ; GFX11-NEXT: v_readfirstlane_b32 s24, v26
4864 ; GFX11-NEXT: v_readfirstlane_b32 s25, v27
4865 ; GFX11-NEXT: v_readfirstlane_b32 s26, v28
4866 ; GFX11-NEXT: v_readfirstlane_b32 s27, v29
4867 ; GFX11-NEXT: v_readfirstlane_b32 s28, v30
4868 ; GFX11-NEXT: v_readfirstlane_b32 s29, v31
4869 ; GFX11-NEXT: v_readfirstlane_b32 s30, v32
4870 ; GFX11-NEXT: v_readfirstlane_b32 s31, v33
4871 ; GFX11-NEXT: ; return to shader part epilog
4873 %insert = insertelement <16 x i64> %vec, i64 %val, i32 %idx
4874 ret <16 x i64> %insert
4877 define amdgpu_ps <16 x double> @dyn_insertelement_v16f64_s_v_s(<16 x double> inreg %vec, double %val, i32 inreg %idx) {
4878 ; GPRIDX-LABEL: dyn_insertelement_v16f64_s_v_s:
4879 ; GPRIDX: ; %bb.0: ; %entry
4880 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4881 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4882 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4883 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4884 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4885 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4886 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4887 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4888 ; GPRIDX-NEXT: s_mov_b32 s17, s19
4889 ; GPRIDX-NEXT: s_mov_b32 s19, s21
4890 ; GPRIDX-NEXT: s_mov_b32 s21, s23
4891 ; GPRIDX-NEXT: s_mov_b32 s23, s25
4892 ; GPRIDX-NEXT: s_mov_b32 s25, s27
4893 ; GPRIDX-NEXT: s_mov_b32 s27, s29
4894 ; GPRIDX-NEXT: s_mov_b32 s29, s31
4895 ; GPRIDX-NEXT: s_mov_b32 s31, s33
4896 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4897 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4898 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4899 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4900 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4901 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4902 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4903 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4904 ; GPRIDX-NEXT: s_mov_b32 s16, s18
4905 ; GPRIDX-NEXT: s_mov_b32 s18, s20
4906 ; GPRIDX-NEXT: s_mov_b32 s20, s22
4907 ; GPRIDX-NEXT: s_mov_b32 s22, s24
4908 ; GPRIDX-NEXT: s_mov_b32 s24, s26
4909 ; GPRIDX-NEXT: s_mov_b32 s26, s28
4910 ; GPRIDX-NEXT: s_mov_b32 s28, s30
4911 ; GPRIDX-NEXT: s_mov_b32 s30, s32
4912 ; GPRIDX-NEXT: v_mov_b32_e32 v33, s31
4913 ; GPRIDX-NEXT: s_lshl_b32 s33, s34, 1
4914 ; GPRIDX-NEXT: v_mov_b32_e32 v32, s30
4915 ; GPRIDX-NEXT: v_mov_b32_e32 v31, s29
4916 ; GPRIDX-NEXT: v_mov_b32_e32 v30, s28
4917 ; GPRIDX-NEXT: v_mov_b32_e32 v29, s27
4918 ; GPRIDX-NEXT: v_mov_b32_e32 v28, s26
4919 ; GPRIDX-NEXT: v_mov_b32_e32 v27, s25
4920 ; GPRIDX-NEXT: v_mov_b32_e32 v26, s24
4921 ; GPRIDX-NEXT: v_mov_b32_e32 v25, s23
4922 ; GPRIDX-NEXT: v_mov_b32_e32 v24, s22
4923 ; GPRIDX-NEXT: v_mov_b32_e32 v23, s21
4924 ; GPRIDX-NEXT: v_mov_b32_e32 v22, s20
4925 ; GPRIDX-NEXT: v_mov_b32_e32 v21, s19
4926 ; GPRIDX-NEXT: v_mov_b32_e32 v20, s18
4927 ; GPRIDX-NEXT: v_mov_b32_e32 v19, s17
4928 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s16
4929 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s15
4930 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s14
4931 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s13
4932 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s12
4933 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s11
4934 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s10
4935 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
4936 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
4937 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s7
4938 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s6
4939 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s5
4940 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s4
4941 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s3
4942 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s2
4943 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s1
4944 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s0
4945 ; GPRIDX-NEXT: s_set_gpr_idx_on s33, gpr_idx(DST)
4946 ; GPRIDX-NEXT: v_mov_b32_e32 v2, v0
4947 ; GPRIDX-NEXT: v_mov_b32_e32 v3, v1
4948 ; GPRIDX-NEXT: s_set_gpr_idx_off
4949 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v2
4950 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v3
4951 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v4
4952 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v5
4953 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v6
4954 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v7
4955 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v8
4956 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v9
4957 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v10
4958 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v11
4959 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v12
4960 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v13
4961 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v14
4962 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v15
4963 ; GPRIDX-NEXT: v_readfirstlane_b32 s14, v16
4964 ; GPRIDX-NEXT: v_readfirstlane_b32 s15, v17
4965 ; GPRIDX-NEXT: v_readfirstlane_b32 s16, v18
4966 ; GPRIDX-NEXT: v_readfirstlane_b32 s17, v19
4967 ; GPRIDX-NEXT: v_readfirstlane_b32 s18, v20
4968 ; GPRIDX-NEXT: v_readfirstlane_b32 s19, v21
4969 ; GPRIDX-NEXT: v_readfirstlane_b32 s20, v22
4970 ; GPRIDX-NEXT: v_readfirstlane_b32 s21, v23
4971 ; GPRIDX-NEXT: v_readfirstlane_b32 s22, v24
4972 ; GPRIDX-NEXT: v_readfirstlane_b32 s23, v25
4973 ; GPRIDX-NEXT: v_readfirstlane_b32 s24, v26
4974 ; GPRIDX-NEXT: v_readfirstlane_b32 s25, v27
4975 ; GPRIDX-NEXT: v_readfirstlane_b32 s26, v28
4976 ; GPRIDX-NEXT: v_readfirstlane_b32 s27, v29
4977 ; GPRIDX-NEXT: v_readfirstlane_b32 s28, v30
4978 ; GPRIDX-NEXT: v_readfirstlane_b32 s29, v31
4979 ; GPRIDX-NEXT: v_readfirstlane_b32 s30, v32
4980 ; GPRIDX-NEXT: v_readfirstlane_b32 s31, v33
4981 ; GPRIDX-NEXT: ; return to shader part epilog
4983 ; GFX10-LABEL: dyn_insertelement_v16f64_s_v_s:
4984 ; GFX10: ; %bb.0: ; %entry
4985 ; GFX10-NEXT: s_mov_b32 s1, s3
4986 ; GFX10-NEXT: s_mov_b32 s3, s5
4987 ; GFX10-NEXT: s_mov_b32 s5, s7
4988 ; GFX10-NEXT: s_mov_b32 s7, s9
4989 ; GFX10-NEXT: s_mov_b32 s9, s11
4990 ; GFX10-NEXT: s_mov_b32 s11, s13
4991 ; GFX10-NEXT: s_mov_b32 s13, s15
4992 ; GFX10-NEXT: s_mov_b32 s15, s17
4993 ; GFX10-NEXT: s_mov_b32 s17, s19
4994 ; GFX10-NEXT: s_mov_b32 s19, s21
4995 ; GFX10-NEXT: s_mov_b32 s21, s23
4996 ; GFX10-NEXT: s_mov_b32 s23, s25
4997 ; GFX10-NEXT: s_mov_b32 s25, s27
4998 ; GFX10-NEXT: s_mov_b32 s27, s29
4999 ; GFX10-NEXT: s_mov_b32 s29, s31
5000 ; GFX10-NEXT: s_mov_b32 s31, s33
5001 ; GFX10-NEXT: s_mov_b32 s0, s2
5002 ; GFX10-NEXT: s_mov_b32 s2, s4
5003 ; GFX10-NEXT: s_mov_b32 s4, s6
5004 ; GFX10-NEXT: s_mov_b32 s6, s8
5005 ; GFX10-NEXT: s_mov_b32 s8, s10
5006 ; GFX10-NEXT: s_mov_b32 s10, s12
5007 ; GFX10-NEXT: s_mov_b32 s12, s14
5008 ; GFX10-NEXT: s_mov_b32 s14, s16
5009 ; GFX10-NEXT: s_mov_b32 s16, s18
5010 ; GFX10-NEXT: s_mov_b32 s18, s20
5011 ; GFX10-NEXT: s_mov_b32 s20, s22
5012 ; GFX10-NEXT: s_mov_b32 s22, s24
5013 ; GFX10-NEXT: s_mov_b32 s24, s26
5014 ; GFX10-NEXT: s_mov_b32 s26, s28
5015 ; GFX10-NEXT: s_mov_b32 s28, s30
5016 ; GFX10-NEXT: s_mov_b32 s30, s32
5017 ; GFX10-NEXT: v_mov_b32_e32 v33, s31
5018 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
5019 ; GFX10-NEXT: s_lshl_b32 m0, s34, 1
5020 ; GFX10-NEXT: v_mov_b32_e32 v32, s30
5021 ; GFX10-NEXT: v_mov_b32_e32 v31, s29
5022 ; GFX10-NEXT: v_mov_b32_e32 v30, s28
5023 ; GFX10-NEXT: v_mov_b32_e32 v29, s27
5024 ; GFX10-NEXT: v_mov_b32_e32 v28, s26
5025 ; GFX10-NEXT: v_mov_b32_e32 v27, s25
5026 ; GFX10-NEXT: v_mov_b32_e32 v26, s24
5027 ; GFX10-NEXT: v_mov_b32_e32 v25, s23
5028 ; GFX10-NEXT: v_mov_b32_e32 v24, s22
5029 ; GFX10-NEXT: v_mov_b32_e32 v23, s21
5030 ; GFX10-NEXT: v_mov_b32_e32 v22, s20
5031 ; GFX10-NEXT: v_mov_b32_e32 v21, s19
5032 ; GFX10-NEXT: v_mov_b32_e32 v20, s18
5033 ; GFX10-NEXT: v_mov_b32_e32 v19, s17
5034 ; GFX10-NEXT: v_mov_b32_e32 v18, s16
5035 ; GFX10-NEXT: v_mov_b32_e32 v17, s15
5036 ; GFX10-NEXT: v_mov_b32_e32 v16, s14
5037 ; GFX10-NEXT: v_mov_b32_e32 v15, s13
5038 ; GFX10-NEXT: v_mov_b32_e32 v14, s12
5039 ; GFX10-NEXT: v_mov_b32_e32 v13, s11
5040 ; GFX10-NEXT: v_mov_b32_e32 v12, s10
5041 ; GFX10-NEXT: v_mov_b32_e32 v11, s9
5042 ; GFX10-NEXT: v_mov_b32_e32 v10, s8
5043 ; GFX10-NEXT: v_mov_b32_e32 v9, s7
5044 ; GFX10-NEXT: v_mov_b32_e32 v8, s6
5045 ; GFX10-NEXT: v_mov_b32_e32 v7, s5
5046 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
5047 ; GFX10-NEXT: v_mov_b32_e32 v5, s3
5048 ; GFX10-NEXT: v_mov_b32_e32 v4, s2
5049 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
5050 ; GFX10-NEXT: v_movreld_b32_e32 v2, v0
5051 ; GFX10-NEXT: v_movreld_b32_e32 v3, v1
5052 ; GFX10-NEXT: v_readfirstlane_b32 s0, v2
5053 ; GFX10-NEXT: v_readfirstlane_b32 s1, v3
5054 ; GFX10-NEXT: v_readfirstlane_b32 s2, v4
5055 ; GFX10-NEXT: v_readfirstlane_b32 s3, v5
5056 ; GFX10-NEXT: v_readfirstlane_b32 s4, v6
5057 ; GFX10-NEXT: v_readfirstlane_b32 s5, v7
5058 ; GFX10-NEXT: v_readfirstlane_b32 s6, v8
5059 ; GFX10-NEXT: v_readfirstlane_b32 s7, v9
5060 ; GFX10-NEXT: v_readfirstlane_b32 s8, v10
5061 ; GFX10-NEXT: v_readfirstlane_b32 s9, v11
5062 ; GFX10-NEXT: v_readfirstlane_b32 s10, v12
5063 ; GFX10-NEXT: v_readfirstlane_b32 s11, v13
5064 ; GFX10-NEXT: v_readfirstlane_b32 s12, v14
5065 ; GFX10-NEXT: v_readfirstlane_b32 s13, v15
5066 ; GFX10-NEXT: v_readfirstlane_b32 s14, v16
5067 ; GFX10-NEXT: v_readfirstlane_b32 s15, v17
5068 ; GFX10-NEXT: v_readfirstlane_b32 s16, v18
5069 ; GFX10-NEXT: v_readfirstlane_b32 s17, v19
5070 ; GFX10-NEXT: v_readfirstlane_b32 s18, v20
5071 ; GFX10-NEXT: v_readfirstlane_b32 s19, v21
5072 ; GFX10-NEXT: v_readfirstlane_b32 s20, v22
5073 ; GFX10-NEXT: v_readfirstlane_b32 s21, v23
5074 ; GFX10-NEXT: v_readfirstlane_b32 s22, v24
5075 ; GFX10-NEXT: v_readfirstlane_b32 s23, v25
5076 ; GFX10-NEXT: v_readfirstlane_b32 s24, v26
5077 ; GFX10-NEXT: v_readfirstlane_b32 s25, v27
5078 ; GFX10-NEXT: v_readfirstlane_b32 s26, v28
5079 ; GFX10-NEXT: v_readfirstlane_b32 s27, v29
5080 ; GFX10-NEXT: v_readfirstlane_b32 s28, v30
5081 ; GFX10-NEXT: v_readfirstlane_b32 s29, v31
5082 ; GFX10-NEXT: v_readfirstlane_b32 s30, v32
5083 ; GFX10-NEXT: v_readfirstlane_b32 s31, v33
5084 ; GFX10-NEXT: ; return to shader part epilog
5086 ; GFX11-LABEL: dyn_insertelement_v16f64_s_v_s:
5087 ; GFX11: ; %bb.0: ; %entry
5088 ; GFX11-NEXT: s_mov_b32 s1, s3
5089 ; GFX11-NEXT: s_mov_b32 s3, s5
5090 ; GFX11-NEXT: s_mov_b32 s5, s7
5091 ; GFX11-NEXT: s_mov_b32 s7, s9
5092 ; GFX11-NEXT: s_mov_b32 s9, s11
5093 ; GFX11-NEXT: s_mov_b32 s11, s13
5094 ; GFX11-NEXT: s_mov_b32 s13, s15
5095 ; GFX11-NEXT: s_mov_b32 s15, s17
5096 ; GFX11-NEXT: s_mov_b32 s17, s19
5097 ; GFX11-NEXT: s_mov_b32 s19, s21
5098 ; GFX11-NEXT: s_mov_b32 s21, s23
5099 ; GFX11-NEXT: s_mov_b32 s23, s25
5100 ; GFX11-NEXT: s_mov_b32 s25, s27
5101 ; GFX11-NEXT: s_mov_b32 s27, s29
5102 ; GFX11-NEXT: s_mov_b32 s29, s31
5103 ; GFX11-NEXT: s_mov_b32 s31, s33
5104 ; GFX11-NEXT: s_mov_b32 s0, s2
5105 ; GFX11-NEXT: s_mov_b32 s2, s4
5106 ; GFX11-NEXT: s_mov_b32 s4, s6
5107 ; GFX11-NEXT: s_mov_b32 s6, s8
5108 ; GFX11-NEXT: s_mov_b32 s8, s10
5109 ; GFX11-NEXT: s_mov_b32 s10, s12
5110 ; GFX11-NEXT: s_mov_b32 s12, s14
5111 ; GFX11-NEXT: s_mov_b32 s14, s16
5112 ; GFX11-NEXT: s_mov_b32 s16, s18
5113 ; GFX11-NEXT: s_mov_b32 s18, s20
5114 ; GFX11-NEXT: s_mov_b32 s20, s22
5115 ; GFX11-NEXT: s_mov_b32 s22, s24
5116 ; GFX11-NEXT: s_mov_b32 s24, s26
5117 ; GFX11-NEXT: s_mov_b32 s26, s28
5118 ; GFX11-NEXT: s_mov_b32 s28, s30
5119 ; GFX11-NEXT: s_mov_b32 s30, s32
5120 ; GFX11-NEXT: v_dual_mov_b32 v33, s31 :: v_dual_mov_b32 v32, s30
5121 ; GFX11-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
5122 ; GFX11-NEXT: s_lshl_b32 m0, s34, 1
5123 ; GFX11-NEXT: v_dual_mov_b32 v31, s29 :: v_dual_mov_b32 v30, s28
5124 ; GFX11-NEXT: v_dual_mov_b32 v29, s27 :: v_dual_mov_b32 v28, s26
5125 ; GFX11-NEXT: v_dual_mov_b32 v27, s25 :: v_dual_mov_b32 v26, s24
5126 ; GFX11-NEXT: v_dual_mov_b32 v25, s23 :: v_dual_mov_b32 v24, s22
5127 ; GFX11-NEXT: v_dual_mov_b32 v23, s21 :: v_dual_mov_b32 v22, s20
5128 ; GFX11-NEXT: v_dual_mov_b32 v21, s19 :: v_dual_mov_b32 v20, s18
5129 ; GFX11-NEXT: v_dual_mov_b32 v19, s17 :: v_dual_mov_b32 v18, s16
5130 ; GFX11-NEXT: v_dual_mov_b32 v17, s15 :: v_dual_mov_b32 v16, s14
5131 ; GFX11-NEXT: v_dual_mov_b32 v15, s13 :: v_dual_mov_b32 v14, s12
5132 ; GFX11-NEXT: v_dual_mov_b32 v13, s11 :: v_dual_mov_b32 v12, s10
5133 ; GFX11-NEXT: v_dual_mov_b32 v11, s9 :: v_dual_mov_b32 v10, s8
5134 ; GFX11-NEXT: v_dual_mov_b32 v9, s7 :: v_dual_mov_b32 v8, s6
5135 ; GFX11-NEXT: v_dual_mov_b32 v7, s5 :: v_dual_mov_b32 v6, s4
5136 ; GFX11-NEXT: v_dual_mov_b32 v5, s3 :: v_dual_mov_b32 v4, s2
5137 ; GFX11-NEXT: v_movreld_b32_e32 v2, v0
5138 ; GFX11-NEXT: v_movreld_b32_e32 v3, v1
5139 ; GFX11-NEXT: v_readfirstlane_b32 s0, v2
5140 ; GFX11-NEXT: v_readfirstlane_b32 s1, v3
5141 ; GFX11-NEXT: v_readfirstlane_b32 s2, v4
5142 ; GFX11-NEXT: v_readfirstlane_b32 s3, v5
5143 ; GFX11-NEXT: v_readfirstlane_b32 s4, v6
5144 ; GFX11-NEXT: v_readfirstlane_b32 s5, v7
5145 ; GFX11-NEXT: v_readfirstlane_b32 s6, v8
5146 ; GFX11-NEXT: v_readfirstlane_b32 s7, v9
5147 ; GFX11-NEXT: v_readfirstlane_b32 s8, v10
5148 ; GFX11-NEXT: v_readfirstlane_b32 s9, v11
5149 ; GFX11-NEXT: v_readfirstlane_b32 s10, v12
5150 ; GFX11-NEXT: v_readfirstlane_b32 s11, v13
5151 ; GFX11-NEXT: v_readfirstlane_b32 s12, v14
5152 ; GFX11-NEXT: v_readfirstlane_b32 s13, v15
5153 ; GFX11-NEXT: v_readfirstlane_b32 s14, v16
5154 ; GFX11-NEXT: v_readfirstlane_b32 s15, v17
5155 ; GFX11-NEXT: v_readfirstlane_b32 s16, v18
5156 ; GFX11-NEXT: v_readfirstlane_b32 s17, v19
5157 ; GFX11-NEXT: v_readfirstlane_b32 s18, v20
5158 ; GFX11-NEXT: v_readfirstlane_b32 s19, v21
5159 ; GFX11-NEXT: v_readfirstlane_b32 s20, v22
5160 ; GFX11-NEXT: v_readfirstlane_b32 s21, v23
5161 ; GFX11-NEXT: v_readfirstlane_b32 s22, v24
5162 ; GFX11-NEXT: v_readfirstlane_b32 s23, v25
5163 ; GFX11-NEXT: v_readfirstlane_b32 s24, v26
5164 ; GFX11-NEXT: v_readfirstlane_b32 s25, v27
5165 ; GFX11-NEXT: v_readfirstlane_b32 s26, v28
5166 ; GFX11-NEXT: v_readfirstlane_b32 s27, v29
5167 ; GFX11-NEXT: v_readfirstlane_b32 s28, v30
5168 ; GFX11-NEXT: v_readfirstlane_b32 s29, v31
5169 ; GFX11-NEXT: v_readfirstlane_b32 s30, v32
5170 ; GFX11-NEXT: v_readfirstlane_b32 s31, v33
5171 ; GFX11-NEXT: ; return to shader part epilog
5173 %insert = insertelement <16 x double> %vec, double %val, i32 %idx
5174 ret <16 x double> %insert
5177 define amdgpu_ps <7 x i32> @dyn_insertelement_v7i32_s_s_s(<7 x i32> inreg %vec, i32 inreg %val, i32 inreg %idx) {
5178 ; GPRIDX-LABEL: dyn_insertelement_v7i32_s_s_s:
5179 ; GPRIDX: ; %bb.0: ; %entry
5180 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 0
5181 ; GPRIDX-NEXT: s_cselect_b32 s0, s9, s2
5182 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 1
5183 ; GPRIDX-NEXT: s_cselect_b32 s1, s9, s3
5184 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 2
5185 ; GPRIDX-NEXT: s_cselect_b32 s2, s9, s4
5186 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 3
5187 ; GPRIDX-NEXT: s_cselect_b32 s3, s9, s5
5188 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 4
5189 ; GPRIDX-NEXT: s_cselect_b32 s4, s9, s6
5190 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 5
5191 ; GPRIDX-NEXT: s_cselect_b32 s5, s9, s7
5192 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 6
5193 ; GPRIDX-NEXT: s_cselect_b32 s6, s9, s8
5194 ; GPRIDX-NEXT: ; return to shader part epilog
5196 ; GFX10PLUS-LABEL: dyn_insertelement_v7i32_s_s_s:
5197 ; GFX10PLUS: ; %bb.0: ; %entry
5198 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 0
5199 ; GFX10PLUS-NEXT: s_cselect_b32 s0, s9, s2
5200 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 1
5201 ; GFX10PLUS-NEXT: s_cselect_b32 s1, s9, s3
5202 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 2
5203 ; GFX10PLUS-NEXT: s_cselect_b32 s2, s9, s4
5204 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 3
5205 ; GFX10PLUS-NEXT: s_cselect_b32 s3, s9, s5
5206 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 4
5207 ; GFX10PLUS-NEXT: s_cselect_b32 s4, s9, s6
5208 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 5
5209 ; GFX10PLUS-NEXT: s_cselect_b32 s5, s9, s7
5210 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 6
5211 ; GFX10PLUS-NEXT: s_cselect_b32 s6, s9, s8
5212 ; GFX10PLUS-NEXT: ; return to shader part epilog
5214 %insert = insertelement <7 x i32> %vec, i32 %val, i32 %idx
5215 ret <7 x i32> %insert
5218 define amdgpu_ps <7 x ptr addrspace(3)> @dyn_insertelement_v7p3i8_s_s_s(<7 x ptr addrspace(3)> inreg %vec, ptr addrspace(3) inreg %val, i32 inreg %idx) {
5219 ; GPRIDX-LABEL: dyn_insertelement_v7p3i8_s_s_s:
5220 ; GPRIDX: ; %bb.0: ; %entry
5221 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 0
5222 ; GPRIDX-NEXT: s_cselect_b32 s0, s9, s2
5223 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 1
5224 ; GPRIDX-NEXT: s_cselect_b32 s1, s9, s3
5225 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 2
5226 ; GPRIDX-NEXT: s_cselect_b32 s2, s9, s4
5227 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 3
5228 ; GPRIDX-NEXT: s_cselect_b32 s3, s9, s5
5229 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 4
5230 ; GPRIDX-NEXT: s_cselect_b32 s4, s9, s6
5231 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 5
5232 ; GPRIDX-NEXT: s_cselect_b32 s5, s9, s7
5233 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 6
5234 ; GPRIDX-NEXT: s_cselect_b32 s6, s9, s8
5235 ; GPRIDX-NEXT: ; return to shader part epilog
5237 ; GFX10PLUS-LABEL: dyn_insertelement_v7p3i8_s_s_s:
5238 ; GFX10PLUS: ; %bb.0: ; %entry
5239 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 0
5240 ; GFX10PLUS-NEXT: s_cselect_b32 s0, s9, s2
5241 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 1
5242 ; GFX10PLUS-NEXT: s_cselect_b32 s1, s9, s3
5243 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 2
5244 ; GFX10PLUS-NEXT: s_cselect_b32 s2, s9, s4
5245 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 3
5246 ; GFX10PLUS-NEXT: s_cselect_b32 s3, s9, s5
5247 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 4
5248 ; GFX10PLUS-NEXT: s_cselect_b32 s4, s9, s6
5249 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 5
5250 ; GFX10PLUS-NEXT: s_cselect_b32 s5, s9, s7
5251 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 6
5252 ; GFX10PLUS-NEXT: s_cselect_b32 s6, s9, s8
5253 ; GFX10PLUS-NEXT: ; return to shader part epilog
5255 %insert = insertelement <7 x ptr addrspace(3)> %vec, ptr addrspace(3) %val, i32 %idx
5256 ret <7 x ptr addrspace(3)> %insert
5259 define amdgpu_ps <7 x float> @dyn_insertelement_v7f32_s_v_s(<7 x float> inreg %vec, float %val, i32 inreg %idx) {
5260 ; GPRIDX-LABEL: dyn_insertelement_v7f32_s_v_s:
5261 ; GPRIDX: ; %bb.0: ; %entry
5262 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s2
5263 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 0
5264 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s3
5265 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v1, v0, vcc
5266 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 1
5267 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s4
5268 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v2, v0, vcc
5269 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 2
5270 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s5
5271 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v3, v0, vcc
5272 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 3
5273 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s6
5274 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v4, v0, vcc
5275 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 4
5276 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s7
5277 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v5, v0, vcc
5278 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 5
5279 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
5280 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v6, v0, vcc
5281 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 6
5282 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v8, v0, vcc
5283 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v7
5284 ; GPRIDX-NEXT: ; return to shader part epilog
5286 ; GFX10PLUS-LABEL: dyn_insertelement_v7f32_s_v_s:
5287 ; GFX10PLUS: ; %bb.0: ; %entry
5288 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 0
5289 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, s2, v0, vcc_lo
5290 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 1
5291 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, s3, v0, vcc_lo
5292 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 2
5293 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
5294 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 3
5295 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
5296 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 4
5297 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
5298 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 5
5299 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
5300 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 6
5301 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
5302 ; GFX10PLUS-NEXT: v_mov_b32_e32 v0, v7
5303 ; GFX10PLUS-NEXT: ; return to shader part epilog
5305 %insert = insertelement <7 x float> %vec, float %val, i32 %idx
5306 ret <7 x float> %insert
5309 define amdgpu_ps <7 x float> @dyn_insertelement_v7f32_s_v_v(<7 x float> inreg %vec, float %val, i32 %idx) {
5310 ; GPRIDX-LABEL: dyn_insertelement_v7f32_s_v_v:
5311 ; GPRIDX: ; %bb.0: ; %entry
5312 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
5313 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
5314 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
5315 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v2, v0, vcc
5316 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
5317 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
5318 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v3, v0, vcc
5319 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
5320 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
5321 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v4, v0, vcc
5322 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
5323 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
5324 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
5325 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
5326 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s7
5327 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v6, v0, vcc
5328 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
5329 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
5330 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v9, v0, vcc
5331 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
5332 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v10, v0, vcc
5333 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v8
5334 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v7
5335 ; GPRIDX-NEXT: ; return to shader part epilog
5337 ; GFX10-LABEL: dyn_insertelement_v7f32_s_v_v:
5338 ; GFX10: ; %bb.0: ; %entry
5339 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
5340 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s2, v0, vcc_lo
5341 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
5342 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s3, v0, vcc_lo
5343 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
5344 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
5345 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
5346 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
5347 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
5348 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
5349 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
5350 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
5351 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
5352 ; GFX10-NEXT: v_mov_b32_e32 v1, v7
5353 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
5354 ; GFX10-NEXT: v_mov_b32_e32 v0, v8
5355 ; GFX10-NEXT: ; return to shader part epilog
5357 ; GFX11-LABEL: dyn_insertelement_v7f32_s_v_v:
5358 ; GFX11: ; %bb.0: ; %entry
5359 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
5360 ; GFX11-NEXT: v_cndmask_b32_e32 v8, s2, v0, vcc_lo
5361 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
5362 ; GFX11-NEXT: v_cndmask_b32_e32 v7, s3, v0, vcc_lo
5363 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
5364 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
5365 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
5366 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
5367 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
5368 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
5369 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
5370 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
5371 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
5372 ; GFX11-NEXT: v_dual_mov_b32 v1, v7 :: v_dual_cndmask_b32 v6, s8, v0
5373 ; GFX11-NEXT: v_mov_b32_e32 v0, v8
5374 ; GFX11-NEXT: ; return to shader part epilog
5376 %insert = insertelement <7 x float> %vec, float %val, i32 %idx
5377 ret <7 x float> %insert
5380 define amdgpu_ps <7 x float> @dyn_insertelement_v7f32_v_v_s(<7 x float> %vec, float %val, i32 inreg %idx) {
5381 ; GPRIDX-LABEL: dyn_insertelement_v7f32_v_v_s:
5382 ; GPRIDX: ; %bb.0: ; %entry
5383 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 0
5384 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v7, vcc
5385 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 1
5386 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v7, vcc
5387 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 2
5388 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v7, vcc
5389 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 3
5390 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v7, vcc
5391 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 4
5392 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v7, vcc
5393 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 5
5394 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc
5395 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 6
5396 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc
5397 ; GPRIDX-NEXT: ; return to shader part epilog
5399 ; GFX10PLUS-LABEL: dyn_insertelement_v7f32_v_v_s:
5400 ; GFX10PLUS: ; %bb.0: ; %entry
5401 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 0
5402 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v7, vcc_lo
5403 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 1
5404 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v7, vcc_lo
5405 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 2
5406 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v7, vcc_lo
5407 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 3
5408 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v7, vcc_lo
5409 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 4
5410 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v7, vcc_lo
5411 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 5
5412 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc_lo
5413 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 6
5414 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc_lo
5415 ; GFX10PLUS-NEXT: ; return to shader part epilog
5417 %insert = insertelement <7 x float> %vec, float %val, i32 %idx
5418 ret <7 x float> %insert
5421 define amdgpu_ps <7 x float> @dyn_insertelement_v7f32_v_v_v(<7 x float> %vec, float %val, i32 %idx) {
5422 ; GPRIDX-LABEL: dyn_insertelement_v7f32_v_v_v:
5423 ; GPRIDX: ; %bb.0: ; %entry
5424 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v8
5425 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v7, vcc
5426 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v8
5427 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v7, vcc
5428 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v8
5429 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v7, vcc
5430 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v8
5431 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v7, vcc
5432 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v8
5433 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v7, vcc
5434 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v8
5435 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc
5436 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v8
5437 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc
5438 ; GPRIDX-NEXT: ; return to shader part epilog
5440 ; GFX10PLUS-LABEL: dyn_insertelement_v7f32_v_v_v:
5441 ; GFX10PLUS: ; %bb.0: ; %entry
5442 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v8
5443 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v7, vcc_lo
5444 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v8
5445 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v7, vcc_lo
5446 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v8
5447 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v7, vcc_lo
5448 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v8
5449 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v7, vcc_lo
5450 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v8
5451 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v7, vcc_lo
5452 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v8
5453 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc_lo
5454 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v8
5455 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc_lo
5456 ; GFX10PLUS-NEXT: ; return to shader part epilog
5458 %insert = insertelement <7 x float> %vec, float %val, i32 %idx
5459 ret <7 x float> %insert
5462 define amdgpu_ps <7 x double> @dyn_insertelement_v7f64_s_s_s(<7 x double> inreg %vec, double inreg %val, i32 inreg %idx) {
5463 ; GPRIDX-LABEL: dyn_insertelement_v7f64_s_s_s:
5464 ; GPRIDX: ; %bb.0: ; %entry
5465 ; GPRIDX-NEXT: s_mov_b32 s0, s2
5466 ; GPRIDX-NEXT: s_mov_b32 s1, s3
5467 ; GPRIDX-NEXT: s_mov_b32 s2, s4
5468 ; GPRIDX-NEXT: s_mov_b32 s3, s5
5469 ; GPRIDX-NEXT: s_mov_b32 s4, s6
5470 ; GPRIDX-NEXT: s_mov_b32 s5, s7
5471 ; GPRIDX-NEXT: s_mov_b32 s6, s8
5472 ; GPRIDX-NEXT: s_mov_b32 s7, s9
5473 ; GPRIDX-NEXT: s_mov_b32 s8, s10
5474 ; GPRIDX-NEXT: s_mov_b32 s9, s11
5475 ; GPRIDX-NEXT: s_mov_b32 s10, s12
5476 ; GPRIDX-NEXT: s_mov_b32 s11, s13
5477 ; GPRIDX-NEXT: s_mov_b32 s12, s14
5478 ; GPRIDX-NEXT: s_mov_b32 s13, s15
5479 ; GPRIDX-NEXT: s_mov_b32 m0, s18
5480 ; GPRIDX-NEXT: s_nop 0
5481 ; GPRIDX-NEXT: s_movreld_b64 s[0:1], s[16:17]
5482 ; GPRIDX-NEXT: ; return to shader part epilog
5484 ; GFX10PLUS-LABEL: dyn_insertelement_v7f64_s_s_s:
5485 ; GFX10PLUS: ; %bb.0: ; %entry
5486 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
5487 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
5488 ; GFX10PLUS-NEXT: s_mov_b32 m0, s18
5489 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
5490 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
5491 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
5492 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
5493 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
5494 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
5495 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
5496 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
5497 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
5498 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
5499 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
5500 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
5501 ; GFX10PLUS-NEXT: s_movreld_b64 s[0:1], s[16:17]
5502 ; GFX10PLUS-NEXT: ; return to shader part epilog
5504 %insert = insertelement <7 x double> %vec, double %val, i32 %idx
5505 ret <7 x double> %insert
5508 define amdgpu_ps <7 x double> @dyn_insertelement_v7f64_s_v_s(<7 x double> inreg %vec, double %val, i32 inreg %idx) {
5509 ; GPRIDX-LABEL: dyn_insertelement_v7f64_s_v_s:
5510 ; GPRIDX: ; %bb.0: ; %entry
5511 ; GPRIDX-NEXT: s_mov_b32 s0, s2
5512 ; GPRIDX-NEXT: s_mov_b32 s1, s3
5513 ; GPRIDX-NEXT: s_mov_b32 s2, s4
5514 ; GPRIDX-NEXT: s_mov_b32 s3, s5
5515 ; GPRIDX-NEXT: s_mov_b32 s4, s6
5516 ; GPRIDX-NEXT: s_mov_b32 s5, s7
5517 ; GPRIDX-NEXT: s_mov_b32 s6, s8
5518 ; GPRIDX-NEXT: s_mov_b32 s7, s9
5519 ; GPRIDX-NEXT: s_mov_b32 s8, s10
5520 ; GPRIDX-NEXT: s_mov_b32 s9, s11
5521 ; GPRIDX-NEXT: s_mov_b32 s10, s12
5522 ; GPRIDX-NEXT: s_mov_b32 s11, s13
5523 ; GPRIDX-NEXT: s_mov_b32 s12, s14
5524 ; GPRIDX-NEXT: s_mov_b32 s13, s15
5525 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s15
5526 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s14
5527 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s13
5528 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s12
5529 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s11
5530 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s10
5531 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
5532 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
5533 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s7
5534 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s6
5535 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s5
5536 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s4
5537 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s3
5538 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s2
5539 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s1
5540 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s0
5541 ; GPRIDX-NEXT: s_lshl_b32 s0, s16, 1
5542 ; GPRIDX-NEXT: s_set_gpr_idx_on s0, gpr_idx(DST)
5543 ; GPRIDX-NEXT: v_mov_b32_e32 v2, v0
5544 ; GPRIDX-NEXT: v_mov_b32_e32 v3, v1
5545 ; GPRIDX-NEXT: s_set_gpr_idx_off
5546 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v2
5547 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v3
5548 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v4
5549 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v5
5550 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v6
5551 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v7
5552 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v8
5553 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v9
5554 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v10
5555 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v11
5556 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v12
5557 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v13
5558 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v14
5559 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v15
5560 ; GPRIDX-NEXT: ; return to shader part epilog
5562 ; GFX10-LABEL: dyn_insertelement_v7f64_s_v_s:
5563 ; GFX10: ; %bb.0: ; %entry
5564 ; GFX10-NEXT: s_mov_b32 s0, s2
5565 ; GFX10-NEXT: s_mov_b32 s1, s3
5566 ; GFX10-NEXT: s_mov_b32 s2, s4
5567 ; GFX10-NEXT: s_mov_b32 s3, s5
5568 ; GFX10-NEXT: s_mov_b32 s4, s6
5569 ; GFX10-NEXT: s_mov_b32 s5, s7
5570 ; GFX10-NEXT: s_mov_b32 s6, s8
5571 ; GFX10-NEXT: s_mov_b32 s7, s9
5572 ; GFX10-NEXT: s_mov_b32 s8, s10
5573 ; GFX10-NEXT: s_mov_b32 s9, s11
5574 ; GFX10-NEXT: s_mov_b32 s10, s12
5575 ; GFX10-NEXT: s_mov_b32 s11, s13
5576 ; GFX10-NEXT: s_mov_b32 s12, s14
5577 ; GFX10-NEXT: s_mov_b32 s13, s15
5578 ; GFX10-NEXT: v_mov_b32_e32 v17, s15
5579 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
5580 ; GFX10-NEXT: s_lshl_b32 m0, s16, 1
5581 ; GFX10-NEXT: v_mov_b32_e32 v16, s14
5582 ; GFX10-NEXT: v_mov_b32_e32 v15, s13
5583 ; GFX10-NEXT: v_mov_b32_e32 v14, s12
5584 ; GFX10-NEXT: v_mov_b32_e32 v13, s11
5585 ; GFX10-NEXT: v_mov_b32_e32 v12, s10
5586 ; GFX10-NEXT: v_mov_b32_e32 v11, s9
5587 ; GFX10-NEXT: v_mov_b32_e32 v10, s8
5588 ; GFX10-NEXT: v_mov_b32_e32 v9, s7
5589 ; GFX10-NEXT: v_mov_b32_e32 v8, s6
5590 ; GFX10-NEXT: v_mov_b32_e32 v7, s5
5591 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
5592 ; GFX10-NEXT: v_mov_b32_e32 v5, s3
5593 ; GFX10-NEXT: v_mov_b32_e32 v4, s2
5594 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
5595 ; GFX10-NEXT: v_movreld_b32_e32 v2, v0
5596 ; GFX10-NEXT: v_movreld_b32_e32 v3, v1
5597 ; GFX10-NEXT: v_readfirstlane_b32 s0, v2
5598 ; GFX10-NEXT: v_readfirstlane_b32 s1, v3
5599 ; GFX10-NEXT: v_readfirstlane_b32 s2, v4
5600 ; GFX10-NEXT: v_readfirstlane_b32 s3, v5
5601 ; GFX10-NEXT: v_readfirstlane_b32 s4, v6
5602 ; GFX10-NEXT: v_readfirstlane_b32 s5, v7
5603 ; GFX10-NEXT: v_readfirstlane_b32 s6, v8
5604 ; GFX10-NEXT: v_readfirstlane_b32 s7, v9
5605 ; GFX10-NEXT: v_readfirstlane_b32 s8, v10
5606 ; GFX10-NEXT: v_readfirstlane_b32 s9, v11
5607 ; GFX10-NEXT: v_readfirstlane_b32 s10, v12
5608 ; GFX10-NEXT: v_readfirstlane_b32 s11, v13
5609 ; GFX10-NEXT: v_readfirstlane_b32 s12, v14
5610 ; GFX10-NEXT: v_readfirstlane_b32 s13, v15
5611 ; GFX10-NEXT: ; return to shader part epilog
5613 ; GFX11-LABEL: dyn_insertelement_v7f64_s_v_s:
5614 ; GFX11: ; %bb.0: ; %entry
5615 ; GFX11-NEXT: s_mov_b32 s0, s2
5616 ; GFX11-NEXT: s_mov_b32 s1, s3
5617 ; GFX11-NEXT: s_mov_b32 s2, s4
5618 ; GFX11-NEXT: s_mov_b32 s3, s5
5619 ; GFX11-NEXT: s_mov_b32 s4, s6
5620 ; GFX11-NEXT: s_mov_b32 s5, s7
5621 ; GFX11-NEXT: s_mov_b32 s6, s8
5622 ; GFX11-NEXT: s_mov_b32 s7, s9
5623 ; GFX11-NEXT: s_mov_b32 s8, s10
5624 ; GFX11-NEXT: s_mov_b32 s9, s11
5625 ; GFX11-NEXT: s_mov_b32 s10, s12
5626 ; GFX11-NEXT: s_mov_b32 s11, s13
5627 ; GFX11-NEXT: s_mov_b32 s12, s14
5628 ; GFX11-NEXT: s_mov_b32 s13, s15
5629 ; GFX11-NEXT: v_dual_mov_b32 v17, s15 :: v_dual_mov_b32 v16, s14
5630 ; GFX11-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
5631 ; GFX11-NEXT: s_lshl_b32 m0, s16, 1
5632 ; GFX11-NEXT: v_dual_mov_b32 v15, s13 :: v_dual_mov_b32 v14, s12
5633 ; GFX11-NEXT: v_dual_mov_b32 v13, s11 :: v_dual_mov_b32 v12, s10
5634 ; GFX11-NEXT: v_dual_mov_b32 v11, s9 :: v_dual_mov_b32 v10, s8
5635 ; GFX11-NEXT: v_dual_mov_b32 v9, s7 :: v_dual_mov_b32 v8, s6
5636 ; GFX11-NEXT: v_dual_mov_b32 v7, s5 :: v_dual_mov_b32 v6, s4
5637 ; GFX11-NEXT: v_dual_mov_b32 v5, s3 :: v_dual_mov_b32 v4, s2
5638 ; GFX11-NEXT: v_movreld_b32_e32 v2, v0
5639 ; GFX11-NEXT: v_movreld_b32_e32 v3, v1
5640 ; GFX11-NEXT: v_readfirstlane_b32 s0, v2
5641 ; GFX11-NEXT: v_readfirstlane_b32 s1, v3
5642 ; GFX11-NEXT: v_readfirstlane_b32 s2, v4
5643 ; GFX11-NEXT: v_readfirstlane_b32 s3, v5
5644 ; GFX11-NEXT: v_readfirstlane_b32 s4, v6
5645 ; GFX11-NEXT: v_readfirstlane_b32 s5, v7
5646 ; GFX11-NEXT: v_readfirstlane_b32 s6, v8
5647 ; GFX11-NEXT: v_readfirstlane_b32 s7, v9
5648 ; GFX11-NEXT: v_readfirstlane_b32 s8, v10
5649 ; GFX11-NEXT: v_readfirstlane_b32 s9, v11
5650 ; GFX11-NEXT: v_readfirstlane_b32 s10, v12
5651 ; GFX11-NEXT: v_readfirstlane_b32 s11, v13
5652 ; GFX11-NEXT: v_readfirstlane_b32 s12, v14
5653 ; GFX11-NEXT: v_readfirstlane_b32 s13, v15
5654 ; GFX11-NEXT: ; return to shader part epilog
5656 %insert = insertelement <7 x double> %vec, double %val, i32 %idx
5657 ret <7 x double> %insert
5660 define amdgpu_ps <7 x double> @dyn_insertelement_v7f64_s_v_v(<7 x double> inreg %vec, double %val, i32 %idx) {
5661 ; GPRIDX-LABEL: dyn_insertelement_v7f64_s_v_v:
5662 ; GPRIDX: ; %bb.0: ; %entry
5663 ; GPRIDX-NEXT: s_mov_b32 s0, s2
5664 ; GPRIDX-NEXT: s_mov_b32 s1, s3
5665 ; GPRIDX-NEXT: s_mov_b32 s2, s4
5666 ; GPRIDX-NEXT: s_mov_b32 s3, s5
5667 ; GPRIDX-NEXT: s_mov_b32 s4, s6
5668 ; GPRIDX-NEXT: s_mov_b32 s5, s7
5669 ; GPRIDX-NEXT: s_mov_b32 s6, s8
5670 ; GPRIDX-NEXT: s_mov_b32 s7, s9
5671 ; GPRIDX-NEXT: s_mov_b32 s8, s10
5672 ; GPRIDX-NEXT: s_mov_b32 s9, s11
5673 ; GPRIDX-NEXT: s_mov_b32 s10, s12
5674 ; GPRIDX-NEXT: s_mov_b32 s11, s13
5675 ; GPRIDX-NEXT: s_mov_b32 s12, s14
5676 ; GPRIDX-NEXT: s_mov_b32 s13, s15
5677 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s15
5678 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s0
5679 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v2
5680 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s1
5681 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc
5682 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s14
5683 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s13
5684 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s12
5685 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s11
5686 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s10
5687 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s9
5688 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s8
5689 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s7
5690 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s6
5691 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s5
5692 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s4
5693 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s3
5694 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s2
5695 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v3
5696 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v4, v1, vcc
5697 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v2
5698 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v3
5699 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
5700 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v3
5701 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v6, v1, vcc
5702 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v2
5703 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v7, v0, vcc
5704 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v8, v1, vcc
5705 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v2
5706 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v9, v0, vcc
5707 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v10, v1, vcc
5708 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v2
5709 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v11, v0, vcc
5710 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v12, v1, vcc
5711 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v2
5712 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v13, v0, vcc
5713 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v14, v1, vcc
5714 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v2
5715 ; GPRIDX-NEXT: v_cndmask_b32_e32 v12, v15, v0, vcc
5716 ; GPRIDX-NEXT: v_cndmask_b32_e32 v13, v16, v1, vcc
5717 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v3
5718 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v4
5719 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v5
5720 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v6
5721 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v7
5722 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v8
5723 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v9
5724 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v10
5725 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v11
5726 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v12
5727 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v13
5728 ; GPRIDX-NEXT: ; return to shader part epilog
5730 ; GFX10-LABEL: dyn_insertelement_v7f64_s_v_v:
5731 ; GFX10: ; %bb.0: ; %entry
5732 ; GFX10-NEXT: s_mov_b32 s0, s2
5733 ; GFX10-NEXT: s_mov_b32 s1, s3
5734 ; GFX10-NEXT: s_mov_b32 s2, s4
5735 ; GFX10-NEXT: s_mov_b32 s3, s5
5736 ; GFX10-NEXT: s_mov_b32 s4, s6
5737 ; GFX10-NEXT: s_mov_b32 s5, s7
5738 ; GFX10-NEXT: s_mov_b32 s6, s8
5739 ; GFX10-NEXT: s_mov_b32 s7, s9
5740 ; GFX10-NEXT: s_mov_b32 s8, s10
5741 ; GFX10-NEXT: s_mov_b32 s9, s11
5742 ; GFX10-NEXT: s_mov_b32 s10, s12
5743 ; GFX10-NEXT: s_mov_b32 s11, s13
5744 ; GFX10-NEXT: s_mov_b32 s12, s14
5745 ; GFX10-NEXT: s_mov_b32 s13, s15
5746 ; GFX10-NEXT: v_mov_b32_e32 v18, s15
5747 ; GFX10-NEXT: v_mov_b32_e32 v3, s0
5748 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
5749 ; GFX10-NEXT: v_mov_b32_e32 v4, s1
5750 ; GFX10-NEXT: v_mov_b32_e32 v17, s14
5751 ; GFX10-NEXT: v_mov_b32_e32 v16, s13
5752 ; GFX10-NEXT: v_mov_b32_e32 v15, s12
5753 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc_lo
5754 ; GFX10-NEXT: v_mov_b32_e32 v14, s11
5755 ; GFX10-NEXT: v_mov_b32_e32 v13, s10
5756 ; GFX10-NEXT: v_mov_b32_e32 v12, s9
5757 ; GFX10-NEXT: v_mov_b32_e32 v11, s8
5758 ; GFX10-NEXT: v_mov_b32_e32 v10, s7
5759 ; GFX10-NEXT: v_mov_b32_e32 v9, s6
5760 ; GFX10-NEXT: v_mov_b32_e32 v8, s5
5761 ; GFX10-NEXT: v_mov_b32_e32 v7, s4
5762 ; GFX10-NEXT: v_mov_b32_e32 v6, s3
5763 ; GFX10-NEXT: v_mov_b32_e32 v5, s2
5764 ; GFX10-NEXT: v_readfirstlane_b32 s0, v3
5765 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v4, v1, vcc_lo
5766 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v2
5767 ; GFX10-NEXT: v_readfirstlane_b32 s1, v3
5768 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc_lo
5769 ; GFX10-NEXT: v_readfirstlane_b32 s2, v3
5770 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v6, v1, vcc_lo
5771 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
5772 ; GFX10-NEXT: v_readfirstlane_b32 s3, v3
5773 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v7, v0, vcc_lo
5774 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v8, v1, vcc_lo
5775 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v2
5776 ; GFX10-NEXT: v_readfirstlane_b32 s4, v4
5777 ; GFX10-NEXT: v_readfirstlane_b32 s5, v5
5778 ; GFX10-NEXT: v_cndmask_b32_e32 v6, v9, v0, vcc_lo
5779 ; GFX10-NEXT: v_cndmask_b32_e32 v7, v10, v1, vcc_lo
5780 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v2
5781 ; GFX10-NEXT: v_readfirstlane_b32 s6, v6
5782 ; GFX10-NEXT: v_readfirstlane_b32 s7, v7
5783 ; GFX10-NEXT: v_cndmask_b32_e32 v8, v11, v0, vcc_lo
5784 ; GFX10-NEXT: v_cndmask_b32_e32 v9, v12, v1, vcc_lo
5785 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v2
5786 ; GFX10-NEXT: v_readfirstlane_b32 s8, v8
5787 ; GFX10-NEXT: v_readfirstlane_b32 s9, v9
5788 ; GFX10-NEXT: v_cndmask_b32_e32 v10, v13, v0, vcc_lo
5789 ; GFX10-NEXT: v_cndmask_b32_e32 v11, v14, v1, vcc_lo
5790 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v2
5791 ; GFX10-NEXT: v_readfirstlane_b32 s10, v10
5792 ; GFX10-NEXT: v_readfirstlane_b32 s11, v11
5793 ; GFX10-NEXT: v_cndmask_b32_e32 v12, v15, v0, vcc_lo
5794 ; GFX10-NEXT: v_cndmask_b32_e32 v13, v16, v1, vcc_lo
5795 ; GFX10-NEXT: v_readfirstlane_b32 s12, v12
5796 ; GFX10-NEXT: v_readfirstlane_b32 s13, v13
5797 ; GFX10-NEXT: ; return to shader part epilog
5799 ; GFX11-LABEL: dyn_insertelement_v7f64_s_v_v:
5800 ; GFX11: ; %bb.0: ; %entry
5801 ; GFX11-NEXT: s_mov_b32 s0, s2
5802 ; GFX11-NEXT: s_mov_b32 s1, s3
5803 ; GFX11-NEXT: s_mov_b32 s2, s4
5804 ; GFX11-NEXT: s_mov_b32 s3, s5
5805 ; GFX11-NEXT: s_mov_b32 s4, s6
5806 ; GFX11-NEXT: s_mov_b32 s5, s7
5807 ; GFX11-NEXT: s_mov_b32 s6, s8
5808 ; GFX11-NEXT: s_mov_b32 s7, s9
5809 ; GFX11-NEXT: s_mov_b32 s8, s10
5810 ; GFX11-NEXT: s_mov_b32 s9, s11
5811 ; GFX11-NEXT: s_mov_b32 s10, s12
5812 ; GFX11-NEXT: s_mov_b32 s11, s13
5813 ; GFX11-NEXT: s_mov_b32 s12, s14
5814 ; GFX11-NEXT: s_mov_b32 s13, s15
5815 ; GFX11-NEXT: v_dual_mov_b32 v18, s15 :: v_dual_mov_b32 v17, s14
5816 ; GFX11-NEXT: v_dual_mov_b32 v4, s1 :: v_dual_mov_b32 v3, s0
5817 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
5818 ; GFX11-NEXT: v_dual_mov_b32 v16, s13 :: v_dual_mov_b32 v15, s12
5819 ; GFX11-NEXT: v_dual_mov_b32 v14, s11 :: v_dual_mov_b32 v13, s10
5820 ; GFX11-NEXT: v_dual_mov_b32 v12, s9 :: v_dual_mov_b32 v11, s8
5821 ; GFX11-NEXT: v_dual_mov_b32 v10, s7 :: v_dual_mov_b32 v9, s6
5822 ; GFX11-NEXT: v_dual_mov_b32 v8, s5 :: v_dual_mov_b32 v7, s4
5823 ; GFX11-NEXT: v_dual_mov_b32 v6, s3 :: v_dual_mov_b32 v5, s2
5824 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 1, v2
5825 ; GFX11-NEXT: v_dual_cndmask_b32 v18, v3, v0 :: v_dual_cndmask_b32 v17, v4, v1
5826 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
5827 ; GFX11-NEXT: v_cmp_eq_u32_e64 s6, 4, v2
5828 ; GFX11-NEXT: v_cndmask_b32_e64 v3, v5, v0, s0
5829 ; GFX11-NEXT: v_cndmask_b32_e64 v4, v6, v1, s0
5830 ; GFX11-NEXT: v_cmp_eq_u32_e64 s9, 6, v2
5831 ; GFX11-NEXT: v_dual_cndmask_b32 v5, v7, v0 :: v_dual_cndmask_b32 v6, v8, v1
5832 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v2
5833 ; GFX11-NEXT: v_readfirstlane_b32 s0, v18
5834 ; GFX11-NEXT: v_readfirstlane_b32 s1, v17
5835 ; GFX11-NEXT: v_readfirstlane_b32 s2, v3
5836 ; GFX11-NEXT: v_readfirstlane_b32 s3, v4
5837 ; GFX11-NEXT: v_dual_cndmask_b32 v7, v9, v0 :: v_dual_cndmask_b32 v8, v10, v1
5838 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v2
5839 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v11, v0, s6
5840 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v12, v1, s6
5841 ; GFX11-NEXT: v_readfirstlane_b32 s4, v5
5842 ; GFX11-NEXT: v_readfirstlane_b32 s5, v6
5843 ; GFX11-NEXT: v_dual_cndmask_b32 v11, v13, v0 :: v_dual_cndmask_b32 v12, v14, v1
5844 ; GFX11-NEXT: v_cndmask_b32_e64 v14, v15, v0, s9
5845 ; GFX11-NEXT: v_cndmask_b32_e64 v13, v16, v1, s9
5846 ; GFX11-NEXT: v_readfirstlane_b32 s6, v7
5847 ; GFX11-NEXT: v_readfirstlane_b32 s7, v8
5848 ; GFX11-NEXT: v_readfirstlane_b32 s8, v10
5849 ; GFX11-NEXT: v_readfirstlane_b32 s9, v9
5850 ; GFX11-NEXT: v_readfirstlane_b32 s10, v11
5851 ; GFX11-NEXT: v_readfirstlane_b32 s11, v12
5852 ; GFX11-NEXT: v_readfirstlane_b32 s12, v14
5853 ; GFX11-NEXT: v_readfirstlane_b32 s13, v13
5854 ; GFX11-NEXT: ; return to shader part epilog
5856 %insert = insertelement <7 x double> %vec, double %val, i32 %idx
5857 ret <7 x double> %insert
5860 define amdgpu_ps <7 x double> @dyn_insertelement_v7f64_v_v_s(<7 x double> %vec, double %val, i32 inreg %idx) {
5861 ; GPRIDX-LABEL: dyn_insertelement_v7f64_v_v_s:
5862 ; GPRIDX: ; %bb.0: ; %entry
5863 ; GPRIDX-NEXT: s_lshl_b32 s0, s2, 1
5864 ; GPRIDX-NEXT: v_mov_b32_e32 v16, v15
5865 ; GPRIDX-NEXT: s_set_gpr_idx_on s0, gpr_idx(DST)
5866 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v14
5867 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v16
5868 ; GPRIDX-NEXT: s_set_gpr_idx_off
5869 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v0
5870 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v1
5871 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v2
5872 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v3
5873 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v4
5874 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v5
5875 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v6
5876 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v7
5877 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v8
5878 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v9
5879 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v10
5880 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v11
5881 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v12
5882 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v13
5883 ; GPRIDX-NEXT: ; return to shader part epilog
5885 ; GFX10PLUS-LABEL: dyn_insertelement_v7f64_v_v_s:
5886 ; GFX10PLUS: ; %bb.0: ; %entry
5887 ; GFX10PLUS-NEXT: v_mov_b32_e32 v16, v15
5888 ; GFX10PLUS-NEXT: s_lshl_b32 m0, s2, 1
5889 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v14
5890 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v1, v16
5891 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s0, v0
5892 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s1, v1
5893 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s2, v2
5894 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s3, v3
5895 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s4, v4
5896 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s5, v5
5897 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s6, v6
5898 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s7, v7
5899 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s8, v8
5900 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s9, v9
5901 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s10, v10
5902 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s11, v11
5903 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s12, v12
5904 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s13, v13
5905 ; GFX10PLUS-NEXT: ; return to shader part epilog
5907 %insert = insertelement <7 x double> %vec, double %val, i32 %idx
5908 ret <7 x double> %insert
5911 define amdgpu_ps <7 x double> @dyn_insertelement_v7f64_v_v_v(<7 x double> %vec, double %val, i32 %idx) {
5912 ; GPRIDX-LABEL: dyn_insertelement_v7f64_v_v_v:
5913 ; GPRIDX: ; %bb.0: ; %entry
5914 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v16
5915 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v14, vcc
5916 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v15, vcc
5917 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v16
5918 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v14, vcc
5919 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v15, vcc
5920 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v16
5921 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v14, vcc
5922 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v15, vcc
5923 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v16
5924 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v14, vcc
5925 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v15, vcc
5926 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v16
5927 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v14, vcc
5928 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v15, vcc
5929 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v16
5930 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v10, v14, vcc
5931 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v11, v15, vcc
5932 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v16
5933 ; GPRIDX-NEXT: v_cndmask_b32_e32 v12, v12, v14, vcc
5934 ; GPRIDX-NEXT: v_cndmask_b32_e32 v13, v13, v15, vcc
5935 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v0
5936 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v1
5937 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v2
5938 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v3
5939 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v4
5940 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v5
5941 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v6
5942 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v7
5943 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v8
5944 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v9
5945 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v10
5946 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v11
5947 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v12
5948 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v13
5949 ; GPRIDX-NEXT: ; return to shader part epilog
5951 ; GFX10-LABEL: dyn_insertelement_v7f64_v_v_v:
5952 ; GFX10: ; %bb.0: ; %entry
5953 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v16
5954 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v0, v14, vcc_lo
5955 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v1, v15, vcc_lo
5956 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v16
5957 ; GFX10-NEXT: v_readfirstlane_b32 s0, v0
5958 ; GFX10-NEXT: v_readfirstlane_b32 s1, v1
5959 ; GFX10-NEXT: v_cndmask_b32_e32 v2, v2, v14, vcc_lo
5960 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v15, vcc_lo
5961 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v16
5962 ; GFX10-NEXT: v_readfirstlane_b32 s2, v2
5963 ; GFX10-NEXT: v_readfirstlane_b32 s3, v3
5964 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v14, vcc_lo
5965 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v5, v15, vcc_lo
5966 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v16
5967 ; GFX10-NEXT: v_readfirstlane_b32 s4, v4
5968 ; GFX10-NEXT: v_readfirstlane_b32 s5, v5
5969 ; GFX10-NEXT: v_cndmask_b32_e32 v6, v6, v14, vcc_lo
5970 ; GFX10-NEXT: v_cndmask_b32_e32 v7, v7, v15, vcc_lo
5971 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v16
5972 ; GFX10-NEXT: v_readfirstlane_b32 s6, v6
5973 ; GFX10-NEXT: v_readfirstlane_b32 s7, v7
5974 ; GFX10-NEXT: v_cndmask_b32_e32 v8, v8, v14, vcc_lo
5975 ; GFX10-NEXT: v_cndmask_b32_e32 v9, v9, v15, vcc_lo
5976 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v16
5977 ; GFX10-NEXT: v_readfirstlane_b32 s8, v8
5978 ; GFX10-NEXT: v_readfirstlane_b32 s9, v9
5979 ; GFX10-NEXT: v_cndmask_b32_e32 v10, v10, v14, vcc_lo
5980 ; GFX10-NEXT: v_cndmask_b32_e32 v11, v11, v15, vcc_lo
5981 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v16
5982 ; GFX10-NEXT: v_readfirstlane_b32 s10, v10
5983 ; GFX10-NEXT: v_readfirstlane_b32 s11, v11
5984 ; GFX10-NEXT: v_cndmask_b32_e32 v12, v12, v14, vcc_lo
5985 ; GFX10-NEXT: v_cndmask_b32_e32 v13, v13, v15, vcc_lo
5986 ; GFX10-NEXT: v_readfirstlane_b32 s12, v12
5987 ; GFX10-NEXT: v_readfirstlane_b32 s13, v13
5988 ; GFX10-NEXT: ; return to shader part epilog
5990 ; GFX11-LABEL: dyn_insertelement_v7f64_v_v_v:
5991 ; GFX11: ; %bb.0: ; %entry
5992 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v16
5993 ; GFX11-NEXT: v_cmp_eq_u32_e64 s9, 5, v16
5994 ; GFX11-NEXT: v_cmp_eq_u32_e64 s10, 6, v16
5995 ; GFX11-NEXT: v_dual_cndmask_b32 v0, v0, v14 :: v_dual_cndmask_b32 v1, v1, v15
5996 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v16
5997 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, v14, s9
5998 ; GFX11-NEXT: v_cndmask_b32_e64 v11, v11, v15, s9
5999 ; GFX11-NEXT: v_cndmask_b32_e64 v12, v12, v14, s10
6000 ; GFX11-NEXT: v_cndmask_b32_e64 v13, v13, v15, s10
6001 ; GFX11-NEXT: v_dual_cndmask_b32 v2, v2, v14 :: v_dual_cndmask_b32 v3, v3, v15
6002 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v16
6003 ; GFX11-NEXT: v_readfirstlane_b32 s0, v0
6004 ; GFX11-NEXT: v_readfirstlane_b32 s1, v1
6005 ; GFX11-NEXT: v_readfirstlane_b32 s2, v2
6006 ; GFX11-NEXT: v_readfirstlane_b32 s3, v3
6007 ; GFX11-NEXT: v_dual_cndmask_b32 v4, v4, v14 :: v_dual_cndmask_b32 v5, v5, v15
6008 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v16
6009 ; GFX11-NEXT: v_readfirstlane_b32 s10, v10
6010 ; GFX11-NEXT: v_readfirstlane_b32 s11, v11
6011 ; GFX11-NEXT: v_readfirstlane_b32 s4, v4
6012 ; GFX11-NEXT: v_readfirstlane_b32 s5, v5
6013 ; GFX11-NEXT: v_dual_cndmask_b32 v6, v6, v14 :: v_dual_cndmask_b32 v7, v7, v15
6014 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v16
6015 ; GFX11-NEXT: v_readfirstlane_b32 s12, v12
6016 ; GFX11-NEXT: v_readfirstlane_b32 s13, v13
6017 ; GFX11-NEXT: v_readfirstlane_b32 s6, v6
6018 ; GFX11-NEXT: v_readfirstlane_b32 s7, v7
6019 ; GFX11-NEXT: v_dual_cndmask_b32 v8, v8, v14 :: v_dual_cndmask_b32 v9, v9, v15
6020 ; GFX11-NEXT: v_readfirstlane_b32 s8, v8
6021 ; GFX11-NEXT: v_readfirstlane_b32 s9, v9
6022 ; GFX11-NEXT: ; return to shader part epilog
6024 %insert = insertelement <7 x double> %vec, double %val, i32 %idx
6025 ret <7 x double> %insert
6028 define amdgpu_ps <5 x double> @dyn_insertelement_v5f64_s_s_s(<5 x double> inreg %vec, double inreg %val, i32 inreg %idx) {
6029 ; GPRIDX-LABEL: dyn_insertelement_v5f64_s_s_s:
6030 ; GPRIDX: ; %bb.0: ; %entry
6031 ; GPRIDX-NEXT: s_cmp_eq_u32 s14, 0
6032 ; GPRIDX-NEXT: s_cselect_b64 s[0:1], s[12:13], s[2:3]
6033 ; GPRIDX-NEXT: s_cmp_eq_u32 s14, 1
6034 ; GPRIDX-NEXT: s_cselect_b64 s[2:3], s[12:13], s[4:5]
6035 ; GPRIDX-NEXT: s_cmp_eq_u32 s14, 2
6036 ; GPRIDX-NEXT: s_cselect_b64 s[4:5], s[12:13], s[6:7]
6037 ; GPRIDX-NEXT: s_cmp_eq_u32 s14, 3
6038 ; GPRIDX-NEXT: s_cselect_b64 s[6:7], s[12:13], s[8:9]
6039 ; GPRIDX-NEXT: s_cmp_eq_u32 s14, 4
6040 ; GPRIDX-NEXT: s_cselect_b64 s[8:9], s[12:13], s[10:11]
6041 ; GPRIDX-NEXT: ; return to shader part epilog
6043 ; GFX10PLUS-LABEL: dyn_insertelement_v5f64_s_s_s:
6044 ; GFX10PLUS: ; %bb.0: ; %entry
6045 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s14, 0
6046 ; GFX10PLUS-NEXT: s_cselect_b64 s[0:1], s[12:13], s[2:3]
6047 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s14, 1
6048 ; GFX10PLUS-NEXT: s_cselect_b64 s[2:3], s[12:13], s[4:5]
6049 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s14, 2
6050 ; GFX10PLUS-NEXT: s_cselect_b64 s[4:5], s[12:13], s[6:7]
6051 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s14, 3
6052 ; GFX10PLUS-NEXT: s_cselect_b64 s[6:7], s[12:13], s[8:9]
6053 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s14, 4
6054 ; GFX10PLUS-NEXT: s_cselect_b64 s[8:9], s[12:13], s[10:11]
6055 ; GFX10PLUS-NEXT: ; return to shader part epilog
6057 %insert = insertelement <5 x double> %vec, double %val, i32 %idx
6058 ret <5 x double> %insert
6061 define amdgpu_ps <5 x double> @dyn_insertelement_v5f64_s_v_s(<5 x double> inreg %vec, double %val, i32 inreg %idx) {
6062 ; GPRIDX-LABEL: dyn_insertelement_v5f64_s_v_s:
6063 ; GPRIDX: ; %bb.0: ; %entry
6064 ; GPRIDX-NEXT: s_mov_b32 s1, s3
6065 ; GPRIDX-NEXT: s_mov_b32 s3, s5
6066 ; GPRIDX-NEXT: s_mov_b32 s5, s7
6067 ; GPRIDX-NEXT: s_mov_b32 s7, s9
6068 ; GPRIDX-NEXT: s_mov_b32 s9, s11
6069 ; GPRIDX-NEXT: s_mov_b32 s0, s2
6070 ; GPRIDX-NEXT: s_mov_b32 s2, s4
6071 ; GPRIDX-NEXT: s_mov_b32 s4, s6
6072 ; GPRIDX-NEXT: s_mov_b32 s6, s8
6073 ; GPRIDX-NEXT: s_mov_b32 s8, s10
6074 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
6075 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s1
6076 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s0
6077 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s12, 0
6078 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s3
6079 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s2
6080 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v0, vcc
6081 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v1, vcc
6082 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s12, 1
6083 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s5
6084 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s4
6085 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v0, vcc
6086 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v1, vcc
6087 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s12, 2
6088 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s7
6089 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s6
6090 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v0, vcc
6091 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v1, vcc
6092 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s12, 3
6093 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
6094 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v0, vcc
6095 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v1, vcc
6096 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s12, 4
6097 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v10, v0, vcc
6098 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v11, v1, vcc
6099 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v2
6100 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v3
6101 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v4
6102 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v5
6103 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v6
6104 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v7
6105 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v8
6106 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v9
6107 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v0
6108 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v1
6109 ; GPRIDX-NEXT: ; return to shader part epilog
6111 ; GFX10-LABEL: dyn_insertelement_v5f64_s_v_s:
6112 ; GFX10: ; %bb.0: ; %entry
6113 ; GFX10-NEXT: s_mov_b32 s1, s3
6114 ; GFX10-NEXT: s_mov_b32 s3, s5
6115 ; GFX10-NEXT: s_mov_b32 s5, s7
6116 ; GFX10-NEXT: s_mov_b32 s7, s9
6117 ; GFX10-NEXT: s_mov_b32 s9, s11
6118 ; GFX10-NEXT: s_mov_b32 s0, s2
6119 ; GFX10-NEXT: s_mov_b32 s2, s4
6120 ; GFX10-NEXT: s_mov_b32 s4, s6
6121 ; GFX10-NEXT: s_mov_b32 s6, s8
6122 ; GFX10-NEXT: s_mov_b32 s8, s10
6123 ; GFX10-NEXT: v_mov_b32_e32 v11, s9
6124 ; GFX10-NEXT: v_mov_b32_e32 v10, s8
6125 ; GFX10-NEXT: v_mov_b32_e32 v9, s7
6126 ; GFX10-NEXT: v_mov_b32_e32 v8, s6
6127 ; GFX10-NEXT: v_mov_b32_e32 v7, s5
6128 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
6129 ; GFX10-NEXT: v_mov_b32_e32 v5, s3
6130 ; GFX10-NEXT: v_mov_b32_e32 v4, s2
6131 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
6132 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
6133 ; GFX10-NEXT: v_cmp_eq_u32_e64 vcc_lo, s12, 0
6134 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, s12, 1
6135 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, s12, 4
6136 ; GFX10-NEXT: v_cndmask_b32_e32 v2, v2, v0, vcc_lo
6137 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v1, vcc_lo
6138 ; GFX10-NEXT: v_cndmask_b32_e64 v4, v4, v0, s0
6139 ; GFX10-NEXT: v_cmp_eq_u32_e64 vcc_lo, s12, 2
6140 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, v1, s0
6141 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, s12, 3
6142 ; GFX10-NEXT: v_readfirstlane_b32 s2, v4
6143 ; GFX10-NEXT: v_cndmask_b32_e32 v6, v6, v0, vcc_lo
6144 ; GFX10-NEXT: v_cndmask_b32_e32 v7, v7, v1, vcc_lo
6145 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, v0, s0
6146 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v1, s0
6147 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v10, v0, s1
6148 ; GFX10-NEXT: v_cndmask_b32_e64 v1, v11, v1, s1
6149 ; GFX10-NEXT: v_readfirstlane_b32 s0, v2
6150 ; GFX10-NEXT: v_readfirstlane_b32 s1, v3
6151 ; GFX10-NEXT: v_readfirstlane_b32 s3, v5
6152 ; GFX10-NEXT: v_readfirstlane_b32 s4, v6
6153 ; GFX10-NEXT: v_readfirstlane_b32 s5, v7
6154 ; GFX10-NEXT: v_readfirstlane_b32 s6, v8
6155 ; GFX10-NEXT: v_readfirstlane_b32 s7, v9
6156 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
6157 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
6158 ; GFX10-NEXT: ; return to shader part epilog
6160 ; GFX11-LABEL: dyn_insertelement_v5f64_s_v_s:
6161 ; GFX11: ; %bb.0: ; %entry
6162 ; GFX11-NEXT: s_mov_b32 s1, s3
6163 ; GFX11-NEXT: s_mov_b32 s3, s5
6164 ; GFX11-NEXT: s_mov_b32 s5, s7
6165 ; GFX11-NEXT: s_mov_b32 s7, s9
6166 ; GFX11-NEXT: s_mov_b32 s9, s11
6167 ; GFX11-NEXT: s_mov_b32 s0, s2
6168 ; GFX11-NEXT: s_mov_b32 s2, s4
6169 ; GFX11-NEXT: s_mov_b32 s4, s6
6170 ; GFX11-NEXT: s_mov_b32 s6, s8
6171 ; GFX11-NEXT: s_mov_b32 s8, s10
6172 ; GFX11-NEXT: v_dual_mov_b32 v11, s9 :: v_dual_mov_b32 v10, s8
6173 ; GFX11-NEXT: v_dual_mov_b32 v9, s7 :: v_dual_mov_b32 v8, s6
6174 ; GFX11-NEXT: v_dual_mov_b32 v7, s5 :: v_dual_mov_b32 v6, s4
6175 ; GFX11-NEXT: v_dual_mov_b32 v5, s3 :: v_dual_mov_b32 v4, s2
6176 ; GFX11-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
6177 ; GFX11-NEXT: v_cmp_eq_u32_e64 vcc_lo, s12, 0
6178 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, s12, 1
6179 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, s12, 4
6180 ; GFX11-NEXT: v_dual_cndmask_b32 v2, v2, v0 :: v_dual_cndmask_b32 v3, v3, v1
6181 ; GFX11-NEXT: v_cndmask_b32_e64 v4, v4, v0, s0
6182 ; GFX11-NEXT: v_cmp_eq_u32_e64 vcc_lo, s12, 2
6183 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, v1, s0
6184 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, s12, 3
6185 ; GFX11-NEXT: v_readfirstlane_b32 s2, v4
6186 ; GFX11-NEXT: v_dual_cndmask_b32 v6, v6, v0 :: v_dual_cndmask_b32 v7, v7, v1
6187 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v8, v0, s0
6188 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, v1, s0
6189 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v10, v0, s1
6190 ; GFX11-NEXT: v_cndmask_b32_e64 v1, v11, v1, s1
6191 ; GFX11-NEXT: v_readfirstlane_b32 s0, v2
6192 ; GFX11-NEXT: v_readfirstlane_b32 s1, v3
6193 ; GFX11-NEXT: v_readfirstlane_b32 s3, v5
6194 ; GFX11-NEXT: v_readfirstlane_b32 s4, v6
6195 ; GFX11-NEXT: v_readfirstlane_b32 s5, v7
6196 ; GFX11-NEXT: v_readfirstlane_b32 s6, v8
6197 ; GFX11-NEXT: v_readfirstlane_b32 s7, v9
6198 ; GFX11-NEXT: v_readfirstlane_b32 s8, v0
6199 ; GFX11-NEXT: v_readfirstlane_b32 s9, v1
6200 ; GFX11-NEXT: ; return to shader part epilog
6202 %insert = insertelement <5 x double> %vec, double %val, i32 %idx
6203 ret <5 x double> %insert
6206 define amdgpu_ps <5 x double> @dyn_insertelement_v5f64_s_v_v(<5 x double> inreg %vec, double %val, i32 %idx) {
6207 ; GPRIDX-LABEL: dyn_insertelement_v5f64_s_v_v:
6208 ; GPRIDX: ; %bb.0: ; %entry
6209 ; GPRIDX-NEXT: s_mov_b32 s1, s3
6210 ; GPRIDX-NEXT: s_mov_b32 s3, s5
6211 ; GPRIDX-NEXT: s_mov_b32 s5, s7
6212 ; GPRIDX-NEXT: s_mov_b32 s7, s9
6213 ; GPRIDX-NEXT: s_mov_b32 s9, s11
6214 ; GPRIDX-NEXT: s_mov_b32 s0, s2
6215 ; GPRIDX-NEXT: s_mov_b32 s2, s4
6216 ; GPRIDX-NEXT: s_mov_b32 s4, s6
6217 ; GPRIDX-NEXT: s_mov_b32 s6, s8
6218 ; GPRIDX-NEXT: s_mov_b32 s8, s10
6219 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s9
6220 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s1
6221 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s0
6222 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v2
6223 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s3
6224 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s2
6225 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc
6226 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v1, vcc
6227 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v2
6228 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s5
6229 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s4
6230 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v0, vcc
6231 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v1, vcc
6232 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v2
6233 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s8
6234 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s7
6235 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s6
6236 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v0, vcc
6237 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v1, vcc
6238 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v2
6239 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[0:1], 4, v2
6240 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v0, vcc
6241 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v10, v1, vcc
6242 ; GPRIDX-NEXT: v_cndmask_b32_e64 v0, v11, v0, s[0:1]
6243 ; GPRIDX-NEXT: v_cndmask_b32_e64 v1, v12, v1, s[0:1]
6244 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v3
6245 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v4
6246 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v5
6247 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v6
6248 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v7
6249 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v8
6250 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v9
6251 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v2
6252 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v0
6253 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v1
6254 ; GPRIDX-NEXT: ; return to shader part epilog
6256 ; GFX10-LABEL: dyn_insertelement_v5f64_s_v_v:
6257 ; GFX10: ; %bb.0: ; %entry
6258 ; GFX10-NEXT: s_mov_b32 s1, s3
6259 ; GFX10-NEXT: s_mov_b32 s3, s5
6260 ; GFX10-NEXT: s_mov_b32 s5, s7
6261 ; GFX10-NEXT: s_mov_b32 s7, s9
6262 ; GFX10-NEXT: s_mov_b32 s9, s11
6263 ; GFX10-NEXT: s_mov_b32 s0, s2
6264 ; GFX10-NEXT: s_mov_b32 s2, s4
6265 ; GFX10-NEXT: s_mov_b32 s4, s6
6266 ; GFX10-NEXT: s_mov_b32 s6, s8
6267 ; GFX10-NEXT: s_mov_b32 s8, s10
6268 ; GFX10-NEXT: v_mov_b32_e32 v12, s9
6269 ; GFX10-NEXT: v_mov_b32_e32 v11, s8
6270 ; GFX10-NEXT: v_mov_b32_e32 v10, s7
6271 ; GFX10-NEXT: v_mov_b32_e32 v9, s6
6272 ; GFX10-NEXT: v_mov_b32_e32 v8, s5
6273 ; GFX10-NEXT: v_mov_b32_e32 v7, s4
6274 ; GFX10-NEXT: v_mov_b32_e32 v6, s3
6275 ; GFX10-NEXT: v_mov_b32_e32 v5, s2
6276 ; GFX10-NEXT: v_mov_b32_e32 v4, s1
6277 ; GFX10-NEXT: v_mov_b32_e32 v3, s0
6278 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
6279 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 1, v2
6280 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 4, v2
6281 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc_lo
6282 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v1, vcc_lo
6283 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, v0, s0
6284 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
6285 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v1, s0
6286 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 3, v2
6287 ; GFX10-NEXT: v_readfirstlane_b32 s2, v5
6288 ; GFX10-NEXT: v_cndmask_b32_e32 v7, v7, v0, vcc_lo
6289 ; GFX10-NEXT: v_cndmask_b32_e32 v2, v8, v1, vcc_lo
6290 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v9, v0, s0
6291 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v10, v1, s0
6292 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v11, v0, s1
6293 ; GFX10-NEXT: v_cndmask_b32_e64 v1, v12, v1, s1
6294 ; GFX10-NEXT: v_readfirstlane_b32 s0, v3
6295 ; GFX10-NEXT: v_readfirstlane_b32 s1, v4
6296 ; GFX10-NEXT: v_readfirstlane_b32 s3, v6
6297 ; GFX10-NEXT: v_readfirstlane_b32 s4, v7
6298 ; GFX10-NEXT: v_readfirstlane_b32 s5, v2
6299 ; GFX10-NEXT: v_readfirstlane_b32 s6, v8
6300 ; GFX10-NEXT: v_readfirstlane_b32 s7, v9
6301 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
6302 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
6303 ; GFX10-NEXT: ; return to shader part epilog
6305 ; GFX11-LABEL: dyn_insertelement_v5f64_s_v_v:
6306 ; GFX11: ; %bb.0: ; %entry
6307 ; GFX11-NEXT: s_mov_b32 s1, s3
6308 ; GFX11-NEXT: s_mov_b32 s3, s5
6309 ; GFX11-NEXT: s_mov_b32 s5, s7
6310 ; GFX11-NEXT: s_mov_b32 s7, s9
6311 ; GFX11-NEXT: s_mov_b32 s9, s11
6312 ; GFX11-NEXT: s_mov_b32 s0, s2
6313 ; GFX11-NEXT: s_mov_b32 s2, s4
6314 ; GFX11-NEXT: s_mov_b32 s4, s6
6315 ; GFX11-NEXT: s_mov_b32 s6, s8
6316 ; GFX11-NEXT: s_mov_b32 s8, s10
6317 ; GFX11-NEXT: v_dual_mov_b32 v12, s9 :: v_dual_mov_b32 v11, s8
6318 ; GFX11-NEXT: v_dual_mov_b32 v10, s7 :: v_dual_mov_b32 v9, s6
6319 ; GFX11-NEXT: v_dual_mov_b32 v8, s5 :: v_dual_mov_b32 v7, s4
6320 ; GFX11-NEXT: v_dual_mov_b32 v6, s3 :: v_dual_mov_b32 v5, s2
6321 ; GFX11-NEXT: v_dual_mov_b32 v4, s1 :: v_dual_mov_b32 v3, s0
6322 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
6323 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 1, v2
6324 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 4, v2
6325 ; GFX11-NEXT: v_dual_cndmask_b32 v3, v3, v0 :: v_dual_cndmask_b32 v4, v4, v1
6326 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, v0, s0
6327 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
6328 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v1, s0
6329 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 3, v2
6330 ; GFX11-NEXT: v_readfirstlane_b32 s2, v5
6331 ; GFX11-NEXT: v_dual_cndmask_b32 v7, v7, v0 :: v_dual_cndmask_b32 v2, v8, v1
6332 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v9, v0, s0
6333 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v10, v1, s0
6334 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v11, v0, s1
6335 ; GFX11-NEXT: v_cndmask_b32_e64 v1, v12, v1, s1
6336 ; GFX11-NEXT: v_readfirstlane_b32 s0, v3
6337 ; GFX11-NEXT: v_readfirstlane_b32 s1, v4
6338 ; GFX11-NEXT: v_readfirstlane_b32 s3, v6
6339 ; GFX11-NEXT: v_readfirstlane_b32 s4, v7
6340 ; GFX11-NEXT: v_readfirstlane_b32 s5, v2
6341 ; GFX11-NEXT: v_readfirstlane_b32 s6, v8
6342 ; GFX11-NEXT: v_readfirstlane_b32 s7, v9
6343 ; GFX11-NEXT: v_readfirstlane_b32 s8, v0
6344 ; GFX11-NEXT: v_readfirstlane_b32 s9, v1
6345 ; GFX11-NEXT: ; return to shader part epilog
6347 %insert = insertelement <5 x double> %vec, double %val, i32 %idx
6348 ret <5 x double> %insert
6351 define amdgpu_ps <5 x double> @dyn_insertelement_v5f64_v_v_s(<5 x double> %vec, double %val, i32 inreg %idx) {
6352 ; GPRIDX-LABEL: dyn_insertelement_v5f64_v_v_s:
6353 ; GPRIDX: ; %bb.0: ; %entry
6354 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 0
6355 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[0:1], s2, 1
6356 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[8:9], s2, 2
6357 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[4:5], s2, 3
6358 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[6:7], s2, 4
6359 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v10, vcc
6360 ; GPRIDX-NEXT: v_cndmask_b32_e64 v2, v2, v10, s[0:1]
6361 ; GPRIDX-NEXT: v_cndmask_b32_e64 v4, v4, v10, s[8:9]
6362 ; GPRIDX-NEXT: v_cndmask_b32_e64 v6, v6, v10, s[4:5]
6363 ; GPRIDX-NEXT: v_cndmask_b32_e64 v8, v8, v10, s[6:7]
6364 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v11, vcc
6365 ; GPRIDX-NEXT: v_cndmask_b32_e64 v3, v3, v11, s[0:1]
6366 ; GPRIDX-NEXT: v_cndmask_b32_e64 v5, v5, v11, s[8:9]
6367 ; GPRIDX-NEXT: v_cndmask_b32_e64 v7, v7, v11, s[4:5]
6368 ; GPRIDX-NEXT: v_cndmask_b32_e64 v9, v9, v11, s[6:7]
6369 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v0
6370 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v1
6371 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v2
6372 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v3
6373 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v4
6374 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v5
6375 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v6
6376 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v7
6377 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v8
6378 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v9
6379 ; GPRIDX-NEXT: ; return to shader part epilog
6381 ; GFX10-LABEL: dyn_insertelement_v5f64_v_v_s:
6382 ; GFX10: ; %bb.0: ; %entry
6383 ; GFX10-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 0
6384 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, s2, 4
6385 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v0, v10, vcc_lo
6386 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v1, v11, vcc_lo
6387 ; GFX10-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 1
6388 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, v10, s0
6389 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v11, s0
6390 ; GFX10-NEXT: v_readfirstlane_b32 s0, v0
6391 ; GFX10-NEXT: v_readfirstlane_b32 s1, v1
6392 ; GFX10-NEXT: v_cndmask_b32_e32 v2, v2, v10, vcc_lo
6393 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v11, vcc_lo
6394 ; GFX10-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 2
6395 ; GFX10-NEXT: v_readfirstlane_b32 s8, v8
6396 ; GFX10-NEXT: v_readfirstlane_b32 s9, v9
6397 ; GFX10-NEXT: v_readfirstlane_b32 s3, v3
6398 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v10, vcc_lo
6399 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v5, v11, vcc_lo
6400 ; GFX10-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 3
6401 ; GFX10-NEXT: v_readfirstlane_b32 s2, v2
6402 ; GFX10-NEXT: v_readfirstlane_b32 s4, v4
6403 ; GFX10-NEXT: v_readfirstlane_b32 s5, v5
6404 ; GFX10-NEXT: v_cndmask_b32_e32 v6, v6, v10, vcc_lo
6405 ; GFX10-NEXT: v_cndmask_b32_e32 v7, v7, v11, vcc_lo
6406 ; GFX10-NEXT: v_readfirstlane_b32 s6, v6
6407 ; GFX10-NEXT: v_readfirstlane_b32 s7, v7
6408 ; GFX10-NEXT: ; return to shader part epilog
6410 ; GFX11-LABEL: dyn_insertelement_v5f64_v_v_s:
6411 ; GFX11: ; %bb.0: ; %entry
6412 ; GFX11-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 0
6413 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, s2, 2
6414 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, s2, 4
6415 ; GFX11-NEXT: v_dual_cndmask_b32 v0, v0, v10 :: v_dual_cndmask_b32 v1, v1, v11
6416 ; GFX11-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 1
6417 ; GFX11-NEXT: v_cndmask_b32_e64 v4, v4, v10, s0
6418 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, v11, s0
6419 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v8, v10, s1
6420 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, v11, s1
6421 ; GFX11-NEXT: v_dual_cndmask_b32 v2, v2, v10 :: v_dual_cndmask_b32 v3, v3, v11
6422 ; GFX11-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 3
6423 ; GFX11-NEXT: v_readfirstlane_b32 s0, v0
6424 ; GFX11-NEXT: v_readfirstlane_b32 s1, v1
6425 ; GFX11-NEXT: v_readfirstlane_b32 s2, v2
6426 ; GFX11-NEXT: v_readfirstlane_b32 s3, v3
6427 ; GFX11-NEXT: v_dual_cndmask_b32 v6, v6, v10 :: v_dual_cndmask_b32 v7, v7, v11
6428 ; GFX11-NEXT: v_readfirstlane_b32 s4, v4
6429 ; GFX11-NEXT: v_readfirstlane_b32 s5, v5
6430 ; GFX11-NEXT: v_readfirstlane_b32 s8, v8
6431 ; GFX11-NEXT: v_readfirstlane_b32 s6, v6
6432 ; GFX11-NEXT: v_readfirstlane_b32 s7, v7
6433 ; GFX11-NEXT: v_readfirstlane_b32 s9, v9
6434 ; GFX11-NEXT: ; return to shader part epilog
6436 %insert = insertelement <5 x double> %vec, double %val, i32 %idx
6437 ret <5 x double> %insert
6440 define amdgpu_ps <5 x double> @dyn_insertelement_v5f64_v_v_v(<5 x double> %vec, double %val, i32 %idx) {
6441 ; GPRIDX-LABEL: dyn_insertelement_v5f64_v_v_v:
6442 ; GPRIDX: ; %bb.0: ; %entry
6443 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v12
6444 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[0:1], 1, v12
6445 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[2:3], 2, v12
6446 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[4:5], 3, v12
6447 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[6:7], 4, v12
6448 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v10, vcc
6449 ; GPRIDX-NEXT: v_cndmask_b32_e64 v2, v2, v10, s[0:1]
6450 ; GPRIDX-NEXT: v_cndmask_b32_e64 v4, v4, v10, s[2:3]
6451 ; GPRIDX-NEXT: v_cndmask_b32_e64 v6, v6, v10, s[4:5]
6452 ; GPRIDX-NEXT: v_cndmask_b32_e64 v8, v8, v10, s[6:7]
6453 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v11, vcc
6454 ; GPRIDX-NEXT: v_cndmask_b32_e64 v3, v3, v11, s[0:1]
6455 ; GPRIDX-NEXT: v_cndmask_b32_e64 v5, v5, v11, s[2:3]
6456 ; GPRIDX-NEXT: v_cndmask_b32_e64 v7, v7, v11, s[4:5]
6457 ; GPRIDX-NEXT: v_cndmask_b32_e64 v9, v9, v11, s[6:7]
6458 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v0
6459 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v1
6460 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v2
6461 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v3
6462 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v4
6463 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v5
6464 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v6
6465 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v7
6466 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v8
6467 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v9
6468 ; GPRIDX-NEXT: ; return to shader part epilog
6470 ; GFX10-LABEL: dyn_insertelement_v5f64_v_v_v:
6471 ; GFX10: ; %bb.0: ; %entry
6472 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v12
6473 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 4, v12
6474 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v0, v10, vcc_lo
6475 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v1, v11, vcc_lo
6476 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v12
6477 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, v10, s0
6478 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v11, s0
6479 ; GFX10-NEXT: v_readfirstlane_b32 s0, v0
6480 ; GFX10-NEXT: v_readfirstlane_b32 s1, v1
6481 ; GFX10-NEXT: v_cndmask_b32_e32 v2, v2, v10, vcc_lo
6482 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v11, vcc_lo
6483 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v12
6484 ; GFX10-NEXT: v_readfirstlane_b32 s8, v8
6485 ; GFX10-NEXT: v_readfirstlane_b32 s9, v9
6486 ; GFX10-NEXT: v_readfirstlane_b32 s2, v2
6487 ; GFX10-NEXT: v_readfirstlane_b32 s3, v3
6488 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v10, vcc_lo
6489 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v5, v11, vcc_lo
6490 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v12
6491 ; GFX10-NEXT: v_readfirstlane_b32 s4, v4
6492 ; GFX10-NEXT: v_readfirstlane_b32 s5, v5
6493 ; GFX10-NEXT: v_cndmask_b32_e32 v6, v6, v10, vcc_lo
6494 ; GFX10-NEXT: v_cndmask_b32_e32 v7, v7, v11, vcc_lo
6495 ; GFX10-NEXT: v_readfirstlane_b32 s6, v6
6496 ; GFX10-NEXT: v_readfirstlane_b32 s7, v7
6497 ; GFX10-NEXT: ; return to shader part epilog
6499 ; GFX11-LABEL: dyn_insertelement_v5f64_v_v_v:
6500 ; GFX11: ; %bb.0: ; %entry
6501 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v12
6502 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 2, v12
6503 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 4, v12
6504 ; GFX11-NEXT: v_dual_cndmask_b32 v0, v0, v10 :: v_dual_cndmask_b32 v1, v1, v11
6505 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v12
6506 ; GFX11-NEXT: v_cndmask_b32_e64 v4, v4, v10, s0
6507 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, v11, s0
6508 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v8, v10, s1
6509 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, v11, s1
6510 ; GFX11-NEXT: v_dual_cndmask_b32 v2, v2, v10 :: v_dual_cndmask_b32 v3, v3, v11
6511 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v12
6512 ; GFX11-NEXT: v_readfirstlane_b32 s0, v0
6513 ; GFX11-NEXT: v_readfirstlane_b32 s1, v1
6514 ; GFX11-NEXT: v_readfirstlane_b32 s2, v2
6515 ; GFX11-NEXT: v_readfirstlane_b32 s3, v3
6516 ; GFX11-NEXT: v_dual_cndmask_b32 v6, v6, v10 :: v_dual_cndmask_b32 v7, v7, v11
6517 ; GFX11-NEXT: v_readfirstlane_b32 s4, v4
6518 ; GFX11-NEXT: v_readfirstlane_b32 s5, v5
6519 ; GFX11-NEXT: v_readfirstlane_b32 s8, v8
6520 ; GFX11-NEXT: v_readfirstlane_b32 s6, v6
6521 ; GFX11-NEXT: v_readfirstlane_b32 s7, v7
6522 ; GFX11-NEXT: v_readfirstlane_b32 s9, v9
6523 ; GFX11-NEXT: ; return to shader part epilog
6525 %insert = insertelement <5 x double> %vec, double %val, i32 %idx
6526 ret <5 x double> %insert