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, 0, v2
719 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[4:5], 1, v2
720 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc
721 ; GPRIDX-NEXT: v_cndmask_b32_e64 v5, v5, v0, s[4:5]
722 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[6:7], 2, v2
723 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[8:9], 3, v2
724 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[10:11], 5, v2
725 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[12:13], 6, v2
726 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[14:15], 7, v2
727 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[16:17], 4, v2
728 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v1, vcc
729 ; GPRIDX-NEXT: v_cndmask_b32_e64 v6, v6, v1, s[4:5]
730 ; GPRIDX-NEXT: v_cndmask_b32_e64 v7, v7, v0, s[6:7]
731 ; GPRIDX-NEXT: v_cndmask_b32_e64 v9, v9, v0, s[8:9]
732 ; GPRIDX-NEXT: v_cndmask_b32_e64 v11, v11, v0, s[16:17]
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[6:7]
737 ; GPRIDX-NEXT: v_cndmask_b32_e64 v10, v10, v1, s[8:9]
738 ; GPRIDX-NEXT: v_cndmask_b32_e64 v12, v12, v1, s[16:17]
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_b64 s[4:5], 1.0
756 ; GFX10-NEXT: s_mov_b32 s18, 0
757 ; GFX10-NEXT: s_mov_b32 s16, 0
758 ; GFX10-NEXT: s_mov_b32 s14, 0
759 ; GFX10-NEXT: s_mov_b32 s12, 0
760 ; GFX10-NEXT: s_mov_b32 s8, 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_cmp_eq_u32_e32 vcc_lo, 0, v2
771 ; GFX10-NEXT: v_mov_b32_e32 v5, s6
772 ; GFX10-NEXT: v_mov_b32_e32 v6, s7
773 ; GFX10-NEXT: v_mov_b32_e32 v7, s8
774 ; GFX10-NEXT: v_mov_b32_e32 v8, s9
775 ; GFX10-NEXT: v_mov_b32_e32 v9, s10
776 ; GFX10-NEXT: v_mov_b32_e32 v10, s11
777 ; GFX10-NEXT: v_mov_b32_e32 v11, s12
778 ; GFX10-NEXT: v_mov_b32_e32 v12, s13
779 ; GFX10-NEXT: v_mov_b32_e32 v13, s14
780 ; GFX10-NEXT: v_mov_b32_e32 v14, s15
781 ; GFX10-NEXT: v_mov_b32_e32 v15, s16
782 ; GFX10-NEXT: v_mov_b32_e32 v16, s17
783 ; GFX10-NEXT: v_mov_b32_e32 v17, s18
784 ; GFX10-NEXT: v_mov_b32_e32 v18, s19
785 ; GFX10-NEXT: v_cmp_eq_u32_e64 s4, 1, v2
786 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc_lo
787 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v1, vcc_lo
788 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
789 ; GFX10-NEXT: v_cmp_eq_u32_e64 s5, 7, v2
790 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, v0, s4
791 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v1, s4
792 ; GFX10-NEXT: v_cmp_eq_u32_e64 s4, 3, v2
793 ; GFX10-NEXT: v_cndmask_b32_e32 v7, v7, v0, vcc_lo
794 ; GFX10-NEXT: v_cndmask_b32_e32 v8, v8, v1, vcc_lo
795 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v2
796 ; GFX10-NEXT: v_cndmask_b32_e64 v17, v17, v0, s5
797 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v0, s4
798 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, v1, s4
799 ; GFX10-NEXT: v_cmp_eq_u32_e64 s4, 5, v2
800 ; GFX10-NEXT: v_cndmask_b32_e32 v11, v11, v0, vcc_lo
801 ; GFX10-NEXT: v_cndmask_b32_e32 v12, v12, v1, vcc_lo
802 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v2
803 ; GFX10-NEXT: v_cndmask_b32_e64 v18, v18, v1, s5
804 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v13, v0, s4
805 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, v1, s4
806 ; GFX10-NEXT: v_cndmask_b32_e32 v15, v15, v0, vcc_lo
807 ; GFX10-NEXT: v_cndmask_b32_e32 v16, v16, v1, vcc_lo
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, 2, v0
994 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 7, 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, 3, v0
998 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, s18, vcc_lo
999 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, s19, vcc_lo
1000 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v0
1001 ; GFX10-NEXT: v_cndmask_b32_e64 v15, v15, s18, s1
1002 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, s18, s0
1003 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, s19, s0
1004 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 5, v0
1005 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, s18, vcc_lo
1006 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, s19, vcc_lo
1007 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v0
1008 ; GFX10-NEXT: v_cndmask_b32_e64 v16, v16, s19, s1
1009 ; GFX10-NEXT: v_cndmask_b32_e64 v11, v11, s18, s0
1010 ; GFX10-NEXT: v_cndmask_b32_e64 v12, v12, s19, s0
1011 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v13, s18, vcc_lo
1012 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, s19, vcc_lo
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 v4, s1
1398 ; GFX10-NEXT: v_mov_b32_e32 v3, s0
1399 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
1400 ; GFX10-NEXT: v_mov_b32_e32 v17, s14
1401 ; GFX10-NEXT: v_mov_b32_e32 v16, s13
1402 ; GFX10-NEXT: v_mov_b32_e32 v15, s12
1403 ; GFX10-NEXT: v_mov_b32_e32 v14, s11
1404 ; GFX10-NEXT: v_mov_b32_e32 v13, s10
1405 ; GFX10-NEXT: v_mov_b32_e32 v12, s9
1406 ; GFX10-NEXT: v_mov_b32_e32 v11, s8
1407 ; GFX10-NEXT: v_mov_b32_e32 v10, s7
1408 ; GFX10-NEXT: v_mov_b32_e32 v9, s6
1409 ; GFX10-NEXT: v_mov_b32_e32 v8, s5
1410 ; GFX10-NEXT: v_mov_b32_e32 v7, s4
1411 ; GFX10-NEXT: v_mov_b32_e32 v6, s3
1412 ; GFX10-NEXT: v_mov_b32_e32 v5, s2
1413 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 1, v2
1414 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc_lo
1415 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v1, vcc_lo
1416 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
1417 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 7, v2
1418 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, v0, s0
1419 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v1, s0
1420 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 3, v2
1421 ; GFX10-NEXT: v_cndmask_b32_e32 v7, v7, v0, vcc_lo
1422 ; GFX10-NEXT: v_cndmask_b32_e32 v8, v8, v1, vcc_lo
1423 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v2
1424 ; GFX10-NEXT: v_cndmask_b32_e64 v17, v17, v0, s1
1425 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v0, s0
1426 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, v1, s0
1427 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 5, v2
1428 ; GFX10-NEXT: v_cndmask_b32_e32 v11, v11, v0, vcc_lo
1429 ; GFX10-NEXT: v_cndmask_b32_e32 v12, v12, v1, vcc_lo
1430 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v2
1431 ; GFX10-NEXT: v_cndmask_b32_e64 v18, v18, v1, s1
1432 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v13, v0, s0
1433 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, v1, s0
1434 ; GFX10-NEXT: v_cndmask_b32_e32 v15, v15, v0, vcc_lo
1435 ; GFX10-NEXT: v_cndmask_b32_e32 v16, v16, v1, vcc_lo
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_mov_b32_e32 v18, s3
1521 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v16
1522 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v17, vcc
1523 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v18, vcc
1524 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v16
1525 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v17, vcc
1526 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v18, vcc
1527 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v16
1528 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v17, vcc
1529 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v18, vcc
1530 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v16
1531 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v17, vcc
1532 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v18, vcc
1533 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v16
1534 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v17, vcc
1535 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v18, vcc
1536 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v16
1537 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v10, v17, vcc
1538 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v11, v18, vcc
1539 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v16
1540 ; GPRIDX-NEXT: v_cndmask_b32_e32 v12, v12, v17, vcc
1541 ; GPRIDX-NEXT: v_cndmask_b32_e32 v13, v13, v18, vcc
1542 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v16
1543 ; GPRIDX-NEXT: v_cndmask_b32_e32 v14, v14, v17, vcc
1544 ; GPRIDX-NEXT: v_cndmask_b32_e32 v15, v15, v18, vcc
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_cmp_eq_u32_e64 s0, 1, v16
1559 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 7, v16
1560 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v0, s2, vcc_lo
1561 ; GFX10-NEXT: v_cndmask_b32_e64 v1, v1, s3, vcc_lo
1562 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v16
1563 ; GFX10-NEXT: v_cndmask_b32_e64 v2, v2, s2, s0
1564 ; GFX10-NEXT: v_cndmask_b32_e64 v3, v3, s3, s0
1565 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 3, v16
1566 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, s2, s1
1567 ; GFX10-NEXT: v_cndmask_b32_e64 v4, v4, s2, vcc_lo
1568 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, s3, vcc_lo
1569 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v16
1570 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, s2, s0
1571 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, s3, s0
1572 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 5, v16
1573 ; GFX10-NEXT: v_cndmask_b32_e64 v15, v15, s3, s1
1574 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, s2, vcc_lo
1575 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, s3, vcc_lo
1576 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v16
1577 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, s2, s0
1578 ; GFX10-NEXT: v_cndmask_b32_e64 v11, v11, s3, s0
1579 ; GFX10-NEXT: v_cndmask_b32_e64 v12, v12, s2, vcc_lo
1580 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v13, 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_cmp_eq_u32_e64 s0, 1, v16
1595 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 7, v16
1596 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v0, s2, vcc_lo
1597 ; GFX11-NEXT: v_cndmask_b32_e64 v1, v1, s3, vcc_lo
1598 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v16
1599 ; GFX11-NEXT: v_cndmask_b32_e64 v2, v2, s2, s0
1600 ; GFX11-NEXT: v_cndmask_b32_e64 v3, v3, s3, s0
1601 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 3, v16
1602 ; GFX11-NEXT: v_cndmask_b32_e64 v14, v14, s2, s1
1603 ; GFX11-NEXT: v_cndmask_b32_e64 v4, v4, s2, vcc_lo
1604 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, s3, vcc_lo
1605 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v16
1606 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, s2, s0
1607 ; GFX11-NEXT: v_cndmask_b32_e64 v7, v7, s3, s0
1608 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 5, v16
1609 ; GFX11-NEXT: v_cndmask_b32_e64 v15, v15, s3, s1
1610 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v8, s2, vcc_lo
1611 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, s3, vcc_lo
1612 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v16
1613 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, s2, s0
1614 ; GFX11-NEXT: v_cndmask_b32_e64 v11, v11, s3, s0
1615 ; GFX11-NEXT: v_cndmask_b32_e64 v12, v12, s2, vcc_lo
1616 ; GFX11-NEXT: v_cndmask_b32_e64 v13, v13, 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_cndmask_b32_e32 v0, v0, v16, vcc
1708 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v17, vcc
1709 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v18
1710 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v16, vcc
1711 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v17, vcc
1712 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v18
1713 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v16, vcc
1714 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v17, vcc
1715 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v18
1716 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v16, vcc
1717 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v17, vcc
1718 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v18
1719 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v16, vcc
1720 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v17, vcc
1721 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v18
1722 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v10, v16, vcc
1723 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v11, v17, vcc
1724 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v18
1725 ; GPRIDX-NEXT: v_cndmask_b32_e32 v12, v12, v16, vcc
1726 ; GPRIDX-NEXT: v_cndmask_b32_e32 v13, v13, v17, vcc
1727 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v18
1728 ; GPRIDX-NEXT: v_cndmask_b32_e32 v14, v14, v16, vcc
1729 ; GPRIDX-NEXT: v_cndmask_b32_e32 v15, v15, v17, vcc
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, 7, v18
1745 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v0, v16, vcc_lo
1746 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v1, v17, vcc_lo
1747 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v18
1748 ; GFX10-NEXT: v_cndmask_b32_e64 v2, v2, v16, s0
1749 ; GFX10-NEXT: v_cndmask_b32_e64 v3, v3, v17, s0
1750 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 3, v18
1751 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, v16, s1
1752 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v16, vcc_lo
1753 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v5, v17, vcc_lo
1754 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v18
1755 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v16, s0
1756 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, v17, s0
1757 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 5, v18
1758 ; GFX10-NEXT: v_cndmask_b32_e64 v15, v15, v17, s1
1759 ; GFX10-NEXT: v_cndmask_b32_e32 v8, v8, v16, vcc_lo
1760 ; GFX10-NEXT: v_cndmask_b32_e32 v9, v9, v17, vcc_lo
1761 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v18
1762 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, v16, s0
1763 ; GFX10-NEXT: v_cndmask_b32_e64 v11, v11, v17, s0
1764 ; GFX10-NEXT: v_cndmask_b32_e32 v12, v12, v16, vcc_lo
1765 ; GFX10-NEXT: v_cndmask_b32_e32 v13, v13, v17, vcc_lo
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, 7, v18
1781 ; GFX11-NEXT: v_dual_cndmask_b32 v0, v0, v16 :: v_dual_cndmask_b32 v1, v1, v17
1782 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v18
1783 ; GFX11-NEXT: v_cndmask_b32_e64 v2, v2, v16, s0
1784 ; GFX11-NEXT: v_cndmask_b32_e64 v3, v3, v17, s0
1785 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 3, v18
1786 ; GFX11-NEXT: v_cndmask_b32_e64 v14, v14, v16, s1
1787 ; GFX11-NEXT: v_dual_cndmask_b32 v4, v4, v16 :: v_dual_cndmask_b32 v5, v5, v17
1788 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v18
1789 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v16, s0
1790 ; GFX11-NEXT: v_cndmask_b32_e64 v7, v7, v17, s0
1791 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 5, v18
1792 ; GFX11-NEXT: v_cndmask_b32_e64 v15, v15, v17, s1
1793 ; GFX11-NEXT: v_dual_cndmask_b32 v8, v8, v16 :: v_dual_cndmask_b32 v9, v9, v17
1794 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v18
1795 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, v16, s0
1796 ; GFX11-NEXT: v_cndmask_b32_e64 v11, v11, v17, s0
1797 ; GFX11-NEXT: v_dual_cndmask_b32 v12, v12, v16 :: v_dual_cndmask_b32 v13, v13, v17
1798 ; GFX11-NEXT: global_store_b128 v[0:1], v[0:3], off dlc
1799 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1800 ; GFX11-NEXT: global_store_b128 v[0:1], v[4:7], off dlc
1801 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1802 ; GFX11-NEXT: global_store_b128 v[0:1], v[8:11], off dlc
1803 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1804 ; GFX11-NEXT: global_store_b128 v[0:1], v[12:15], off dlc
1805 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
1806 ; GFX11-NEXT: s_nop 0
1807 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
1808 ; GFX11-NEXT: s_endpgm
1810 %insert = insertelement <8 x double> %vec, double %val, i32 %idx
1811 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
1812 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
1813 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
1814 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
1815 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
1816 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
1817 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
1818 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
1822 define amdgpu_ps <3 x i32> @dyn_insertelement_v3i32_s_s_s(<3 x i32> inreg %vec, i32 inreg %val, i32 inreg %idx) {
1823 ; GPRIDX-LABEL: dyn_insertelement_v3i32_s_s_s:
1824 ; GPRIDX: ; %bb.0: ; %entry
1825 ; GPRIDX-NEXT: s_cmp_eq_u32 s6, 0
1826 ; GPRIDX-NEXT: s_cselect_b32 s0, s5, s2
1827 ; GPRIDX-NEXT: s_cmp_eq_u32 s6, 1
1828 ; GPRIDX-NEXT: s_cselect_b32 s1, s5, s3
1829 ; GPRIDX-NEXT: s_cmp_eq_u32 s6, 2
1830 ; GPRIDX-NEXT: s_cselect_b32 s2, s5, s4
1831 ; GPRIDX-NEXT: ; return to shader part epilog
1833 ; GFX10PLUS-LABEL: dyn_insertelement_v3i32_s_s_s:
1834 ; GFX10PLUS: ; %bb.0: ; %entry
1835 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s6, 0
1836 ; GFX10PLUS-NEXT: s_cselect_b32 s0, s5, s2
1837 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s6, 1
1838 ; GFX10PLUS-NEXT: s_cselect_b32 s1, s5, s3
1839 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s6, 2
1840 ; GFX10PLUS-NEXT: s_cselect_b32 s2, s5, s4
1841 ; GFX10PLUS-NEXT: ; return to shader part epilog
1843 %insert = insertelement <3 x i32> %vec, i32 %val, i32 %idx
1844 ret <3 x i32> %insert
1847 define amdgpu_ps <3 x float> @dyn_insertelement_v3i32_v_v_s(<3 x float> %vec, float %val, i32 inreg %idx) {
1848 ; GPRIDX-LABEL: dyn_insertelement_v3i32_v_v_s:
1849 ; GPRIDX: ; %bb.0: ; %entry
1850 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 0
1851 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v3, vcc
1852 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 1
1853 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc
1854 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 2
1855 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v3, vcc
1856 ; GPRIDX-NEXT: ; return to shader part epilog
1858 ; GFX10PLUS-LABEL: dyn_insertelement_v3i32_v_v_s:
1859 ; GFX10PLUS: ; %bb.0: ; %entry
1860 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 0
1861 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v3, vcc_lo
1862 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 1
1863 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v3, vcc_lo
1864 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 2
1865 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v3, vcc_lo
1866 ; GFX10PLUS-NEXT: ; return to shader part epilog
1868 %insert = insertelement <3 x float> %vec, float %val, i32 %idx
1869 ret <3 x float> %insert
1872 define amdgpu_ps <5 x i32> @dyn_insertelement_v5i32_s_s_s(<5 x i32> inreg %vec, i32 inreg %val, i32 inreg %idx) {
1873 ; GPRIDX-LABEL: dyn_insertelement_v5i32_s_s_s:
1874 ; GPRIDX: ; %bb.0: ; %entry
1875 ; GPRIDX-NEXT: s_cmp_eq_u32 s8, 0
1876 ; GPRIDX-NEXT: s_cselect_b32 s0, s7, s2
1877 ; GPRIDX-NEXT: s_cmp_eq_u32 s8, 1
1878 ; GPRIDX-NEXT: s_cselect_b32 s1, s7, s3
1879 ; GPRIDX-NEXT: s_cmp_eq_u32 s8, 2
1880 ; GPRIDX-NEXT: s_cselect_b32 s2, s7, s4
1881 ; GPRIDX-NEXT: s_cmp_eq_u32 s8, 3
1882 ; GPRIDX-NEXT: s_cselect_b32 s3, s7, s5
1883 ; GPRIDX-NEXT: s_cmp_eq_u32 s8, 4
1884 ; GPRIDX-NEXT: s_cselect_b32 s4, s7, s6
1885 ; GPRIDX-NEXT: ; return to shader part epilog
1887 ; GFX10PLUS-LABEL: dyn_insertelement_v5i32_s_s_s:
1888 ; GFX10PLUS: ; %bb.0: ; %entry
1889 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s8, 0
1890 ; GFX10PLUS-NEXT: s_cselect_b32 s0, s7, s2
1891 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s8, 1
1892 ; GFX10PLUS-NEXT: s_cselect_b32 s1, s7, s3
1893 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s8, 2
1894 ; GFX10PLUS-NEXT: s_cselect_b32 s2, s7, s4
1895 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s8, 3
1896 ; GFX10PLUS-NEXT: s_cselect_b32 s3, s7, s5
1897 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s8, 4
1898 ; GFX10PLUS-NEXT: s_cselect_b32 s4, s7, s6
1899 ; GFX10PLUS-NEXT: ; return to shader part epilog
1901 %insert = insertelement <5 x i32> %vec, i32 %val, i32 %idx
1902 ret <5 x i32> %insert
1905 define amdgpu_ps <5 x float> @dyn_insertelement_v5i32_v_v_s(<5 x float> %vec, float %val, i32 inreg %idx) {
1906 ; GPRIDX-LABEL: dyn_insertelement_v5i32_v_v_s:
1907 ; GPRIDX: ; %bb.0: ; %entry
1908 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 0
1909 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v5, vcc
1910 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 1
1911 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v5, vcc
1912 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 2
1913 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v5, vcc
1914 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 3
1915 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v5, vcc
1916 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 4
1917 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v5, vcc
1918 ; GPRIDX-NEXT: ; return to shader part epilog
1920 ; GFX10PLUS-LABEL: dyn_insertelement_v5i32_v_v_s:
1921 ; GFX10PLUS: ; %bb.0: ; %entry
1922 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 0
1923 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v5, vcc_lo
1924 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 1
1925 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v5, vcc_lo
1926 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 2
1927 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v5, vcc_lo
1928 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 3
1929 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v5, vcc_lo
1930 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 4
1931 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v5, vcc_lo
1932 ; GFX10PLUS-NEXT: ; return to shader part epilog
1934 %insert = insertelement <5 x float> %vec, float %val, i32 %idx
1935 ret <5 x float> %insert
1938 define amdgpu_ps <32 x i32> @dyn_insertelement_v32i32_s_s_s(<32 x i32> inreg %vec, i32 inreg %val, i32 inreg %idx) {
1939 ; GPRIDX-LABEL: dyn_insertelement_v32i32_s_s_s:
1940 ; GPRIDX: ; %bb.0: ; %entry
1941 ; GPRIDX-NEXT: s_mov_b32 s0, s2
1942 ; GPRIDX-NEXT: s_mov_b32 s1, s3
1943 ; GPRIDX-NEXT: s_mov_b32 s2, s4
1944 ; GPRIDX-NEXT: s_mov_b32 s3, s5
1945 ; GPRIDX-NEXT: s_mov_b32 s4, s6
1946 ; GPRIDX-NEXT: s_mov_b32 s5, s7
1947 ; GPRIDX-NEXT: s_mov_b32 s6, s8
1948 ; GPRIDX-NEXT: s_mov_b32 s7, s9
1949 ; GPRIDX-NEXT: s_mov_b32 s8, s10
1950 ; GPRIDX-NEXT: s_mov_b32 s9, s11
1951 ; GPRIDX-NEXT: s_mov_b32 s10, s12
1952 ; GPRIDX-NEXT: s_mov_b32 s11, s13
1953 ; GPRIDX-NEXT: s_mov_b32 s12, s14
1954 ; GPRIDX-NEXT: s_mov_b32 s13, s15
1955 ; GPRIDX-NEXT: s_mov_b32 s14, s16
1956 ; GPRIDX-NEXT: s_mov_b32 s15, s17
1957 ; GPRIDX-NEXT: s_mov_b32 s16, s18
1958 ; GPRIDX-NEXT: s_mov_b32 s17, s19
1959 ; GPRIDX-NEXT: s_mov_b32 s18, s20
1960 ; GPRIDX-NEXT: s_mov_b32 s19, s21
1961 ; GPRIDX-NEXT: s_mov_b32 s20, s22
1962 ; GPRIDX-NEXT: s_mov_b32 s21, s23
1963 ; GPRIDX-NEXT: s_mov_b32 s22, s24
1964 ; GPRIDX-NEXT: s_mov_b32 s23, s25
1965 ; GPRIDX-NEXT: s_mov_b32 s24, s26
1966 ; GPRIDX-NEXT: s_mov_b32 s25, s27
1967 ; GPRIDX-NEXT: s_mov_b32 s26, s28
1968 ; GPRIDX-NEXT: s_mov_b32 s27, s29
1969 ; GPRIDX-NEXT: s_mov_b32 s28, s30
1970 ; GPRIDX-NEXT: s_mov_b32 s29, s31
1971 ; GPRIDX-NEXT: s_mov_b32 s31, s33
1972 ; GPRIDX-NEXT: s_mov_b32 s30, s32
1973 ; GPRIDX-NEXT: s_mov_b32 m0, s35
1974 ; GPRIDX-NEXT: s_nop 0
1975 ; GPRIDX-NEXT: s_movreld_b32 s0, s34
1976 ; GPRIDX-NEXT: ; return to shader part epilog
1978 ; GFX10PLUS-LABEL: dyn_insertelement_v32i32_s_s_s:
1979 ; GFX10PLUS: ; %bb.0: ; %entry
1980 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
1981 ; GFX10PLUS-NEXT: s_mov_b32 m0, s35
1982 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
1983 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
1984 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
1985 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
1986 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
1987 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
1988 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
1989 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
1990 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
1991 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
1992 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
1993 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
1994 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
1995 ; GFX10PLUS-NEXT: s_mov_b32 s14, s16
1996 ; GFX10PLUS-NEXT: s_mov_b32 s15, s17
1997 ; GFX10PLUS-NEXT: s_mov_b32 s16, s18
1998 ; GFX10PLUS-NEXT: s_mov_b32 s17, s19
1999 ; GFX10PLUS-NEXT: s_mov_b32 s18, s20
2000 ; GFX10PLUS-NEXT: s_mov_b32 s19, s21
2001 ; GFX10PLUS-NEXT: s_mov_b32 s20, s22
2002 ; GFX10PLUS-NEXT: s_mov_b32 s21, s23
2003 ; GFX10PLUS-NEXT: s_mov_b32 s22, s24
2004 ; GFX10PLUS-NEXT: s_mov_b32 s23, s25
2005 ; GFX10PLUS-NEXT: s_mov_b32 s24, s26
2006 ; GFX10PLUS-NEXT: s_mov_b32 s25, s27
2007 ; GFX10PLUS-NEXT: s_mov_b32 s26, s28
2008 ; GFX10PLUS-NEXT: s_mov_b32 s27, s29
2009 ; GFX10PLUS-NEXT: s_mov_b32 s28, s30
2010 ; GFX10PLUS-NEXT: s_mov_b32 s29, s31
2011 ; GFX10PLUS-NEXT: s_mov_b32 s31, s33
2012 ; GFX10PLUS-NEXT: s_mov_b32 s30, s32
2013 ; GFX10PLUS-NEXT: s_movreld_b32 s0, s34
2014 ; GFX10PLUS-NEXT: ; return to shader part epilog
2016 %insert = insertelement <32 x i32> %vec, i32 %val, i32 %idx
2017 ret <32 x i32> %insert
2020 define amdgpu_ps <32 x float> @dyn_insertelement_v32i32_v_v_s(<32 x float> %vec, float %val, i32 inreg %idx) {
2021 ; GPRIDX-LABEL: dyn_insertelement_v32i32_v_v_s:
2022 ; GPRIDX: ; %bb.0: ; %entry
2023 ; GPRIDX-NEXT: s_set_gpr_idx_on s2, gpr_idx(DST)
2024 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v32
2025 ; GPRIDX-NEXT: s_set_gpr_idx_off
2026 ; GPRIDX-NEXT: ; return to shader part epilog
2028 ; GFX10PLUS-LABEL: dyn_insertelement_v32i32_v_v_s:
2029 ; GFX10PLUS: ; %bb.0: ; %entry
2030 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
2031 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v32
2032 ; GFX10PLUS-NEXT: ; return to shader part epilog
2034 %insert = insertelement <32 x float> %vec, float %val, i32 %idx
2035 ret <32 x float> %insert
2038 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) {
2039 ; GPRIDX-LABEL: dyn_insertelement_v8f32_s_s_s_add_1:
2040 ; GPRIDX: ; %bb.0: ; %entry
2041 ; GPRIDX-NEXT: s_add_i32 s11, s11, 1
2042 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 0
2043 ; GPRIDX-NEXT: s_cselect_b32 s0, s10, s2
2044 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 1
2045 ; GPRIDX-NEXT: s_cselect_b32 s1, s10, s3
2046 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 2
2047 ; GPRIDX-NEXT: s_cselect_b32 s2, s10, s4
2048 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 3
2049 ; GPRIDX-NEXT: s_cselect_b32 s3, s10, s5
2050 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 4
2051 ; GPRIDX-NEXT: s_cselect_b32 s4, s10, s6
2052 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 5
2053 ; GPRIDX-NEXT: s_cselect_b32 s5, s10, s7
2054 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 6
2055 ; GPRIDX-NEXT: s_cselect_b32 s6, s10, s8
2056 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 7
2057 ; GPRIDX-NEXT: s_cselect_b32 s7, s10, s9
2058 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
2059 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
2060 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2061 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2062 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2063 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2064 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2065 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2066 ; GPRIDX-NEXT: ; return to shader part epilog
2068 ; GFX10-LABEL: dyn_insertelement_v8f32_s_s_s_add_1:
2069 ; GFX10: ; %bb.0: ; %entry
2070 ; GFX10-NEXT: s_mov_b32 s1, s3
2071 ; GFX10-NEXT: s_mov_b32 m0, s11
2072 ; GFX10-NEXT: s_mov_b32 s0, s2
2073 ; GFX10-NEXT: s_mov_b32 s2, s4
2074 ; GFX10-NEXT: s_mov_b32 s3, s5
2075 ; GFX10-NEXT: s_mov_b32 s4, s6
2076 ; GFX10-NEXT: s_mov_b32 s5, s7
2077 ; GFX10-NEXT: s_mov_b32 s6, s8
2078 ; GFX10-NEXT: s_mov_b32 s7, s9
2079 ; GFX10-NEXT: s_movreld_b32 s1, s10
2080 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2081 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2082 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
2083 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
2084 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
2085 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
2086 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
2087 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
2088 ; GFX10-NEXT: ; return to shader part epilog
2090 ; GFX11-LABEL: dyn_insertelement_v8f32_s_s_s_add_1:
2091 ; GFX11: ; %bb.0: ; %entry
2092 ; GFX11-NEXT: s_mov_b32 s1, s3
2093 ; GFX11-NEXT: s_mov_b32 m0, s11
2094 ; GFX11-NEXT: s_mov_b32 s0, s2
2095 ; GFX11-NEXT: s_mov_b32 s2, s4
2096 ; GFX11-NEXT: s_mov_b32 s3, s5
2097 ; GFX11-NEXT: s_mov_b32 s4, s6
2098 ; GFX11-NEXT: s_mov_b32 s5, s7
2099 ; GFX11-NEXT: s_mov_b32 s6, s8
2100 ; GFX11-NEXT: s_mov_b32 s7, s9
2101 ; GFX11-NEXT: s_movreld_b32 s1, s10
2102 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2103 ; GFX11-NEXT: v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
2104 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_mov_b32 v5, s5
2105 ; GFX11-NEXT: v_dual_mov_b32 v6, s6 :: v_dual_mov_b32 v7, s7
2106 ; GFX11-NEXT: ; return to shader part epilog
2108 %idx.add = add i32 %idx, 1
2109 %insert = insertelement <8 x float> %vec, float %val, i32 %idx.add
2110 ret <8 x float> %insert
2113 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) {
2114 ; GPRIDX-LABEL: dyn_insertelement_v8f32_s_s_s_add_7:
2115 ; GPRIDX: ; %bb.0: ; %entry
2116 ; GPRIDX-NEXT: s_add_i32 s11, s11, 7
2117 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 0
2118 ; GPRIDX-NEXT: s_cselect_b32 s0, s10, s2
2119 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 1
2120 ; GPRIDX-NEXT: s_cselect_b32 s1, s10, s3
2121 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 2
2122 ; GPRIDX-NEXT: s_cselect_b32 s2, s10, s4
2123 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 3
2124 ; GPRIDX-NEXT: s_cselect_b32 s3, s10, s5
2125 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 4
2126 ; GPRIDX-NEXT: s_cselect_b32 s4, s10, s6
2127 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 5
2128 ; GPRIDX-NEXT: s_cselect_b32 s5, s10, s7
2129 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 6
2130 ; GPRIDX-NEXT: s_cselect_b32 s6, s10, s8
2131 ; GPRIDX-NEXT: s_cmp_eq_u32 s11, 7
2132 ; GPRIDX-NEXT: s_cselect_b32 s7, s10, s9
2133 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
2134 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
2135 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2136 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2137 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2138 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2139 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2140 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2141 ; GPRIDX-NEXT: ; return to shader part epilog
2143 ; GFX10-LABEL: dyn_insertelement_v8f32_s_s_s_add_7:
2144 ; GFX10: ; %bb.0: ; %entry
2145 ; GFX10-NEXT: s_mov_b32 s1, s3
2146 ; GFX10-NEXT: s_mov_b32 s3, s5
2147 ; GFX10-NEXT: s_mov_b32 s5, s7
2148 ; GFX10-NEXT: s_mov_b32 s7, s9
2149 ; GFX10-NEXT: s_mov_b32 m0, s11
2150 ; GFX10-NEXT: s_mov_b32 s0, s2
2151 ; GFX10-NEXT: s_mov_b32 s2, s4
2152 ; GFX10-NEXT: s_mov_b32 s4, s6
2153 ; GFX10-NEXT: s_mov_b32 s6, s8
2154 ; GFX10-NEXT: s_movreld_b32 s7, s10
2155 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2156 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2157 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
2158 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
2159 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
2160 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
2161 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
2162 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
2163 ; GFX10-NEXT: ; return to shader part epilog
2165 ; GFX11-LABEL: dyn_insertelement_v8f32_s_s_s_add_7:
2166 ; GFX11: ; %bb.0: ; %entry
2167 ; GFX11-NEXT: s_mov_b32 s1, s3
2168 ; GFX11-NEXT: s_mov_b32 s3, s5
2169 ; GFX11-NEXT: s_mov_b32 s5, s7
2170 ; GFX11-NEXT: s_mov_b32 s7, s9
2171 ; GFX11-NEXT: s_mov_b32 m0, s11
2172 ; GFX11-NEXT: s_mov_b32 s0, s2
2173 ; GFX11-NEXT: s_mov_b32 s2, s4
2174 ; GFX11-NEXT: s_mov_b32 s4, s6
2175 ; GFX11-NEXT: s_mov_b32 s6, s8
2176 ; GFX11-NEXT: s_movreld_b32 s7, s10
2177 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2178 ; GFX11-NEXT: v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
2179 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_mov_b32 v5, s5
2180 ; GFX11-NEXT: v_dual_mov_b32 v6, s6 :: v_dual_mov_b32 v7, s7
2181 ; GFX11-NEXT: ; return to shader part epilog
2183 %idx.add = add i32 %idx, 7
2184 %insert = insertelement <8 x float> %vec, float %val, i32 %idx.add
2185 ret <8 x float> %insert
2188 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_v_v_v_add_1(<8 x float> %vec, float %val, i32 %idx) {
2189 ; GPRIDX-LABEL: dyn_insertelement_v8f32_v_v_v_add_1:
2190 ; GPRIDX: ; %bb.0: ; %entry
2191 ; GPRIDX-NEXT: v_add_u32_e32 v9, 1, v9
2192 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v9
2193 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc
2194 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v9
2195 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc
2196 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v9
2197 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc
2198 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v9
2199 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc
2200 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v9
2201 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc
2202 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v9
2203 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc
2204 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v9
2205 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc
2206 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v9
2207 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc
2208 ; GPRIDX-NEXT: ; return to shader part epilog
2210 ; GFX10PLUS-LABEL: dyn_insertelement_v8f32_v_v_v_add_1:
2211 ; GFX10PLUS: ; %bb.0: ; %entry
2212 ; GFX10PLUS-NEXT: v_add_nc_u32_e32 v9, 1, v9
2213 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v9
2214 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc_lo
2215 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v9
2216 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc_lo
2217 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v9
2218 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc_lo
2219 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v9
2220 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc_lo
2221 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v9
2222 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc_lo
2223 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v9
2224 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc_lo
2225 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v9
2226 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc_lo
2227 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v9
2228 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc_lo
2229 ; GFX10PLUS-NEXT: ; return to shader part epilog
2231 %idx.add = add i32 %idx, 1
2232 %insert = insertelement <8 x float> %vec, float %val, i32 %idx.add
2233 ret <8 x float> %insert
2236 define amdgpu_ps <8 x float> @dyn_insertelement_v8f32_v_v_v_add_7(<8 x float> %vec, float %val, i32 %idx) {
2237 ; GPRIDX-LABEL: dyn_insertelement_v8f32_v_v_v_add_7:
2238 ; GPRIDX: ; %bb.0: ; %entry
2239 ; GPRIDX-NEXT: v_add_u32_e32 v9, 7, v9
2240 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v9
2241 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc
2242 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v9
2243 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc
2244 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v9
2245 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc
2246 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v9
2247 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc
2248 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v9
2249 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc
2250 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v9
2251 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc
2252 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v9
2253 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc
2254 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v9
2255 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc
2256 ; GPRIDX-NEXT: ; return to shader part epilog
2258 ; GFX10PLUS-LABEL: dyn_insertelement_v8f32_v_v_v_add_7:
2259 ; GFX10PLUS: ; %bb.0: ; %entry
2260 ; GFX10PLUS-NEXT: v_add_nc_u32_e32 v9, 7, v9
2261 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v9
2262 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v8, vcc_lo
2263 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v9
2264 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v8, vcc_lo
2265 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v9
2266 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v8, vcc_lo
2267 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v9
2268 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v8, vcc_lo
2269 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v9
2270 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v8, vcc_lo
2271 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v9
2272 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v8, vcc_lo
2273 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v9
2274 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v8, vcc_lo
2275 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v9
2276 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v8, vcc_lo
2277 ; GFX10PLUS-NEXT: ; return to shader part epilog
2279 %idx.add = add i32 %idx, 7
2280 %insert = insertelement <8 x float> %vec, float %val, i32 %idx.add
2281 ret <8 x float> %insert
2284 define amdgpu_ps void @dyn_insertelement_v8f64_s_s_s_add_1(<8 x double> inreg %vec, double inreg %val, i32 inreg %idx) {
2285 ; GPRIDX-LABEL: dyn_insertelement_v8f64_s_s_s_add_1:
2286 ; GPRIDX: ; %bb.0: ; %entry
2287 ; GPRIDX-NEXT: s_mov_b32 s0, s2
2288 ; GPRIDX-NEXT: s_mov_b32 s1, s3
2289 ; GPRIDX-NEXT: s_mov_b32 s2, s4
2290 ; GPRIDX-NEXT: s_mov_b32 s3, s5
2291 ; GPRIDX-NEXT: s_mov_b32 s4, s6
2292 ; GPRIDX-NEXT: s_mov_b32 s5, s7
2293 ; GPRIDX-NEXT: s_mov_b32 s6, s8
2294 ; GPRIDX-NEXT: s_mov_b32 s7, s9
2295 ; GPRIDX-NEXT: s_mov_b32 s8, s10
2296 ; GPRIDX-NEXT: s_mov_b32 s9, s11
2297 ; GPRIDX-NEXT: s_mov_b32 s10, s12
2298 ; GPRIDX-NEXT: s_mov_b32 s11, s13
2299 ; GPRIDX-NEXT: s_mov_b32 s12, s14
2300 ; GPRIDX-NEXT: s_mov_b32 s13, s15
2301 ; GPRIDX-NEXT: s_mov_b32 s14, s16
2302 ; GPRIDX-NEXT: s_mov_b32 s15, s17
2303 ; GPRIDX-NEXT: s_mov_b32 m0, s20
2304 ; GPRIDX-NEXT: s_nop 0
2305 ; GPRIDX-NEXT: s_movreld_b64 s[2:3], s[18:19]
2306 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
2307 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
2308 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2309 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2310 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2311 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2312 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s4
2313 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s5
2314 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s6
2315 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s7
2316 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2317 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2318 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s8
2319 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s9
2320 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s10
2321 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s11
2322 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2323 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2324 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s12
2325 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s13
2326 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s14
2327 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s15
2328 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2329 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2330 ; GPRIDX-NEXT: s_endpgm
2332 ; GFX10-LABEL: dyn_insertelement_v8f64_s_s_s_add_1:
2333 ; GFX10: ; %bb.0: ; %entry
2334 ; GFX10-NEXT: s_mov_b32 s0, s2
2335 ; GFX10-NEXT: s_mov_b32 s1, s3
2336 ; GFX10-NEXT: s_mov_b32 s2, s4
2337 ; GFX10-NEXT: s_mov_b32 s3, s5
2338 ; GFX10-NEXT: s_mov_b32 m0, s20
2339 ; GFX10-NEXT: s_mov_b32 s4, s6
2340 ; GFX10-NEXT: s_mov_b32 s5, s7
2341 ; GFX10-NEXT: s_mov_b32 s6, s8
2342 ; GFX10-NEXT: s_mov_b32 s7, s9
2343 ; GFX10-NEXT: s_mov_b32 s8, s10
2344 ; GFX10-NEXT: s_mov_b32 s9, s11
2345 ; GFX10-NEXT: s_mov_b32 s10, s12
2346 ; GFX10-NEXT: s_mov_b32 s11, s13
2347 ; GFX10-NEXT: s_mov_b32 s12, s14
2348 ; GFX10-NEXT: s_mov_b32 s13, s15
2349 ; GFX10-NEXT: s_mov_b32 s14, s16
2350 ; GFX10-NEXT: s_mov_b32 s15, s17
2351 ; GFX10-NEXT: s_movreld_b64 s[2:3], s[18:19]
2352 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2353 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2354 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
2355 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
2356 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
2357 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
2358 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
2359 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
2360 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
2361 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
2362 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
2363 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
2364 ; GFX10-NEXT: v_mov_b32_e32 v12, s12
2365 ; GFX10-NEXT: v_mov_b32_e32 v13, s13
2366 ; GFX10-NEXT: v_mov_b32_e32 v14, s14
2367 ; GFX10-NEXT: v_mov_b32_e32 v15, s15
2368 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2369 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2370 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
2371 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2372 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
2373 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2374 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
2375 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2376 ; GFX10-NEXT: s_endpgm
2378 ; GFX11-LABEL: dyn_insertelement_v8f64_s_s_s_add_1:
2379 ; GFX11: ; %bb.0: ; %entry
2380 ; GFX11-NEXT: s_mov_b32 s0, s2
2381 ; GFX11-NEXT: s_mov_b32 s1, s3
2382 ; GFX11-NEXT: s_mov_b32 s2, s4
2383 ; GFX11-NEXT: s_mov_b32 s3, s5
2384 ; GFX11-NEXT: s_mov_b32 m0, s20
2385 ; GFX11-NEXT: s_mov_b32 s4, s6
2386 ; GFX11-NEXT: s_mov_b32 s5, s7
2387 ; GFX11-NEXT: s_mov_b32 s6, s8
2388 ; GFX11-NEXT: s_mov_b32 s7, s9
2389 ; GFX11-NEXT: s_mov_b32 s8, s10
2390 ; GFX11-NEXT: s_mov_b32 s9, s11
2391 ; GFX11-NEXT: s_mov_b32 s10, s12
2392 ; GFX11-NEXT: s_mov_b32 s11, s13
2393 ; GFX11-NEXT: s_mov_b32 s12, s14
2394 ; GFX11-NEXT: s_mov_b32 s13, s15
2395 ; GFX11-NEXT: s_mov_b32 s14, s16
2396 ; GFX11-NEXT: s_mov_b32 s15, s17
2397 ; GFX11-NEXT: s_movreld_b64 s[2:3], s[18:19]
2398 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
2399 ; GFX11-NEXT: v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
2400 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_mov_b32 v5, s5
2401 ; GFX11-NEXT: v_dual_mov_b32 v6, s6 :: v_dual_mov_b32 v7, s7
2402 ; GFX11-NEXT: v_dual_mov_b32 v8, s8 :: v_dual_mov_b32 v9, s9
2403 ; GFX11-NEXT: v_dual_mov_b32 v10, s10 :: v_dual_mov_b32 v11, s11
2404 ; GFX11-NEXT: v_dual_mov_b32 v12, s12 :: v_dual_mov_b32 v13, s13
2405 ; GFX11-NEXT: v_dual_mov_b32 v14, s14 :: v_dual_mov_b32 v15, s15
2406 ; GFX11-NEXT: global_store_b128 v[0:1], v[0:3], off dlc
2407 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2408 ; GFX11-NEXT: global_store_b128 v[0:1], v[4:7], off dlc
2409 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2410 ; GFX11-NEXT: global_store_b128 v[0:1], v[8:11], off dlc
2411 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2412 ; GFX11-NEXT: global_store_b128 v[0:1], v[12:15], off dlc
2413 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2414 ; GFX11-NEXT: s_nop 0
2415 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2416 ; GFX11-NEXT: s_endpgm
2418 %idx.add = add i32 %idx, 1
2419 %insert = insertelement <8 x double> %vec, double %val, i32 %idx.add
2420 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
2421 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
2422 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
2423 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
2424 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
2425 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
2426 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
2427 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
2431 define amdgpu_ps void @dyn_insertelement_v8f64_v_v_v_add_1(<8 x double> %vec, double %val, i32 %idx) {
2432 ; GPRIDX-LABEL: dyn_insertelement_v8f64_v_v_v_add_1:
2433 ; GPRIDX: ; %bb.0: ; %entry
2434 ; GPRIDX-NEXT: v_add_u32_e32 v18, 1, v18
2435 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v18
2436 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v16, vcc
2437 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v17, vcc
2438 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v18
2439 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v16, vcc
2440 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v17, vcc
2441 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v18
2442 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v16, vcc
2443 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v17, vcc
2444 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v18
2445 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v16, vcc
2446 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v17, vcc
2447 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v18
2448 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v16, vcc
2449 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v17, vcc
2450 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v18
2451 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v10, v16, vcc
2452 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v11, v17, vcc
2453 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v18
2454 ; GPRIDX-NEXT: v_cndmask_b32_e32 v12, v12, v16, vcc
2455 ; GPRIDX-NEXT: v_cndmask_b32_e32 v13, v13, v17, vcc
2456 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v18
2457 ; GPRIDX-NEXT: v_cndmask_b32_e32 v14, v14, v16, vcc
2458 ; GPRIDX-NEXT: v_cndmask_b32_e32 v15, v15, v17, vcc
2459 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2460 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2461 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
2462 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2463 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
2464 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2465 ; GPRIDX-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
2466 ; GPRIDX-NEXT: s_waitcnt vmcnt(0)
2467 ; GPRIDX-NEXT: s_endpgm
2469 ; GFX10-LABEL: dyn_insertelement_v8f64_v_v_v_add_1:
2470 ; GFX10: ; %bb.0: ; %entry
2471 ; GFX10-NEXT: v_add_nc_u32_e32 v18, 1, v18
2472 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v18
2473 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 1, v18
2474 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 7, v18
2475 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v0, v16, vcc_lo
2476 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v1, v17, vcc_lo
2477 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v18
2478 ; GFX10-NEXT: v_cndmask_b32_e64 v2, v2, v16, s0
2479 ; GFX10-NEXT: v_cndmask_b32_e64 v3, v3, v17, s0
2480 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 3, v18
2481 ; GFX10-NEXT: v_cndmask_b32_e64 v14, v14, v16, s1
2482 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v16, vcc_lo
2483 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v5, v17, vcc_lo
2484 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v18
2485 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v16, s0
2486 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, v17, s0
2487 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 5, v18
2488 ; GFX10-NEXT: v_cndmask_b32_e64 v15, v15, v17, s1
2489 ; GFX10-NEXT: v_cndmask_b32_e32 v8, v8, v16, vcc_lo
2490 ; GFX10-NEXT: v_cndmask_b32_e32 v9, v9, v17, vcc_lo
2491 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v18
2492 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, v16, s0
2493 ; GFX10-NEXT: v_cndmask_b32_e64 v11, v11, v17, s0
2494 ; GFX10-NEXT: v_cndmask_b32_e32 v12, v12, v16, vcc_lo
2495 ; GFX10-NEXT: v_cndmask_b32_e32 v13, v13, v17, vcc_lo
2496 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[0:3], off
2497 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2498 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[4:7], off
2499 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2500 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[8:11], off
2501 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2502 ; GFX10-NEXT: global_store_dwordx4 v[0:1], v[12:15], off
2503 ; GFX10-NEXT: s_waitcnt_vscnt null, 0x0
2504 ; GFX10-NEXT: s_endpgm
2506 ; GFX11-LABEL: dyn_insertelement_v8f64_v_v_v_add_1:
2507 ; GFX11: ; %bb.0: ; %entry
2508 ; GFX11-NEXT: v_add_nc_u32_e32 v18, 1, v18
2509 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v18
2510 ; GFX11-NEXT: v_cndmask_b32_e32 v1, v1, v17, vcc_lo
2511 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 1, v18
2512 ; GFX11-NEXT: v_cndmask_b32_e32 v0, v0, v16, vcc_lo
2513 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v18
2514 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 7, v18
2515 ; GFX11-NEXT: v_cndmask_b32_e64 v2, v2, v16, s0
2516 ; GFX11-NEXT: v_cndmask_b32_e64 v3, v3, v17, s0
2517 ; GFX11-NEXT: v_cndmask_b32_e32 v5, v5, v17, vcc_lo
2518 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 3, v18
2519 ; GFX11-NEXT: v_cndmask_b32_e32 v4, v4, v16, vcc_lo
2520 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v18
2521 ; GFX11-NEXT: v_cndmask_b32_e64 v14, v14, v16, s1
2522 ; GFX11-NEXT: v_cndmask_b32_e64 v15, v15, v17, s1
2523 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v16, s0
2524 ; GFX11-NEXT: v_cndmask_b32_e64 v7, v7, v17, s0
2525 ; GFX11-NEXT: v_cndmask_b32_e32 v9, v9, v17, vcc_lo
2526 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 5, v18
2527 ; GFX11-NEXT: v_cndmask_b32_e32 v8, v8, v16, vcc_lo
2528 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v18
2529 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, v16, s0
2530 ; GFX11-NEXT: v_cndmask_b32_e64 v11, v11, v17, s0
2531 ; GFX11-NEXT: v_dual_cndmask_b32 v13, v13, v17 :: v_dual_cndmask_b32 v12, v12, v16
2532 ; GFX11-NEXT: global_store_b128 v[0:1], v[0:3], off dlc
2533 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2534 ; GFX11-NEXT: global_store_b128 v[0:1], v[4:7], off dlc
2535 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2536 ; GFX11-NEXT: global_store_b128 v[0:1], v[8:11], off dlc
2537 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2538 ; GFX11-NEXT: global_store_b128 v[0:1], v[12:15], off dlc
2539 ; GFX11-NEXT: s_waitcnt_vscnt null, 0x0
2540 ; GFX11-NEXT: s_nop 0
2541 ; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
2542 ; GFX11-NEXT: s_endpgm
2544 %idx.add = add i32 %idx, 1
2545 %insert = insertelement <8 x double> %vec, double %val, i32 %idx.add
2546 %vec.0 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 0, i32 1>
2547 %vec.1 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 2, i32 3>
2548 %vec.2 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 4, i32 5>
2549 %vec.3 = shufflevector <8 x double> %insert, <8 x double> undef, <2 x i32> <i32 6, i32 7>
2550 store volatile <2 x double> %vec.0, ptr addrspace(1) undef
2551 store volatile <2 x double> %vec.1, ptr addrspace(1) undef
2552 store volatile <2 x double> %vec.2, ptr addrspace(1) undef
2553 store volatile <2 x double> %vec.3, ptr addrspace(1) undef
2557 define amdgpu_ps <9 x float> @dyn_insertelement_v9f32_s_v_s(<9 x float> inreg %vec, float %val, i32 inreg %idx) {
2558 ; GPRIDX-LABEL: dyn_insertelement_v9f32_s_v_s:
2559 ; GPRIDX: ; %bb.0: ; %entry
2560 ; GPRIDX-NEXT: s_mov_b32 s0, s2
2561 ; GPRIDX-NEXT: s_mov_b32 s1, s3
2562 ; GPRIDX-NEXT: s_mov_b32 s2, s4
2563 ; GPRIDX-NEXT: s_mov_b32 s3, s5
2564 ; GPRIDX-NEXT: s_mov_b32 s4, s6
2565 ; GPRIDX-NEXT: s_mov_b32 s5, s7
2566 ; GPRIDX-NEXT: s_mov_b32 s6, s8
2567 ; GPRIDX-NEXT: s_mov_b32 s7, s9
2568 ; GPRIDX-NEXT: s_mov_b32 s8, s10
2569 ; GPRIDX-NEXT: v_mov_b32_e32 v9, v0
2570 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
2571 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
2572 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2573 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2574 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2575 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2576 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2577 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2578 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
2579 ; GPRIDX-NEXT: s_set_gpr_idx_on s11, gpr_idx(DST)
2580 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v9
2581 ; GPRIDX-NEXT: s_set_gpr_idx_off
2582 ; GPRIDX-NEXT: ; return to shader part epilog
2584 ; GFX10-LABEL: dyn_insertelement_v9f32_s_v_s:
2585 ; GFX10: ; %bb.0: ; %entry
2586 ; GFX10-NEXT: s_mov_b32 s0, s2
2587 ; GFX10-NEXT: s_mov_b32 s1, s3
2588 ; GFX10-NEXT: s_mov_b32 s2, s4
2589 ; GFX10-NEXT: s_mov_b32 s3, s5
2590 ; GFX10-NEXT: s_mov_b32 s4, s6
2591 ; GFX10-NEXT: s_mov_b32 s5, s7
2592 ; GFX10-NEXT: s_mov_b32 s6, s8
2593 ; GFX10-NEXT: s_mov_b32 s7, s9
2594 ; GFX10-NEXT: s_mov_b32 s8, s10
2595 ; GFX10-NEXT: v_mov_b32_e32 v9, v0
2596 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2597 ; GFX10-NEXT: s_mov_b32 m0, s11
2598 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2599 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
2600 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
2601 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
2602 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
2603 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
2604 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
2605 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
2606 ; GFX10-NEXT: v_movreld_b32_e32 v0, v9
2607 ; GFX10-NEXT: ; return to shader part epilog
2609 ; GFX11-LABEL: dyn_insertelement_v9f32_s_v_s:
2610 ; GFX11: ; %bb.0: ; %entry
2611 ; GFX11-NEXT: s_mov_b32 s0, s2
2612 ; GFX11-NEXT: s_mov_b32 s1, s3
2613 ; GFX11-NEXT: s_mov_b32 s2, s4
2614 ; GFX11-NEXT: s_mov_b32 s3, s5
2615 ; GFX11-NEXT: s_mov_b32 s4, s6
2616 ; GFX11-NEXT: s_mov_b32 s5, s7
2617 ; GFX11-NEXT: s_mov_b32 s6, s8
2618 ; GFX11-NEXT: s_mov_b32 s7, s9
2619 ; GFX11-NEXT: s_mov_b32 s8, s10
2620 ; GFX11-NEXT: v_dual_mov_b32 v9, v0 :: v_dual_mov_b32 v0, s0
2621 ; GFX11-NEXT: s_mov_b32 m0, s11
2622 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
2623 ; GFX11-NEXT: v_dual_mov_b32 v3, s3 :: v_dual_mov_b32 v4, s4
2624 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v6, s6
2625 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v8, s8
2626 ; GFX11-NEXT: v_movreld_b32_e32 v0, v9
2627 ; GFX11-NEXT: ; return to shader part epilog
2629 %insert = insertelement <9 x float> %vec, float %val, i32 %idx
2630 ret <9 x float> %insert
2633 define amdgpu_ps <9 x float> @dyn_insertelement_v9f32_s_v_v(<9 x float> inreg %vec, float %val, i32 %idx) {
2634 ; GPRIDX-LABEL: dyn_insertelement_v9f32_s_v_v:
2635 ; GPRIDX: ; %bb.0: ; %entry
2636 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2637 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
2638 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2639 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v2, v0, vcc
2640 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
2641 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2642 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v3, v0, vcc
2643 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
2644 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2645 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v4, v0, vcc
2646 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
2647 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2648 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
2649 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
2650 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2651 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v6, v0, vcc
2652 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
2653 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
2654 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v7, v0, vcc
2655 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
2656 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
2657 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v8, v0, vcc
2658 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v1
2659 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s10
2660 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v11, v0, vcc
2661 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v1
2662 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v12, v0, vcc
2663 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v10
2664 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v9
2665 ; GPRIDX-NEXT: ; return to shader part epilog
2667 ; GFX10-LABEL: dyn_insertelement_v9f32_s_v_v:
2668 ; GFX10: ; %bb.0: ; %entry
2669 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
2670 ; GFX10-NEXT: v_cndmask_b32_e32 v10, s2, v0, vcc_lo
2671 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
2672 ; GFX10-NEXT: v_cndmask_b32_e32 v9, s3, v0, vcc_lo
2673 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
2674 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
2675 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
2676 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
2677 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
2678 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
2679 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
2680 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
2681 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
2682 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
2683 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
2684 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
2685 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
2686 ; GFX10-NEXT: v_mov_b32_e32 v1, v9
2687 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
2688 ; GFX10-NEXT: v_mov_b32_e32 v0, v10
2689 ; GFX10-NEXT: ; return to shader part epilog
2691 ; GFX11-LABEL: dyn_insertelement_v9f32_s_v_v:
2692 ; GFX11: ; %bb.0: ; %entry
2693 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
2694 ; GFX11-NEXT: v_cndmask_b32_e32 v10, s2, v0, vcc_lo
2695 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
2696 ; GFX11-NEXT: v_cndmask_b32_e32 v9, s3, v0, vcc_lo
2697 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
2698 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
2699 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
2700 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
2701 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
2702 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
2703 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
2704 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
2705 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
2706 ; GFX11-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
2707 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
2708 ; GFX11-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
2709 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
2710 ; GFX11-NEXT: v_dual_mov_b32 v1, v9 :: v_dual_cndmask_b32 v8, s10, v0
2711 ; GFX11-NEXT: v_mov_b32_e32 v0, v10
2712 ; GFX11-NEXT: ; return to shader part epilog
2714 %insert = insertelement <9 x float> %vec, float %val, i32 %idx
2715 ret <9 x float> %insert
2718 define amdgpu_ps <9 x float> @dyn_insertelement_v9f32_v_v_s(<9 x float> %vec, float %val, i32 inreg %idx) {
2719 ; GPRIDX-LABEL: dyn_insertelement_v9f32_v_v_s:
2720 ; GPRIDX: ; %bb.0: ; %entry
2721 ; GPRIDX-NEXT: s_set_gpr_idx_on s2, gpr_idx(DST)
2722 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v9
2723 ; GPRIDX-NEXT: s_set_gpr_idx_off
2724 ; GPRIDX-NEXT: ; return to shader part epilog
2726 ; GFX10PLUS-LABEL: dyn_insertelement_v9f32_v_v_s:
2727 ; GFX10PLUS: ; %bb.0: ; %entry
2728 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
2729 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v9
2730 ; GFX10PLUS-NEXT: ; return to shader part epilog
2732 %insert = insertelement <9 x float> %vec, float %val, i32 %idx
2733 ret <9 x float> %insert
2736 define amdgpu_ps <9 x float> @dyn_insertelement_v9f32_v_v_v(<9 x float> %vec, float %val, i32 %idx) {
2737 ; GPRIDX-LABEL: dyn_insertelement_v9f32_v_v_v:
2738 ; GPRIDX: ; %bb.0: ; %entry
2739 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v10
2740 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v9, vcc
2741 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v10
2742 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v9, vcc
2743 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v10
2744 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v9, vcc
2745 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v10
2746 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v9, vcc
2747 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v10
2748 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v9, vcc
2749 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v10
2750 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v9, vcc
2751 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v10
2752 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v9, vcc
2753 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v10
2754 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v9, vcc
2755 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v10
2756 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v9, vcc
2757 ; GPRIDX-NEXT: ; return to shader part epilog
2759 ; GFX10PLUS-LABEL: dyn_insertelement_v9f32_v_v_v:
2760 ; GFX10PLUS: ; %bb.0: ; %entry
2761 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v10
2762 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v9, vcc_lo
2763 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v10
2764 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v9, vcc_lo
2765 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v10
2766 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v9, vcc_lo
2767 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v10
2768 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v9, vcc_lo
2769 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v10
2770 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v9, vcc_lo
2771 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v10
2772 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v9, vcc_lo
2773 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v10
2774 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v9, vcc_lo
2775 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v10
2776 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v9, vcc_lo
2777 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v10
2778 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v8, v8, v9, vcc_lo
2779 ; GFX10PLUS-NEXT: ; return to shader part epilog
2781 %insert = insertelement <9 x float> %vec, float %val, i32 %idx
2782 ret <9 x float> %insert
2785 define amdgpu_ps <10 x float> @dyn_insertelement_v10f32_s_v_s(<10 x float> inreg %vec, float %val, i32 inreg %idx) {
2786 ; GPRIDX-LABEL: dyn_insertelement_v10f32_s_v_s:
2787 ; GPRIDX: ; %bb.0: ; %entry
2788 ; GPRIDX-NEXT: s_mov_b32 s0, s2
2789 ; GPRIDX-NEXT: s_mov_b32 s1, s3
2790 ; GPRIDX-NEXT: s_mov_b32 s2, s4
2791 ; GPRIDX-NEXT: s_mov_b32 s3, s5
2792 ; GPRIDX-NEXT: s_mov_b32 s4, s6
2793 ; GPRIDX-NEXT: s_mov_b32 s5, s7
2794 ; GPRIDX-NEXT: s_mov_b32 s6, s8
2795 ; GPRIDX-NEXT: s_mov_b32 s7, s9
2796 ; GPRIDX-NEXT: s_mov_b32 s8, s10
2797 ; GPRIDX-NEXT: s_mov_b32 s9, s11
2798 ; GPRIDX-NEXT: v_mov_b32_e32 v10, v0
2799 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
2800 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
2801 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2802 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2803 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2804 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2805 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2806 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2807 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
2808 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
2809 ; GPRIDX-NEXT: s_set_gpr_idx_on s12, gpr_idx(DST)
2810 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v10
2811 ; GPRIDX-NEXT: s_set_gpr_idx_off
2812 ; GPRIDX-NEXT: ; return to shader part epilog
2814 ; GFX10-LABEL: dyn_insertelement_v10f32_s_v_s:
2815 ; GFX10: ; %bb.0: ; %entry
2816 ; GFX10-NEXT: s_mov_b32 s0, s2
2817 ; GFX10-NEXT: s_mov_b32 s1, s3
2818 ; GFX10-NEXT: s_mov_b32 s2, s4
2819 ; GFX10-NEXT: s_mov_b32 s3, s5
2820 ; GFX10-NEXT: s_mov_b32 s4, s6
2821 ; GFX10-NEXT: s_mov_b32 s5, s7
2822 ; GFX10-NEXT: s_mov_b32 s6, s8
2823 ; GFX10-NEXT: s_mov_b32 s7, s9
2824 ; GFX10-NEXT: s_mov_b32 s8, s10
2825 ; GFX10-NEXT: s_mov_b32 s9, s11
2826 ; GFX10-NEXT: v_mov_b32_e32 v10, v0
2827 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
2828 ; GFX10-NEXT: s_mov_b32 m0, s12
2829 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
2830 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
2831 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
2832 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
2833 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
2834 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
2835 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
2836 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
2837 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
2838 ; GFX10-NEXT: v_movreld_b32_e32 v0, v10
2839 ; GFX10-NEXT: ; return to shader part epilog
2841 ; GFX11-LABEL: dyn_insertelement_v10f32_s_v_s:
2842 ; GFX11: ; %bb.0: ; %entry
2843 ; GFX11-NEXT: s_mov_b32 s0, s2
2844 ; GFX11-NEXT: s_mov_b32 s1, s3
2845 ; GFX11-NEXT: s_mov_b32 s2, s4
2846 ; GFX11-NEXT: s_mov_b32 s3, s5
2847 ; GFX11-NEXT: s_mov_b32 s4, s6
2848 ; GFX11-NEXT: s_mov_b32 s5, s7
2849 ; GFX11-NEXT: s_mov_b32 s6, s8
2850 ; GFX11-NEXT: s_mov_b32 s7, s9
2851 ; GFX11-NEXT: s_mov_b32 s8, s10
2852 ; GFX11-NEXT: s_mov_b32 s9, s11
2853 ; GFX11-NEXT: v_mov_b32_e32 v10, v0
2854 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v3, s3
2855 ; GFX11-NEXT: s_mov_b32 m0, s12
2856 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
2857 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v4, s4
2858 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v6, s6
2859 ; GFX11-NEXT: v_dual_mov_b32 v9, s9 :: v_dual_mov_b32 v8, s8
2860 ; GFX11-NEXT: v_movreld_b32_e32 v0, v10
2861 ; GFX11-NEXT: ; return to shader part epilog
2863 %insert = insertelement <10 x float> %vec, float %val, i32 %idx
2864 ret <10 x float> %insert
2867 define amdgpu_ps <10 x float> @dyn_insertelement_v10f32_s_v_v(<10 x float> inreg %vec, float %val, i32 %idx) {
2868 ; GPRIDX-LABEL: dyn_insertelement_v10f32_s_v_v:
2869 ; GPRIDX: ; %bb.0: ; %entry
2870 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
2871 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
2872 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
2873 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v2, v0, vcc
2874 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
2875 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
2876 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v3, v0, vcc
2877 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
2878 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
2879 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v4, v0, vcc
2880 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
2881 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
2882 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
2883 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
2884 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
2885 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v6, v0, vcc
2886 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
2887 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
2888 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v7, v0, vcc
2889 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
2890 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
2891 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v8, v0, vcc
2892 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v1
2893 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s10
2894 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v9, v0, vcc
2895 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v1
2896 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s11
2897 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v12, v0, vcc
2898 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v1
2899 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v13, v0, vcc
2900 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v10
2901 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v11
2902 ; GPRIDX-NEXT: ; return to shader part epilog
2904 ; GFX10-LABEL: dyn_insertelement_v10f32_s_v_v:
2905 ; GFX10: ; %bb.0: ; %entry
2906 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
2907 ; GFX10-NEXT: v_cndmask_b32_e32 v10, s2, v0, vcc_lo
2908 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
2909 ; GFX10-NEXT: v_cndmask_b32_e32 v11, s3, v0, vcc_lo
2910 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
2911 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
2912 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
2913 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
2914 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
2915 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
2916 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
2917 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
2918 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
2919 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
2920 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
2921 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
2922 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
2923 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
2924 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
2925 ; GFX10-NEXT: v_mov_b32_e32 v1, v11
2926 ; GFX10-NEXT: v_cndmask_b32_e32 v9, s11, v0, vcc_lo
2927 ; GFX10-NEXT: v_mov_b32_e32 v0, v10
2928 ; GFX10-NEXT: ; return to shader part epilog
2930 ; GFX11-LABEL: dyn_insertelement_v10f32_s_v_v:
2931 ; GFX11: ; %bb.0: ; %entry
2932 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
2933 ; GFX11-NEXT: v_cndmask_b32_e32 v10, s2, v0, vcc_lo
2934 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
2935 ; GFX11-NEXT: v_cndmask_b32_e32 v11, s3, v0, vcc_lo
2936 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
2937 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
2938 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
2939 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
2940 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
2941 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
2942 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
2943 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
2944 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
2945 ; GFX11-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
2946 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
2947 ; GFX11-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
2948 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
2949 ; GFX11-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
2950 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
2951 ; GFX11-NEXT: v_mov_b32_e32 v1, v11
2952 ; GFX11-NEXT: v_dual_cndmask_b32 v9, s11, v0 :: v_dual_mov_b32 v0, v10
2953 ; GFX11-NEXT: ; return to shader part epilog
2955 %insert = insertelement <10 x float> %vec, float %val, i32 %idx
2956 ret <10 x float> %insert
2959 define amdgpu_ps <10 x float> @dyn_insertelement_v10f32_v_v_s(<10 x float> %vec, float %val, i32 inreg %idx) {
2960 ; GPRIDX-LABEL: dyn_insertelement_v10f32_v_v_s:
2961 ; GPRIDX: ; %bb.0: ; %entry
2962 ; GPRIDX-NEXT: s_set_gpr_idx_on s2, gpr_idx(DST)
2963 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v10
2964 ; GPRIDX-NEXT: s_set_gpr_idx_off
2965 ; GPRIDX-NEXT: ; return to shader part epilog
2967 ; GFX10PLUS-LABEL: dyn_insertelement_v10f32_v_v_s:
2968 ; GFX10PLUS: ; %bb.0: ; %entry
2969 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
2970 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v10
2971 ; GFX10PLUS-NEXT: ; return to shader part epilog
2973 %insert = insertelement <10 x float> %vec, float %val, i32 %idx
2974 ret <10 x float> %insert
2977 define amdgpu_ps <10 x float> @dyn_insertelement_v10f32_v_v_v(<10 x float> %vec, float %val, i32 %idx) {
2978 ; GPRIDX-LABEL: dyn_insertelement_v10f32_v_v_v:
2979 ; GPRIDX: ; %bb.0: ; %entry
2980 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v11
2981 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v10, vcc
2982 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v11
2983 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v10, vcc
2984 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v11
2985 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v10, vcc
2986 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v11
2987 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v10, vcc
2988 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v11
2989 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v10, vcc
2990 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v11
2991 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v10, vcc
2992 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v11
2993 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v10, vcc
2994 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v11
2995 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v10, vcc
2996 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v11
2997 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v10, vcc
2998 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v11
2999 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v10, vcc
3000 ; GPRIDX-NEXT: ; return to shader part epilog
3002 ; GFX10PLUS-LABEL: dyn_insertelement_v10f32_v_v_v:
3003 ; GFX10PLUS: ; %bb.0: ; %entry
3004 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v11
3005 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v10, vcc_lo
3006 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v11
3007 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v10, vcc_lo
3008 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v11
3009 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v10, vcc_lo
3010 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v11
3011 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v10, vcc_lo
3012 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v11
3013 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v10, vcc_lo
3014 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v11
3015 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v10, vcc_lo
3016 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v11
3017 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v10, vcc_lo
3018 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v11
3019 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v10, vcc_lo
3020 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v11
3021 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v8, v8, v10, vcc_lo
3022 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v11
3023 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v9, v9, v10, vcc_lo
3024 ; GFX10PLUS-NEXT: ; return to shader part epilog
3026 %insert = insertelement <10 x float> %vec, float %val, i32 %idx
3027 ret <10 x float> %insert
3030 define amdgpu_ps <11 x float> @dyn_insertelement_v11f32_s_v_s(<11 x float> inreg %vec, float %val, i32 inreg %idx) {
3031 ; GPRIDX-LABEL: dyn_insertelement_v11f32_s_v_s:
3032 ; GPRIDX: ; %bb.0: ; %entry
3033 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3034 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3035 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3036 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3037 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3038 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3039 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3040 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3041 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3042 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3043 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3044 ; GPRIDX-NEXT: v_mov_b32_e32 v11, v0
3045 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
3046 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
3047 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3048 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3049 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3050 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3051 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3052 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3053 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3054 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3055 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3056 ; GPRIDX-NEXT: s_set_gpr_idx_on s13, gpr_idx(DST)
3057 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v11
3058 ; GPRIDX-NEXT: s_set_gpr_idx_off
3059 ; GPRIDX-NEXT: ; return to shader part epilog
3061 ; GFX10-LABEL: dyn_insertelement_v11f32_s_v_s:
3062 ; GFX10: ; %bb.0: ; %entry
3063 ; GFX10-NEXT: s_mov_b32 s0, s2
3064 ; GFX10-NEXT: s_mov_b32 s1, s3
3065 ; GFX10-NEXT: s_mov_b32 s2, s4
3066 ; GFX10-NEXT: s_mov_b32 s3, s5
3067 ; GFX10-NEXT: s_mov_b32 s4, s6
3068 ; GFX10-NEXT: s_mov_b32 s5, s7
3069 ; GFX10-NEXT: s_mov_b32 s6, s8
3070 ; GFX10-NEXT: s_mov_b32 s7, s9
3071 ; GFX10-NEXT: s_mov_b32 s8, s10
3072 ; GFX10-NEXT: s_mov_b32 s9, s11
3073 ; GFX10-NEXT: s_mov_b32 s10, s12
3074 ; GFX10-NEXT: v_mov_b32_e32 v11, v0
3075 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3076 ; GFX10-NEXT: s_mov_b32 m0, s13
3077 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3078 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
3079 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
3080 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
3081 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
3082 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
3083 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
3084 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
3085 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
3086 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
3087 ; GFX10-NEXT: v_movreld_b32_e32 v0, v11
3088 ; GFX10-NEXT: ; return to shader part epilog
3090 ; GFX11-LABEL: dyn_insertelement_v11f32_s_v_s:
3091 ; GFX11: ; %bb.0: ; %entry
3092 ; GFX11-NEXT: s_mov_b32 s0, s2
3093 ; GFX11-NEXT: s_mov_b32 s1, s3
3094 ; GFX11-NEXT: s_mov_b32 s2, s4
3095 ; GFX11-NEXT: s_mov_b32 s3, s5
3096 ; GFX11-NEXT: s_mov_b32 s4, s6
3097 ; GFX11-NEXT: s_mov_b32 s5, s7
3098 ; GFX11-NEXT: s_mov_b32 s6, s8
3099 ; GFX11-NEXT: s_mov_b32 s7, s9
3100 ; GFX11-NEXT: s_mov_b32 s8, s10
3101 ; GFX11-NEXT: s_mov_b32 s9, s11
3102 ; GFX11-NEXT: s_mov_b32 s10, s12
3103 ; GFX11-NEXT: v_dual_mov_b32 v11, v0 :: v_dual_mov_b32 v0, s0
3104 ; GFX11-NEXT: s_mov_b32 m0, s13
3105 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
3106 ; GFX11-NEXT: v_dual_mov_b32 v3, s3 :: v_dual_mov_b32 v4, s4
3107 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v6, s6
3108 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v8, s8
3109 ; GFX11-NEXT: v_dual_mov_b32 v9, s9 :: v_dual_mov_b32 v10, s10
3110 ; GFX11-NEXT: v_movreld_b32_e32 v0, v11
3111 ; GFX11-NEXT: ; return to shader part epilog
3113 %insert = insertelement <11 x float> %vec, float %val, i32 %idx
3114 ret <11 x float> %insert
3117 define amdgpu_ps <11 x float> @dyn_insertelement_v11f32_s_v_v(<11 x float> inreg %vec, float %val, i32 %idx) {
3118 ; GPRIDX-LABEL: dyn_insertelement_v11f32_s_v_v:
3119 ; GPRIDX: ; %bb.0: ; %entry
3120 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3121 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
3122 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3123 ; GPRIDX-NEXT: v_cndmask_b32_e32 v12, v2, v0, vcc
3124 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
3125 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3126 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v3, v0, vcc
3127 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
3128 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3129 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v4, v0, vcc
3130 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
3131 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3132 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
3133 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
3134 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3135 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v6, v0, vcc
3136 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
3137 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3138 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v7, v0, vcc
3139 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
3140 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3141 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v8, v0, vcc
3142 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v1
3143 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3144 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v9, v0, vcc
3145 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v1
3146 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s11
3147 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v10, v0, vcc
3148 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v1
3149 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s12
3150 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v13, v0, vcc
3151 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 10, v1
3152 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v14, v0, vcc
3153 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v12
3154 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v11
3155 ; GPRIDX-NEXT: ; return to shader part epilog
3157 ; GFX10-LABEL: dyn_insertelement_v11f32_s_v_v:
3158 ; GFX10: ; %bb.0: ; %entry
3159 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
3160 ; GFX10-NEXT: v_cndmask_b32_e32 v12, s2, v0, vcc_lo
3161 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
3162 ; GFX10-NEXT: v_cndmask_b32_e32 v11, s3, v0, vcc_lo
3163 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
3164 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
3165 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
3166 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
3167 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
3168 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
3169 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
3170 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
3171 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
3172 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
3173 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
3174 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
3175 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
3176 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
3177 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
3178 ; GFX10-NEXT: v_cndmask_b32_e32 v9, s11, v0, vcc_lo
3179 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v1
3180 ; GFX10-NEXT: v_mov_b32_e32 v1, v11
3181 ; GFX10-NEXT: v_cndmask_b32_e32 v10, s12, v0, vcc_lo
3182 ; GFX10-NEXT: v_mov_b32_e32 v0, v12
3183 ; GFX10-NEXT: ; return to shader part epilog
3185 ; GFX11-LABEL: dyn_insertelement_v11f32_s_v_v:
3186 ; GFX11: ; %bb.0: ; %entry
3187 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
3188 ; GFX11-NEXT: v_cndmask_b32_e32 v12, s2, v0, vcc_lo
3189 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
3190 ; GFX11-NEXT: v_cndmask_b32_e32 v11, s3, v0, vcc_lo
3191 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
3192 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
3193 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
3194 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
3195 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
3196 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
3197 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
3198 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
3199 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
3200 ; GFX11-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
3201 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
3202 ; GFX11-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
3203 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
3204 ; GFX11-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
3205 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
3206 ; GFX11-NEXT: v_cndmask_b32_e32 v9, s11, v0, vcc_lo
3207 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v1
3208 ; GFX11-NEXT: v_dual_mov_b32 v1, v11 :: v_dual_cndmask_b32 v10, s12, v0
3209 ; GFX11-NEXT: v_mov_b32_e32 v0, v12
3210 ; GFX11-NEXT: ; return to shader part epilog
3212 %insert = insertelement <11 x float> %vec, float %val, i32 %idx
3213 ret <11 x float> %insert
3216 define amdgpu_ps <11 x float> @dyn_insertelement_v11f32_v_v_s(<11 x float> %vec, float %val, i32 inreg %idx) {
3217 ; GPRIDX-LABEL: dyn_insertelement_v11f32_v_v_s:
3218 ; GPRIDX: ; %bb.0: ; %entry
3219 ; GPRIDX-NEXT: s_set_gpr_idx_on s2, gpr_idx(DST)
3220 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v11
3221 ; GPRIDX-NEXT: s_set_gpr_idx_off
3222 ; GPRIDX-NEXT: ; return to shader part epilog
3224 ; GFX10PLUS-LABEL: dyn_insertelement_v11f32_v_v_s:
3225 ; GFX10PLUS: ; %bb.0: ; %entry
3226 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
3227 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v11
3228 ; GFX10PLUS-NEXT: ; return to shader part epilog
3230 %insert = insertelement <11 x float> %vec, float %val, i32 %idx
3231 ret <11 x float> %insert
3234 define amdgpu_ps <11 x float> @dyn_insertelement_v11f32_v_v_v(<11 x float> %vec, float %val, i32 %idx) {
3235 ; GPRIDX-LABEL: dyn_insertelement_v11f32_v_v_v:
3236 ; GPRIDX: ; %bb.0: ; %entry
3237 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v12
3238 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v11, vcc
3239 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v12
3240 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v11, vcc
3241 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v12
3242 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v11, vcc
3243 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v12
3244 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v11, vcc
3245 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v12
3246 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v11, vcc
3247 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v12
3248 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v11, vcc
3249 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v12
3250 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v11, vcc
3251 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v12
3252 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v11, vcc
3253 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v12
3254 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v11, vcc
3255 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v12
3256 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v11, vcc
3257 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 10, v12
3258 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v10, v11, vcc
3259 ; GPRIDX-NEXT: ; return to shader part epilog
3261 ; GFX10PLUS-LABEL: dyn_insertelement_v11f32_v_v_v:
3262 ; GFX10PLUS: ; %bb.0: ; %entry
3263 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v12
3264 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v11, vcc_lo
3265 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v12
3266 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v11, vcc_lo
3267 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v12
3268 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v11, vcc_lo
3269 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v12
3270 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v11, vcc_lo
3271 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v12
3272 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v11, vcc_lo
3273 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v12
3274 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v11, vcc_lo
3275 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v12
3276 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v11, vcc_lo
3277 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v12
3278 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v11, vcc_lo
3279 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v12
3280 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v8, v8, v11, vcc_lo
3281 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v12
3282 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v9, v9, v11, vcc_lo
3283 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v12
3284 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v10, v10, v11, vcc_lo
3285 ; GFX10PLUS-NEXT: ; return to shader part epilog
3287 %insert = insertelement <11 x float> %vec, float %val, i32 %idx
3288 ret <11 x float> %insert
3291 define amdgpu_ps <12 x float> @dyn_insertelement_v12f32_s_v_s(<12 x float> inreg %vec, float %val, i32 inreg %idx) {
3292 ; GPRIDX-LABEL: dyn_insertelement_v12f32_s_v_s:
3293 ; GPRIDX: ; %bb.0: ; %entry
3294 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3295 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3296 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3297 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3298 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3299 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3300 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3301 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3302 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3303 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3304 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3305 ; GPRIDX-NEXT: s_mov_b32 s11, s13
3306 ; GPRIDX-NEXT: v_mov_b32_e32 v12, v0
3307 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
3308 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
3309 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3310 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3311 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3312 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3313 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3314 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3315 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3316 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3317 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3318 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
3319 ; GPRIDX-NEXT: s_set_gpr_idx_on s14, gpr_idx(DST)
3320 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v12
3321 ; GPRIDX-NEXT: s_set_gpr_idx_off
3322 ; GPRIDX-NEXT: ; return to shader part epilog
3324 ; GFX10-LABEL: dyn_insertelement_v12f32_s_v_s:
3325 ; GFX10: ; %bb.0: ; %entry
3326 ; GFX10-NEXT: s_mov_b32 s0, s2
3327 ; GFX10-NEXT: s_mov_b32 s1, s3
3328 ; GFX10-NEXT: s_mov_b32 s2, s4
3329 ; GFX10-NEXT: s_mov_b32 s3, s5
3330 ; GFX10-NEXT: s_mov_b32 s4, s6
3331 ; GFX10-NEXT: s_mov_b32 s5, s7
3332 ; GFX10-NEXT: s_mov_b32 s6, s8
3333 ; GFX10-NEXT: s_mov_b32 s7, s9
3334 ; GFX10-NEXT: s_mov_b32 s8, s10
3335 ; GFX10-NEXT: s_mov_b32 s9, s11
3336 ; GFX10-NEXT: s_mov_b32 s10, s12
3337 ; GFX10-NEXT: s_mov_b32 s11, s13
3338 ; GFX10-NEXT: v_mov_b32_e32 v12, v0
3339 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3340 ; GFX10-NEXT: s_mov_b32 m0, s14
3341 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3342 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
3343 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
3344 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
3345 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
3346 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
3347 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
3348 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
3349 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
3350 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
3351 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
3352 ; GFX10-NEXT: v_movreld_b32_e32 v0, v12
3353 ; GFX10-NEXT: ; return to shader part epilog
3355 ; GFX11-LABEL: dyn_insertelement_v12f32_s_v_s:
3356 ; GFX11: ; %bb.0: ; %entry
3357 ; GFX11-NEXT: s_mov_b32 s0, s2
3358 ; GFX11-NEXT: s_mov_b32 s1, s3
3359 ; GFX11-NEXT: s_mov_b32 s2, s4
3360 ; GFX11-NEXT: s_mov_b32 s3, s5
3361 ; GFX11-NEXT: s_mov_b32 s4, s6
3362 ; GFX11-NEXT: s_mov_b32 s5, s7
3363 ; GFX11-NEXT: s_mov_b32 s6, s8
3364 ; GFX11-NEXT: s_mov_b32 s7, s9
3365 ; GFX11-NEXT: s_mov_b32 s8, s10
3366 ; GFX11-NEXT: s_mov_b32 s9, s11
3367 ; GFX11-NEXT: s_mov_b32 s10, s12
3368 ; GFX11-NEXT: s_mov_b32 s11, s13
3369 ; GFX11-NEXT: v_mov_b32_e32 v12, v0
3370 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v3, s3
3371 ; GFX11-NEXT: s_mov_b32 m0, s14
3372 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
3373 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v4, s4
3374 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v6, s6
3375 ; GFX11-NEXT: v_dual_mov_b32 v9, s9 :: v_dual_mov_b32 v8, s8
3376 ; GFX11-NEXT: v_dual_mov_b32 v11, s11 :: v_dual_mov_b32 v10, s10
3377 ; GFX11-NEXT: v_movreld_b32_e32 v0, v12
3378 ; GFX11-NEXT: ; return to shader part epilog
3380 %insert = insertelement <12 x float> %vec, float %val, i32 %idx
3381 ret <12 x float> %insert
3384 define amdgpu_ps <12 x float> @dyn_insertelement_v12f32_s_v_v(<12 x float> inreg %vec, float %val, i32 %idx) {
3385 ; GPRIDX-LABEL: dyn_insertelement_v12f32_s_v_v:
3386 ; GPRIDX: ; %bb.0: ; %entry
3387 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3388 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
3389 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3390 ; GPRIDX-NEXT: v_cndmask_b32_e32 v12, v2, v0, vcc
3391 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
3392 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3393 ; GPRIDX-NEXT: v_cndmask_b32_e32 v13, v3, v0, vcc
3394 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
3395 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3396 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v4, v0, vcc
3397 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
3398 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3399 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
3400 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
3401 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3402 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v6, v0, vcc
3403 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
3404 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3405 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v7, v0, vcc
3406 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
3407 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3408 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v8, v0, vcc
3409 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v1
3410 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3411 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v9, v0, vcc
3412 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v1
3413 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
3414 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v10, v0, vcc
3415 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v1
3416 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s12
3417 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v11, v0, vcc
3418 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 10, v1
3419 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s13
3420 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v14, v0, vcc
3421 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 11, v1
3422 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v15, v0, vcc
3423 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v12
3424 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v13
3425 ; GPRIDX-NEXT: ; return to shader part epilog
3427 ; GFX10-LABEL: dyn_insertelement_v12f32_s_v_v:
3428 ; GFX10: ; %bb.0: ; %entry
3429 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
3430 ; GFX10-NEXT: v_cndmask_b32_e32 v12, s2, v0, vcc_lo
3431 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
3432 ; GFX10-NEXT: v_cndmask_b32_e32 v13, s3, v0, vcc_lo
3433 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
3434 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
3435 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
3436 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
3437 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
3438 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
3439 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
3440 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
3441 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
3442 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
3443 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
3444 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
3445 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
3446 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
3447 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
3448 ; GFX10-NEXT: v_cndmask_b32_e32 v9, s11, v0, vcc_lo
3449 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v1
3450 ; GFX10-NEXT: v_cndmask_b32_e32 v10, s12, v0, vcc_lo
3451 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 11, v1
3452 ; GFX10-NEXT: v_mov_b32_e32 v1, v13
3453 ; GFX10-NEXT: v_cndmask_b32_e32 v11, s13, v0, vcc_lo
3454 ; GFX10-NEXT: v_mov_b32_e32 v0, v12
3455 ; GFX10-NEXT: ; return to shader part epilog
3457 ; GFX11-LABEL: dyn_insertelement_v12f32_s_v_v:
3458 ; GFX11: ; %bb.0: ; %entry
3459 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
3460 ; GFX11-NEXT: v_cndmask_b32_e32 v12, s2, v0, vcc_lo
3461 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
3462 ; GFX11-NEXT: v_cndmask_b32_e32 v13, s3, v0, vcc_lo
3463 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
3464 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
3465 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
3466 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
3467 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
3468 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
3469 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
3470 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
3471 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
3472 ; GFX11-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
3473 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v1
3474 ; GFX11-NEXT: v_cndmask_b32_e32 v7, s9, v0, vcc_lo
3475 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v1
3476 ; GFX11-NEXT: v_cndmask_b32_e32 v8, s10, v0, vcc_lo
3477 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v1
3478 ; GFX11-NEXT: v_cndmask_b32_e32 v9, s11, v0, vcc_lo
3479 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v1
3480 ; GFX11-NEXT: v_cndmask_b32_e32 v10, s12, v0, vcc_lo
3481 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 11, v1
3482 ; GFX11-NEXT: v_mov_b32_e32 v1, v13
3483 ; GFX11-NEXT: v_dual_cndmask_b32 v11, s13, v0 :: v_dual_mov_b32 v0, v12
3484 ; GFX11-NEXT: ; return to shader part epilog
3486 %insert = insertelement <12 x float> %vec, float %val, i32 %idx
3487 ret <12 x float> %insert
3490 define amdgpu_ps <12 x float> @dyn_insertelement_v12f32_v_v_s(<12 x float> %vec, float %val, i32 inreg %idx) {
3491 ; GPRIDX-LABEL: dyn_insertelement_v12f32_v_v_s:
3492 ; GPRIDX: ; %bb.0: ; %entry
3493 ; GPRIDX-NEXT: s_set_gpr_idx_on s2, gpr_idx(DST)
3494 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v12
3495 ; GPRIDX-NEXT: s_set_gpr_idx_off
3496 ; GPRIDX-NEXT: ; return to shader part epilog
3498 ; GFX10PLUS-LABEL: dyn_insertelement_v12f32_v_v_s:
3499 ; GFX10PLUS: ; %bb.0: ; %entry
3500 ; GFX10PLUS-NEXT: s_mov_b32 m0, s2
3501 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v12
3502 ; GFX10PLUS-NEXT: ; return to shader part epilog
3504 %insert = insertelement <12 x float> %vec, float %val, i32 %idx
3505 ret <12 x float> %insert
3508 define amdgpu_ps <12 x float> @dyn_insertelement_v12f32_v_v_v(<12 x float> %vec, float %val, i32 %idx) {
3509 ; GPRIDX-LABEL: dyn_insertelement_v12f32_v_v_v:
3510 ; GPRIDX: ; %bb.0: ; %entry
3511 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v13
3512 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v12, vcc
3513 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v13
3514 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v12, vcc
3515 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v13
3516 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v12, vcc
3517 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v13
3518 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v12, vcc
3519 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v13
3520 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v12, vcc
3521 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v13
3522 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v12, vcc
3523 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v13
3524 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v12, vcc
3525 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 7, v13
3526 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v12, vcc
3527 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 8, v13
3528 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v12, vcc
3529 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 9, v13
3530 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v12, vcc
3531 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 10, v13
3532 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v10, v12, vcc
3533 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 11, v13
3534 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v11, v12, vcc
3535 ; GPRIDX-NEXT: ; return to shader part epilog
3537 ; GFX10PLUS-LABEL: dyn_insertelement_v12f32_v_v_v:
3538 ; GFX10PLUS: ; %bb.0: ; %entry
3539 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v13
3540 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v12, vcc_lo
3541 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v13
3542 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v12, vcc_lo
3543 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v13
3544 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v12, vcc_lo
3545 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v13
3546 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v12, vcc_lo
3547 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v13
3548 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v12, vcc_lo
3549 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v13
3550 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v12, vcc_lo
3551 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v13
3552 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v12, vcc_lo
3553 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 7, v13
3554 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, v7, v12, vcc_lo
3555 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 8, v13
3556 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v8, v8, v12, vcc_lo
3557 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 9, v13
3558 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v9, v9, v12, vcc_lo
3559 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 10, v13
3560 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v10, v10, v12, vcc_lo
3561 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 11, v13
3562 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v11, v11, v12, vcc_lo
3563 ; GFX10PLUS-NEXT: ; return to shader part epilog
3565 %insert = insertelement <12 x float> %vec, float %val, i32 %idx
3566 ret <12 x float> %insert
3569 define amdgpu_ps <16 x i32> @dyn_insertelement_v16i32_s_s_s(<16 x i32> inreg %vec, i32 inreg %val, i32 inreg %idx) {
3570 ; GPRIDX-LABEL: dyn_insertelement_v16i32_s_s_s:
3571 ; GPRIDX: ; %bb.0: ; %entry
3572 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3573 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3574 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3575 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3576 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3577 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3578 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3579 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3580 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3581 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3582 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3583 ; GPRIDX-NEXT: s_mov_b32 s11, s13
3584 ; GPRIDX-NEXT: s_mov_b32 s12, s14
3585 ; GPRIDX-NEXT: s_mov_b32 s13, s15
3586 ; GPRIDX-NEXT: s_mov_b32 s14, s16
3587 ; GPRIDX-NEXT: s_mov_b32 s15, s17
3588 ; GPRIDX-NEXT: s_mov_b32 m0, s19
3589 ; GPRIDX-NEXT: s_nop 0
3590 ; GPRIDX-NEXT: s_movreld_b32 s0, s18
3591 ; GPRIDX-NEXT: ; return to shader part epilog
3593 ; GFX10PLUS-LABEL: dyn_insertelement_v16i32_s_s_s:
3594 ; GFX10PLUS: ; %bb.0: ; %entry
3595 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
3596 ; GFX10PLUS-NEXT: s_mov_b32 m0, s19
3597 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
3598 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
3599 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
3600 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
3601 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
3602 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
3603 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
3604 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
3605 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
3606 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
3607 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
3608 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
3609 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
3610 ; GFX10PLUS-NEXT: s_mov_b32 s14, s16
3611 ; GFX10PLUS-NEXT: s_mov_b32 s15, s17
3612 ; GFX10PLUS-NEXT: s_movreld_b32 s0, s18
3613 ; GFX10PLUS-NEXT: ; return to shader part epilog
3615 %insert = insertelement <16 x i32> %vec, i32 %val, i32 %idx
3616 ret <16 x i32> %insert
3619 define amdgpu_ps <16 x float> @dyn_insertelement_v16f32_s_s_s(<16 x float> inreg %vec, float inreg %val, i32 inreg %idx) {
3620 ; GPRIDX-LABEL: dyn_insertelement_v16f32_s_s_s:
3621 ; GPRIDX: ; %bb.0: ; %entry
3622 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3623 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3624 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3625 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3626 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3627 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3628 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3629 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3630 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3631 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3632 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3633 ; GPRIDX-NEXT: s_mov_b32 s11, s13
3634 ; GPRIDX-NEXT: s_mov_b32 s12, s14
3635 ; GPRIDX-NEXT: s_mov_b32 s13, s15
3636 ; GPRIDX-NEXT: s_mov_b32 s14, s16
3637 ; GPRIDX-NEXT: s_mov_b32 s15, s17
3638 ; GPRIDX-NEXT: s_mov_b32 m0, s19
3639 ; GPRIDX-NEXT: s_nop 0
3640 ; GPRIDX-NEXT: s_movreld_b32 s0, s18
3641 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
3642 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
3643 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3644 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3645 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3646 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3647 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3648 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3649 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3650 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3651 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3652 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
3653 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s12
3654 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s13
3655 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s14
3656 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s15
3657 ; GPRIDX-NEXT: ; return to shader part epilog
3659 ; GFX10-LABEL: dyn_insertelement_v16f32_s_s_s:
3660 ; GFX10: ; %bb.0: ; %entry
3661 ; GFX10-NEXT: s_mov_b32 s0, s2
3662 ; GFX10-NEXT: s_mov_b32 m0, s19
3663 ; GFX10-NEXT: s_mov_b32 s1, s3
3664 ; GFX10-NEXT: s_mov_b32 s2, s4
3665 ; GFX10-NEXT: s_mov_b32 s3, s5
3666 ; GFX10-NEXT: s_mov_b32 s4, s6
3667 ; GFX10-NEXT: s_mov_b32 s5, s7
3668 ; GFX10-NEXT: s_mov_b32 s6, s8
3669 ; GFX10-NEXT: s_mov_b32 s7, s9
3670 ; GFX10-NEXT: s_mov_b32 s8, s10
3671 ; GFX10-NEXT: s_mov_b32 s9, s11
3672 ; GFX10-NEXT: s_mov_b32 s10, s12
3673 ; GFX10-NEXT: s_mov_b32 s11, s13
3674 ; GFX10-NEXT: s_mov_b32 s12, s14
3675 ; GFX10-NEXT: s_mov_b32 s13, s15
3676 ; GFX10-NEXT: s_mov_b32 s14, s16
3677 ; GFX10-NEXT: s_mov_b32 s15, s17
3678 ; GFX10-NEXT: s_movreld_b32 s0, s18
3679 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3680 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3681 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
3682 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
3683 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
3684 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
3685 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
3686 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
3687 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
3688 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
3689 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
3690 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
3691 ; GFX10-NEXT: v_mov_b32_e32 v12, s12
3692 ; GFX10-NEXT: v_mov_b32_e32 v13, s13
3693 ; GFX10-NEXT: v_mov_b32_e32 v14, s14
3694 ; GFX10-NEXT: v_mov_b32_e32 v15, s15
3695 ; GFX10-NEXT: ; return to shader part epilog
3697 ; GFX11-LABEL: dyn_insertelement_v16f32_s_s_s:
3698 ; GFX11: ; %bb.0: ; %entry
3699 ; GFX11-NEXT: s_mov_b32 s0, s2
3700 ; GFX11-NEXT: s_mov_b32 m0, s19
3701 ; GFX11-NEXT: s_mov_b32 s1, s3
3702 ; GFX11-NEXT: s_mov_b32 s2, s4
3703 ; GFX11-NEXT: s_mov_b32 s3, s5
3704 ; GFX11-NEXT: s_mov_b32 s4, s6
3705 ; GFX11-NEXT: s_mov_b32 s5, s7
3706 ; GFX11-NEXT: s_mov_b32 s6, s8
3707 ; GFX11-NEXT: s_mov_b32 s7, s9
3708 ; GFX11-NEXT: s_mov_b32 s8, s10
3709 ; GFX11-NEXT: s_mov_b32 s9, s11
3710 ; GFX11-NEXT: s_mov_b32 s10, s12
3711 ; GFX11-NEXT: s_mov_b32 s11, s13
3712 ; GFX11-NEXT: s_mov_b32 s12, s14
3713 ; GFX11-NEXT: s_mov_b32 s13, s15
3714 ; GFX11-NEXT: s_mov_b32 s14, s16
3715 ; GFX11-NEXT: s_mov_b32 s15, s17
3716 ; GFX11-NEXT: s_movreld_b32 s0, s18
3717 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3718 ; GFX11-NEXT: v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
3719 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_mov_b32 v5, s5
3720 ; GFX11-NEXT: v_dual_mov_b32 v6, s6 :: v_dual_mov_b32 v7, s7
3721 ; GFX11-NEXT: v_dual_mov_b32 v8, s8 :: v_dual_mov_b32 v9, s9
3722 ; GFX11-NEXT: v_dual_mov_b32 v10, s10 :: v_dual_mov_b32 v11, s11
3723 ; GFX11-NEXT: v_dual_mov_b32 v12, s12 :: v_dual_mov_b32 v13, s13
3724 ; GFX11-NEXT: v_dual_mov_b32 v14, s14 :: v_dual_mov_b32 v15, s15
3725 ; GFX11-NEXT: ; return to shader part epilog
3727 %insert = insertelement <16 x float> %vec, float %val, i32 %idx
3728 ret <16 x float> %insert
3731 define amdgpu_ps <32 x float> @dyn_insertelement_v32f32_s_s_s(<32 x float> inreg %vec, float inreg %val, i32 inreg %idx) {
3732 ; GPRIDX-LABEL: dyn_insertelement_v32f32_s_s_s:
3733 ; GPRIDX: ; %bb.0: ; %entry
3734 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3735 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3736 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3737 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3738 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3739 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3740 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3741 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3742 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3743 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3744 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3745 ; GPRIDX-NEXT: s_mov_b32 s11, s13
3746 ; GPRIDX-NEXT: s_mov_b32 s12, s14
3747 ; GPRIDX-NEXT: s_mov_b32 s13, s15
3748 ; GPRIDX-NEXT: s_mov_b32 s14, s16
3749 ; GPRIDX-NEXT: s_mov_b32 s15, s17
3750 ; GPRIDX-NEXT: s_mov_b32 s16, s18
3751 ; GPRIDX-NEXT: s_mov_b32 s17, s19
3752 ; GPRIDX-NEXT: s_mov_b32 s18, s20
3753 ; GPRIDX-NEXT: s_mov_b32 s19, s21
3754 ; GPRIDX-NEXT: s_mov_b32 s20, s22
3755 ; GPRIDX-NEXT: s_mov_b32 s21, s23
3756 ; GPRIDX-NEXT: s_mov_b32 s22, s24
3757 ; GPRIDX-NEXT: s_mov_b32 s23, s25
3758 ; GPRIDX-NEXT: s_mov_b32 s24, s26
3759 ; GPRIDX-NEXT: s_mov_b32 s25, s27
3760 ; GPRIDX-NEXT: s_mov_b32 s26, s28
3761 ; GPRIDX-NEXT: s_mov_b32 s27, s29
3762 ; GPRIDX-NEXT: s_mov_b32 s28, s30
3763 ; GPRIDX-NEXT: s_mov_b32 s29, s31
3764 ; GPRIDX-NEXT: s_mov_b32 s31, s33
3765 ; GPRIDX-NEXT: s_mov_b32 s30, s32
3766 ; GPRIDX-NEXT: s_mov_b32 m0, s35
3767 ; GPRIDX-NEXT: s_nop 0
3768 ; GPRIDX-NEXT: s_movreld_b32 s0, s34
3769 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
3770 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
3771 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
3772 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
3773 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
3774 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
3775 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
3776 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
3777 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
3778 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
3779 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
3780 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
3781 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s12
3782 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s13
3783 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s14
3784 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s15
3785 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s16
3786 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s17
3787 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s18
3788 ; GPRIDX-NEXT: v_mov_b32_e32 v19, s19
3789 ; GPRIDX-NEXT: v_mov_b32_e32 v20, s20
3790 ; GPRIDX-NEXT: v_mov_b32_e32 v21, s21
3791 ; GPRIDX-NEXT: v_mov_b32_e32 v22, s22
3792 ; GPRIDX-NEXT: v_mov_b32_e32 v23, s23
3793 ; GPRIDX-NEXT: v_mov_b32_e32 v24, s24
3794 ; GPRIDX-NEXT: v_mov_b32_e32 v25, s25
3795 ; GPRIDX-NEXT: v_mov_b32_e32 v26, s26
3796 ; GPRIDX-NEXT: v_mov_b32_e32 v27, s27
3797 ; GPRIDX-NEXT: v_mov_b32_e32 v28, s28
3798 ; GPRIDX-NEXT: v_mov_b32_e32 v29, s29
3799 ; GPRIDX-NEXT: v_mov_b32_e32 v30, s30
3800 ; GPRIDX-NEXT: v_mov_b32_e32 v31, s31
3801 ; GPRIDX-NEXT: ; return to shader part epilog
3803 ; GFX10-LABEL: dyn_insertelement_v32f32_s_s_s:
3804 ; GFX10: ; %bb.0: ; %entry
3805 ; GFX10-NEXT: s_mov_b32 s0, s2
3806 ; GFX10-NEXT: s_mov_b32 m0, s35
3807 ; GFX10-NEXT: s_mov_b32 s1, s3
3808 ; GFX10-NEXT: s_mov_b32 s2, s4
3809 ; GFX10-NEXT: s_mov_b32 s3, s5
3810 ; GFX10-NEXT: s_mov_b32 s4, s6
3811 ; GFX10-NEXT: s_mov_b32 s5, s7
3812 ; GFX10-NEXT: s_mov_b32 s6, s8
3813 ; GFX10-NEXT: s_mov_b32 s7, s9
3814 ; GFX10-NEXT: s_mov_b32 s8, s10
3815 ; GFX10-NEXT: s_mov_b32 s9, s11
3816 ; GFX10-NEXT: s_mov_b32 s10, s12
3817 ; GFX10-NEXT: s_mov_b32 s11, s13
3818 ; GFX10-NEXT: s_mov_b32 s12, s14
3819 ; GFX10-NEXT: s_mov_b32 s13, s15
3820 ; GFX10-NEXT: s_mov_b32 s14, s16
3821 ; GFX10-NEXT: s_mov_b32 s15, s17
3822 ; GFX10-NEXT: s_mov_b32 s16, s18
3823 ; GFX10-NEXT: s_mov_b32 s17, s19
3824 ; GFX10-NEXT: s_mov_b32 s18, s20
3825 ; GFX10-NEXT: s_mov_b32 s19, s21
3826 ; GFX10-NEXT: s_mov_b32 s20, s22
3827 ; GFX10-NEXT: s_mov_b32 s21, s23
3828 ; GFX10-NEXT: s_mov_b32 s22, s24
3829 ; GFX10-NEXT: s_mov_b32 s23, s25
3830 ; GFX10-NEXT: s_mov_b32 s24, s26
3831 ; GFX10-NEXT: s_mov_b32 s25, s27
3832 ; GFX10-NEXT: s_mov_b32 s26, s28
3833 ; GFX10-NEXT: s_mov_b32 s27, s29
3834 ; GFX10-NEXT: s_mov_b32 s28, s30
3835 ; GFX10-NEXT: s_mov_b32 s29, s31
3836 ; GFX10-NEXT: s_mov_b32 s31, s33
3837 ; GFX10-NEXT: s_mov_b32 s30, s32
3838 ; GFX10-NEXT: s_movreld_b32 s0, s34
3839 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
3840 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
3841 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
3842 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
3843 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
3844 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
3845 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
3846 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
3847 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
3848 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
3849 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
3850 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
3851 ; GFX10-NEXT: v_mov_b32_e32 v12, s12
3852 ; GFX10-NEXT: v_mov_b32_e32 v13, s13
3853 ; GFX10-NEXT: v_mov_b32_e32 v14, s14
3854 ; GFX10-NEXT: v_mov_b32_e32 v15, s15
3855 ; GFX10-NEXT: v_mov_b32_e32 v16, s16
3856 ; GFX10-NEXT: v_mov_b32_e32 v17, s17
3857 ; GFX10-NEXT: v_mov_b32_e32 v18, s18
3858 ; GFX10-NEXT: v_mov_b32_e32 v19, s19
3859 ; GFX10-NEXT: v_mov_b32_e32 v20, s20
3860 ; GFX10-NEXT: v_mov_b32_e32 v21, s21
3861 ; GFX10-NEXT: v_mov_b32_e32 v22, s22
3862 ; GFX10-NEXT: v_mov_b32_e32 v23, s23
3863 ; GFX10-NEXT: v_mov_b32_e32 v24, s24
3864 ; GFX10-NEXT: v_mov_b32_e32 v25, s25
3865 ; GFX10-NEXT: v_mov_b32_e32 v26, s26
3866 ; GFX10-NEXT: v_mov_b32_e32 v27, s27
3867 ; GFX10-NEXT: v_mov_b32_e32 v28, s28
3868 ; GFX10-NEXT: v_mov_b32_e32 v29, s29
3869 ; GFX10-NEXT: v_mov_b32_e32 v30, s30
3870 ; GFX10-NEXT: v_mov_b32_e32 v31, s31
3871 ; GFX10-NEXT: ; return to shader part epilog
3873 ; GFX11-LABEL: dyn_insertelement_v32f32_s_s_s:
3874 ; GFX11: ; %bb.0: ; %entry
3875 ; GFX11-NEXT: s_mov_b32 s0, s2
3876 ; GFX11-NEXT: s_mov_b32 m0, s35
3877 ; GFX11-NEXT: s_mov_b32 s1, s3
3878 ; GFX11-NEXT: s_mov_b32 s2, s4
3879 ; GFX11-NEXT: s_mov_b32 s3, s5
3880 ; GFX11-NEXT: s_mov_b32 s4, s6
3881 ; GFX11-NEXT: s_mov_b32 s5, s7
3882 ; GFX11-NEXT: s_mov_b32 s6, s8
3883 ; GFX11-NEXT: s_mov_b32 s7, s9
3884 ; GFX11-NEXT: s_mov_b32 s8, s10
3885 ; GFX11-NEXT: s_mov_b32 s9, s11
3886 ; GFX11-NEXT: s_mov_b32 s10, s12
3887 ; GFX11-NEXT: s_mov_b32 s11, s13
3888 ; GFX11-NEXT: s_mov_b32 s12, s14
3889 ; GFX11-NEXT: s_mov_b32 s13, s15
3890 ; GFX11-NEXT: s_mov_b32 s14, s16
3891 ; GFX11-NEXT: s_mov_b32 s15, s17
3892 ; GFX11-NEXT: s_mov_b32 s16, s18
3893 ; GFX11-NEXT: s_mov_b32 s17, s19
3894 ; GFX11-NEXT: s_mov_b32 s18, s20
3895 ; GFX11-NEXT: s_mov_b32 s19, s21
3896 ; GFX11-NEXT: s_mov_b32 s20, s22
3897 ; GFX11-NEXT: s_mov_b32 s21, s23
3898 ; GFX11-NEXT: s_mov_b32 s22, s24
3899 ; GFX11-NEXT: s_mov_b32 s23, s25
3900 ; GFX11-NEXT: s_mov_b32 s24, s26
3901 ; GFX11-NEXT: s_mov_b32 s25, s27
3902 ; GFX11-NEXT: s_mov_b32 s26, s28
3903 ; GFX11-NEXT: s_mov_b32 s27, s29
3904 ; GFX11-NEXT: s_mov_b32 s28, s30
3905 ; GFX11-NEXT: s_mov_b32 s29, s31
3906 ; GFX11-NEXT: s_mov_b32 s31, s33
3907 ; GFX11-NEXT: s_mov_b32 s30, s32
3908 ; GFX11-NEXT: s_movreld_b32 s0, s34
3909 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1
3910 ; GFX11-NEXT: v_dual_mov_b32 v2, s2 :: v_dual_mov_b32 v3, s3
3911 ; GFX11-NEXT: v_dual_mov_b32 v4, s4 :: v_dual_mov_b32 v5, s5
3912 ; GFX11-NEXT: v_dual_mov_b32 v6, s6 :: v_dual_mov_b32 v7, s7
3913 ; GFX11-NEXT: v_dual_mov_b32 v8, s8 :: v_dual_mov_b32 v9, s9
3914 ; GFX11-NEXT: v_dual_mov_b32 v10, s10 :: v_dual_mov_b32 v11, s11
3915 ; GFX11-NEXT: v_dual_mov_b32 v12, s12 :: v_dual_mov_b32 v13, s13
3916 ; GFX11-NEXT: v_dual_mov_b32 v14, s14 :: v_dual_mov_b32 v15, s15
3917 ; GFX11-NEXT: v_dual_mov_b32 v16, s16 :: v_dual_mov_b32 v17, s17
3918 ; GFX11-NEXT: v_dual_mov_b32 v18, s18 :: v_dual_mov_b32 v19, s19
3919 ; GFX11-NEXT: v_dual_mov_b32 v20, s20 :: v_dual_mov_b32 v21, s21
3920 ; GFX11-NEXT: v_dual_mov_b32 v22, s22 :: v_dual_mov_b32 v23, s23
3921 ; GFX11-NEXT: v_dual_mov_b32 v24, s24 :: v_dual_mov_b32 v25, s25
3922 ; GFX11-NEXT: v_dual_mov_b32 v26, s26 :: v_dual_mov_b32 v27, s27
3923 ; GFX11-NEXT: v_dual_mov_b32 v28, s28 :: v_dual_mov_b32 v29, s29
3924 ; GFX11-NEXT: v_dual_mov_b32 v30, s30 :: v_dual_mov_b32 v31, s31
3925 ; GFX11-NEXT: ; return to shader part epilog
3927 %insert = insertelement <32 x float> %vec, float %val, i32 %idx
3928 ret <32 x float> %insert
3931 define amdgpu_ps <16 x i64> @dyn_insertelement_v16i64_s_s_s(<16 x i64> inreg %vec, i64 inreg %val, i32 inreg %idx) {
3932 ; GPRIDX-LABEL: dyn_insertelement_v16i64_s_s_s:
3933 ; GPRIDX: ; %bb.0: ; %entry
3934 ; GPRIDX-NEXT: s_mov_b32 s0, s2
3935 ; GPRIDX-NEXT: s_mov_b32 s1, s3
3936 ; GPRIDX-NEXT: s_mov_b32 s2, s4
3937 ; GPRIDX-NEXT: s_mov_b32 s3, s5
3938 ; GPRIDX-NEXT: s_mov_b32 s4, s6
3939 ; GPRIDX-NEXT: s_mov_b32 s5, s7
3940 ; GPRIDX-NEXT: s_mov_b32 s6, s8
3941 ; GPRIDX-NEXT: s_mov_b32 s7, s9
3942 ; GPRIDX-NEXT: s_mov_b32 s8, s10
3943 ; GPRIDX-NEXT: s_mov_b32 s9, s11
3944 ; GPRIDX-NEXT: s_mov_b32 s10, s12
3945 ; GPRIDX-NEXT: s_mov_b32 s11, s13
3946 ; GPRIDX-NEXT: s_mov_b32 s12, s14
3947 ; GPRIDX-NEXT: s_mov_b32 s13, s15
3948 ; GPRIDX-NEXT: s_mov_b32 s14, s16
3949 ; GPRIDX-NEXT: s_mov_b32 s15, s17
3950 ; GPRIDX-NEXT: s_mov_b32 s16, s18
3951 ; GPRIDX-NEXT: s_mov_b32 s17, s19
3952 ; GPRIDX-NEXT: s_mov_b32 s18, s20
3953 ; GPRIDX-NEXT: s_mov_b32 s19, s21
3954 ; GPRIDX-NEXT: s_mov_b32 s20, s22
3955 ; GPRIDX-NEXT: s_mov_b32 s21, s23
3956 ; GPRIDX-NEXT: s_mov_b32 s22, s24
3957 ; GPRIDX-NEXT: s_mov_b32 s23, s25
3958 ; GPRIDX-NEXT: s_mov_b32 s24, s26
3959 ; GPRIDX-NEXT: s_mov_b32 s25, s27
3960 ; GPRIDX-NEXT: s_mov_b32 s26, s28
3961 ; GPRIDX-NEXT: s_mov_b32 s27, s29
3962 ; GPRIDX-NEXT: s_mov_b32 s28, s30
3963 ; GPRIDX-NEXT: s_mov_b32 s29, s31
3964 ; GPRIDX-NEXT: s_mov_b32 s31, s33
3965 ; GPRIDX-NEXT: s_mov_b32 s30, s32
3966 ; GPRIDX-NEXT: s_mov_b32 m0, s36
3967 ; GPRIDX-NEXT: s_nop 0
3968 ; GPRIDX-NEXT: s_movreld_b64 s[0:1], s[34:35]
3969 ; GPRIDX-NEXT: ; return to shader part epilog
3971 ; GFX10PLUS-LABEL: dyn_insertelement_v16i64_s_s_s:
3972 ; GFX10PLUS: ; %bb.0: ; %entry
3973 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
3974 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
3975 ; GFX10PLUS-NEXT: s_mov_b32 m0, s36
3976 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
3977 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
3978 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
3979 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
3980 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
3981 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
3982 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
3983 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
3984 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
3985 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
3986 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
3987 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
3988 ; GFX10PLUS-NEXT: s_mov_b32 s14, s16
3989 ; GFX10PLUS-NEXT: s_mov_b32 s15, s17
3990 ; GFX10PLUS-NEXT: s_mov_b32 s16, s18
3991 ; GFX10PLUS-NEXT: s_mov_b32 s17, s19
3992 ; GFX10PLUS-NEXT: s_mov_b32 s18, s20
3993 ; GFX10PLUS-NEXT: s_mov_b32 s19, s21
3994 ; GFX10PLUS-NEXT: s_mov_b32 s20, s22
3995 ; GFX10PLUS-NEXT: s_mov_b32 s21, s23
3996 ; GFX10PLUS-NEXT: s_mov_b32 s22, s24
3997 ; GFX10PLUS-NEXT: s_mov_b32 s23, s25
3998 ; GFX10PLUS-NEXT: s_mov_b32 s24, s26
3999 ; GFX10PLUS-NEXT: s_mov_b32 s25, s27
4000 ; GFX10PLUS-NEXT: s_mov_b32 s26, s28
4001 ; GFX10PLUS-NEXT: s_mov_b32 s27, s29
4002 ; GFX10PLUS-NEXT: s_mov_b32 s28, s30
4003 ; GFX10PLUS-NEXT: s_mov_b32 s29, s31
4004 ; GFX10PLUS-NEXT: s_mov_b32 s31, s33
4005 ; GFX10PLUS-NEXT: s_mov_b32 s30, s32
4006 ; GFX10PLUS-NEXT: s_movreld_b64 s[0:1], s[34:35]
4007 ; GFX10PLUS-NEXT: ; return to shader part epilog
4009 %insert = insertelement <16 x i64> %vec, i64 %val, i32 %idx
4010 ret <16 x i64> %insert
4013 define amdgpu_ps <16 x double> @dyn_insertelement_v16f64_s_s_s(<16 x double> inreg %vec, double inreg %val, i32 inreg %idx) {
4014 ; GPRIDX-LABEL: dyn_insertelement_v16f64_s_s_s:
4015 ; GPRIDX: ; %bb.0: ; %entry
4016 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4017 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4018 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4019 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4020 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4021 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4022 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4023 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4024 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4025 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4026 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4027 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4028 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4029 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4030 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4031 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4032 ; GPRIDX-NEXT: s_mov_b32 s16, s18
4033 ; GPRIDX-NEXT: s_mov_b32 s17, s19
4034 ; GPRIDX-NEXT: s_mov_b32 s18, s20
4035 ; GPRIDX-NEXT: s_mov_b32 s19, s21
4036 ; GPRIDX-NEXT: s_mov_b32 s20, s22
4037 ; GPRIDX-NEXT: s_mov_b32 s21, s23
4038 ; GPRIDX-NEXT: s_mov_b32 s22, s24
4039 ; GPRIDX-NEXT: s_mov_b32 s23, s25
4040 ; GPRIDX-NEXT: s_mov_b32 s24, s26
4041 ; GPRIDX-NEXT: s_mov_b32 s25, s27
4042 ; GPRIDX-NEXT: s_mov_b32 s26, s28
4043 ; GPRIDX-NEXT: s_mov_b32 s27, s29
4044 ; GPRIDX-NEXT: s_mov_b32 s28, s30
4045 ; GPRIDX-NEXT: s_mov_b32 s29, s31
4046 ; GPRIDX-NEXT: s_mov_b32 s31, s33
4047 ; GPRIDX-NEXT: s_mov_b32 s30, s32
4048 ; GPRIDX-NEXT: s_mov_b32 m0, s36
4049 ; GPRIDX-NEXT: s_nop 0
4050 ; GPRIDX-NEXT: s_movreld_b64 s[0:1], s[34:35]
4051 ; GPRIDX-NEXT: ; return to shader part epilog
4053 ; GFX10PLUS-LABEL: dyn_insertelement_v16f64_s_s_s:
4054 ; GFX10PLUS: ; %bb.0: ; %entry
4055 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
4056 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
4057 ; GFX10PLUS-NEXT: s_mov_b32 m0, s36
4058 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
4059 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
4060 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
4061 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
4062 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
4063 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
4064 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
4065 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
4066 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
4067 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
4068 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
4069 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
4070 ; GFX10PLUS-NEXT: s_mov_b32 s14, s16
4071 ; GFX10PLUS-NEXT: s_mov_b32 s15, s17
4072 ; GFX10PLUS-NEXT: s_mov_b32 s16, s18
4073 ; GFX10PLUS-NEXT: s_mov_b32 s17, s19
4074 ; GFX10PLUS-NEXT: s_mov_b32 s18, s20
4075 ; GFX10PLUS-NEXT: s_mov_b32 s19, s21
4076 ; GFX10PLUS-NEXT: s_mov_b32 s20, s22
4077 ; GFX10PLUS-NEXT: s_mov_b32 s21, s23
4078 ; GFX10PLUS-NEXT: s_mov_b32 s22, s24
4079 ; GFX10PLUS-NEXT: s_mov_b32 s23, s25
4080 ; GFX10PLUS-NEXT: s_mov_b32 s24, s26
4081 ; GFX10PLUS-NEXT: s_mov_b32 s25, s27
4082 ; GFX10PLUS-NEXT: s_mov_b32 s26, s28
4083 ; GFX10PLUS-NEXT: s_mov_b32 s27, s29
4084 ; GFX10PLUS-NEXT: s_mov_b32 s28, s30
4085 ; GFX10PLUS-NEXT: s_mov_b32 s29, s31
4086 ; GFX10PLUS-NEXT: s_mov_b32 s31, s33
4087 ; GFX10PLUS-NEXT: s_mov_b32 s30, s32
4088 ; GFX10PLUS-NEXT: s_movreld_b64 s[0:1], s[34:35]
4089 ; GFX10PLUS-NEXT: ; return to shader part epilog
4091 %insert = insertelement <16 x double> %vec, double %val, i32 %idx
4092 ret <16 x double> %insert
4095 define amdgpu_ps <16 x i32> @dyn_insertelement_v16i32_s_v_s(<16 x i32> inreg %vec, i32 %val, i32 inreg %idx) {
4096 ; GPRIDX-LABEL: dyn_insertelement_v16i32_s_v_s:
4097 ; GPRIDX: ; %bb.0: ; %entry
4098 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4099 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4100 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4101 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4102 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4103 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4104 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4105 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4106 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4107 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4108 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4109 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4110 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4111 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4112 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4113 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4114 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s15
4115 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s14
4116 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s13
4117 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s12
4118 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s11
4119 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s10
4120 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s9
4121 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s8
4122 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s7
4123 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s6
4124 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s5
4125 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s4
4126 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s3
4127 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s2
4128 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s1
4129 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s0
4130 ; GPRIDX-NEXT: s_set_gpr_idx_on s18, gpr_idx(DST)
4131 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v0
4132 ; GPRIDX-NEXT: s_set_gpr_idx_off
4133 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v1
4134 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v2
4135 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v3
4136 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v4
4137 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v5
4138 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v6
4139 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v7
4140 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v8
4141 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v9
4142 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v10
4143 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v11
4144 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v12
4145 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v13
4146 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v14
4147 ; GPRIDX-NEXT: v_readfirstlane_b32 s14, v15
4148 ; GPRIDX-NEXT: v_readfirstlane_b32 s15, v16
4149 ; GPRIDX-NEXT: ; return to shader part epilog
4151 ; GFX10-LABEL: dyn_insertelement_v16i32_s_v_s:
4152 ; GFX10: ; %bb.0: ; %entry
4153 ; GFX10-NEXT: s_mov_b32 s1, s3
4154 ; GFX10-NEXT: s_mov_b32 s3, s5
4155 ; GFX10-NEXT: s_mov_b32 s5, s7
4156 ; GFX10-NEXT: s_mov_b32 s7, s9
4157 ; GFX10-NEXT: s_mov_b32 s9, s11
4158 ; GFX10-NEXT: s_mov_b32 s11, s13
4159 ; GFX10-NEXT: s_mov_b32 s13, s15
4160 ; GFX10-NEXT: s_mov_b32 s15, s17
4161 ; GFX10-NEXT: s_mov_b32 s0, s2
4162 ; GFX10-NEXT: s_mov_b32 s2, s4
4163 ; GFX10-NEXT: s_mov_b32 s4, s6
4164 ; GFX10-NEXT: s_mov_b32 s6, s8
4165 ; GFX10-NEXT: s_mov_b32 s8, s10
4166 ; GFX10-NEXT: s_mov_b32 s10, s12
4167 ; GFX10-NEXT: s_mov_b32 s12, s14
4168 ; GFX10-NEXT: s_mov_b32 s14, s16
4169 ; GFX10-NEXT: v_mov_b32_e32 v16, s15
4170 ; GFX10-NEXT: v_mov_b32_e32 v1, s0
4171 ; GFX10-NEXT: s_mov_b32 m0, s18
4172 ; GFX10-NEXT: v_mov_b32_e32 v15, s14
4173 ; GFX10-NEXT: v_mov_b32_e32 v14, s13
4174 ; GFX10-NEXT: v_mov_b32_e32 v13, s12
4175 ; GFX10-NEXT: v_mov_b32_e32 v12, s11
4176 ; GFX10-NEXT: v_mov_b32_e32 v11, s10
4177 ; GFX10-NEXT: v_mov_b32_e32 v10, s9
4178 ; GFX10-NEXT: v_mov_b32_e32 v9, s8
4179 ; GFX10-NEXT: v_mov_b32_e32 v8, s7
4180 ; GFX10-NEXT: v_mov_b32_e32 v7, s6
4181 ; GFX10-NEXT: v_mov_b32_e32 v6, s5
4182 ; GFX10-NEXT: v_mov_b32_e32 v5, s4
4183 ; GFX10-NEXT: v_mov_b32_e32 v4, s3
4184 ; GFX10-NEXT: v_mov_b32_e32 v3, s2
4185 ; GFX10-NEXT: v_mov_b32_e32 v2, s1
4186 ; GFX10-NEXT: v_movreld_b32_e32 v1, v0
4187 ; GFX10-NEXT: v_readfirstlane_b32 s0, v1
4188 ; GFX10-NEXT: v_readfirstlane_b32 s1, v2
4189 ; GFX10-NEXT: v_readfirstlane_b32 s2, v3
4190 ; GFX10-NEXT: v_readfirstlane_b32 s3, v4
4191 ; GFX10-NEXT: v_readfirstlane_b32 s4, v5
4192 ; GFX10-NEXT: v_readfirstlane_b32 s5, v6
4193 ; GFX10-NEXT: v_readfirstlane_b32 s6, v7
4194 ; GFX10-NEXT: v_readfirstlane_b32 s7, v8
4195 ; GFX10-NEXT: v_readfirstlane_b32 s8, v9
4196 ; GFX10-NEXT: v_readfirstlane_b32 s9, v10
4197 ; GFX10-NEXT: v_readfirstlane_b32 s10, v11
4198 ; GFX10-NEXT: v_readfirstlane_b32 s11, v12
4199 ; GFX10-NEXT: v_readfirstlane_b32 s12, v13
4200 ; GFX10-NEXT: v_readfirstlane_b32 s13, v14
4201 ; GFX10-NEXT: v_readfirstlane_b32 s14, v15
4202 ; GFX10-NEXT: v_readfirstlane_b32 s15, v16
4203 ; GFX10-NEXT: ; return to shader part epilog
4205 ; GFX11-LABEL: dyn_insertelement_v16i32_s_v_s:
4206 ; GFX11: ; %bb.0: ; %entry
4207 ; GFX11-NEXT: s_mov_b32 s1, s3
4208 ; GFX11-NEXT: s_mov_b32 s3, s5
4209 ; GFX11-NEXT: s_mov_b32 s5, s7
4210 ; GFX11-NEXT: s_mov_b32 s7, s9
4211 ; GFX11-NEXT: s_mov_b32 s9, s11
4212 ; GFX11-NEXT: s_mov_b32 s11, s13
4213 ; GFX11-NEXT: s_mov_b32 s13, s15
4214 ; GFX11-NEXT: s_mov_b32 s15, s17
4215 ; GFX11-NEXT: s_mov_b32 s0, s2
4216 ; GFX11-NEXT: s_mov_b32 s2, s4
4217 ; GFX11-NEXT: s_mov_b32 s4, s6
4218 ; GFX11-NEXT: s_mov_b32 s6, s8
4219 ; GFX11-NEXT: s_mov_b32 s8, s10
4220 ; GFX11-NEXT: s_mov_b32 s10, s12
4221 ; GFX11-NEXT: s_mov_b32 s12, s14
4222 ; GFX11-NEXT: s_mov_b32 s14, s16
4223 ; GFX11-NEXT: v_dual_mov_b32 v16, s15 :: v_dual_mov_b32 v15, s14
4224 ; GFX11-NEXT: v_dual_mov_b32 v2, s1 :: v_dual_mov_b32 v1, s0
4225 ; GFX11-NEXT: s_mov_b32 m0, s18
4226 ; GFX11-NEXT: v_dual_mov_b32 v14, s13 :: v_dual_mov_b32 v13, s12
4227 ; GFX11-NEXT: v_dual_mov_b32 v12, s11 :: v_dual_mov_b32 v11, s10
4228 ; GFX11-NEXT: v_dual_mov_b32 v10, s9 :: v_dual_mov_b32 v9, s8
4229 ; GFX11-NEXT: v_dual_mov_b32 v8, s7 :: v_dual_mov_b32 v7, s6
4230 ; GFX11-NEXT: v_dual_mov_b32 v6, s5 :: v_dual_mov_b32 v5, s4
4231 ; GFX11-NEXT: v_dual_mov_b32 v4, s3 :: v_dual_mov_b32 v3, s2
4232 ; GFX11-NEXT: v_movreld_b32_e32 v1, v0
4233 ; GFX11-NEXT: v_readfirstlane_b32 s0, v1
4234 ; GFX11-NEXT: v_readfirstlane_b32 s1, v2
4235 ; GFX11-NEXT: v_readfirstlane_b32 s2, v3
4236 ; GFX11-NEXT: v_readfirstlane_b32 s3, v4
4237 ; GFX11-NEXT: v_readfirstlane_b32 s4, v5
4238 ; GFX11-NEXT: v_readfirstlane_b32 s5, v6
4239 ; GFX11-NEXT: v_readfirstlane_b32 s6, v7
4240 ; GFX11-NEXT: v_readfirstlane_b32 s7, v8
4241 ; GFX11-NEXT: v_readfirstlane_b32 s8, v9
4242 ; GFX11-NEXT: v_readfirstlane_b32 s9, v10
4243 ; GFX11-NEXT: v_readfirstlane_b32 s10, v11
4244 ; GFX11-NEXT: v_readfirstlane_b32 s11, v12
4245 ; GFX11-NEXT: v_readfirstlane_b32 s12, v13
4246 ; GFX11-NEXT: v_readfirstlane_b32 s13, v14
4247 ; GFX11-NEXT: v_readfirstlane_b32 s14, v15
4248 ; GFX11-NEXT: v_readfirstlane_b32 s15, v16
4249 ; GFX11-NEXT: ; return to shader part epilog
4251 %insert = insertelement <16 x i32> %vec, i32 %val, i32 %idx
4252 ret <16 x i32> %insert
4255 define amdgpu_ps <16 x float> @dyn_insertelement_v16f32_s_v_s(<16 x float> inreg %vec, float %val, i32 inreg %idx) {
4256 ; GPRIDX-LABEL: dyn_insertelement_v16f32_s_v_s:
4257 ; GPRIDX: ; %bb.0: ; %entry
4258 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4259 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4260 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4261 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4262 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4263 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4264 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4265 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4266 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4267 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4268 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4269 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4270 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4271 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4272 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4273 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4274 ; GPRIDX-NEXT: v_mov_b32_e32 v16, v0
4275 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
4276 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
4277 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
4278 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
4279 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
4280 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
4281 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
4282 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
4283 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
4284 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
4285 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
4286 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
4287 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s12
4288 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s13
4289 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s14
4290 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s15
4291 ; GPRIDX-NEXT: s_set_gpr_idx_on s18, gpr_idx(DST)
4292 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v16
4293 ; GPRIDX-NEXT: s_set_gpr_idx_off
4294 ; GPRIDX-NEXT: ; return to shader part epilog
4296 ; GFX10-LABEL: dyn_insertelement_v16f32_s_v_s:
4297 ; GFX10: ; %bb.0: ; %entry
4298 ; GFX10-NEXT: s_mov_b32 s0, s2
4299 ; GFX10-NEXT: s_mov_b32 s1, s3
4300 ; GFX10-NEXT: s_mov_b32 s2, s4
4301 ; GFX10-NEXT: s_mov_b32 s3, s5
4302 ; GFX10-NEXT: s_mov_b32 s4, s6
4303 ; GFX10-NEXT: s_mov_b32 s5, s7
4304 ; GFX10-NEXT: s_mov_b32 s6, s8
4305 ; GFX10-NEXT: s_mov_b32 s7, s9
4306 ; GFX10-NEXT: s_mov_b32 s8, s10
4307 ; GFX10-NEXT: s_mov_b32 s9, s11
4308 ; GFX10-NEXT: s_mov_b32 s10, s12
4309 ; GFX10-NEXT: s_mov_b32 s11, s13
4310 ; GFX10-NEXT: s_mov_b32 s12, s14
4311 ; GFX10-NEXT: s_mov_b32 s13, s15
4312 ; GFX10-NEXT: s_mov_b32 s14, s16
4313 ; GFX10-NEXT: s_mov_b32 s15, s17
4314 ; GFX10-NEXT: v_mov_b32_e32 v16, v0
4315 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
4316 ; GFX10-NEXT: s_mov_b32 m0, s18
4317 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
4318 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
4319 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
4320 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
4321 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
4322 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
4323 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
4324 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
4325 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
4326 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
4327 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
4328 ; GFX10-NEXT: v_mov_b32_e32 v12, s12
4329 ; GFX10-NEXT: v_mov_b32_e32 v13, s13
4330 ; GFX10-NEXT: v_mov_b32_e32 v14, s14
4331 ; GFX10-NEXT: v_mov_b32_e32 v15, s15
4332 ; GFX10-NEXT: v_movreld_b32_e32 v0, v16
4333 ; GFX10-NEXT: ; return to shader part epilog
4335 ; GFX11-LABEL: dyn_insertelement_v16f32_s_v_s:
4336 ; GFX11: ; %bb.0: ; %entry
4337 ; GFX11-NEXT: s_mov_b32 s0, s2
4338 ; GFX11-NEXT: s_mov_b32 s1, s3
4339 ; GFX11-NEXT: s_mov_b32 s2, s4
4340 ; GFX11-NEXT: s_mov_b32 s3, s5
4341 ; GFX11-NEXT: s_mov_b32 s4, s6
4342 ; GFX11-NEXT: s_mov_b32 s5, s7
4343 ; GFX11-NEXT: s_mov_b32 s6, s8
4344 ; GFX11-NEXT: s_mov_b32 s7, s9
4345 ; GFX11-NEXT: s_mov_b32 s8, s10
4346 ; GFX11-NEXT: s_mov_b32 s9, s11
4347 ; GFX11-NEXT: s_mov_b32 s10, s12
4348 ; GFX11-NEXT: s_mov_b32 s11, s13
4349 ; GFX11-NEXT: s_mov_b32 s12, s14
4350 ; GFX11-NEXT: s_mov_b32 s13, s15
4351 ; GFX11-NEXT: s_mov_b32 s14, s16
4352 ; GFX11-NEXT: s_mov_b32 s15, s17
4353 ; GFX11-NEXT: v_mov_b32_e32 v16, v0
4354 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v3, s3
4355 ; GFX11-NEXT: s_mov_b32 m0, s18
4356 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
4357 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v4, s4
4358 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v6, s6
4359 ; GFX11-NEXT: v_dual_mov_b32 v9, s9 :: v_dual_mov_b32 v8, s8
4360 ; GFX11-NEXT: v_dual_mov_b32 v11, s11 :: v_dual_mov_b32 v10, s10
4361 ; GFX11-NEXT: v_dual_mov_b32 v13, s13 :: v_dual_mov_b32 v12, s12
4362 ; GFX11-NEXT: v_dual_mov_b32 v15, s15 :: v_dual_mov_b32 v14, s14
4363 ; GFX11-NEXT: v_movreld_b32_e32 v0, v16
4364 ; GFX11-NEXT: ; return to shader part epilog
4366 %insert = insertelement <16 x float> %vec, float %val, i32 %idx
4367 ret <16 x float> %insert
4370 define amdgpu_ps <32 x float> @dyn_insertelement_v32f32_s_v_s(<32 x float> inreg %vec, float %val, i32 inreg %idx) {
4371 ; GPRIDX-LABEL: dyn_insertelement_v32f32_s_v_s:
4372 ; GPRIDX: ; %bb.0: ; %entry
4373 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4374 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4375 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4376 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4377 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4378 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4379 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4380 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4381 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4382 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4383 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4384 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4385 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4386 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4387 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4388 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4389 ; GPRIDX-NEXT: s_mov_b32 s16, s18
4390 ; GPRIDX-NEXT: s_mov_b32 s17, s19
4391 ; GPRIDX-NEXT: s_mov_b32 s18, s20
4392 ; GPRIDX-NEXT: s_mov_b32 s19, s21
4393 ; GPRIDX-NEXT: s_mov_b32 s20, s22
4394 ; GPRIDX-NEXT: s_mov_b32 s21, s23
4395 ; GPRIDX-NEXT: s_mov_b32 s22, s24
4396 ; GPRIDX-NEXT: s_mov_b32 s23, s25
4397 ; GPRIDX-NEXT: s_mov_b32 s24, s26
4398 ; GPRIDX-NEXT: s_mov_b32 s25, s27
4399 ; GPRIDX-NEXT: s_mov_b32 s26, s28
4400 ; GPRIDX-NEXT: s_mov_b32 s27, s29
4401 ; GPRIDX-NEXT: s_mov_b32 s28, s30
4402 ; GPRIDX-NEXT: s_mov_b32 s29, s31
4403 ; GPRIDX-NEXT: s_mov_b32 s31, s33
4404 ; GPRIDX-NEXT: s_mov_b32 s30, s32
4405 ; GPRIDX-NEXT: v_mov_b32_e32 v32, v0
4406 ; GPRIDX-NEXT: v_mov_b32_e32 v0, s0
4407 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s1
4408 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
4409 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
4410 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
4411 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
4412 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
4413 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s7
4414 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
4415 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s9
4416 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s10
4417 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s11
4418 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s12
4419 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s13
4420 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s14
4421 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s15
4422 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s16
4423 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s17
4424 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s18
4425 ; GPRIDX-NEXT: v_mov_b32_e32 v19, s19
4426 ; GPRIDX-NEXT: v_mov_b32_e32 v20, s20
4427 ; GPRIDX-NEXT: v_mov_b32_e32 v21, s21
4428 ; GPRIDX-NEXT: v_mov_b32_e32 v22, s22
4429 ; GPRIDX-NEXT: v_mov_b32_e32 v23, s23
4430 ; GPRIDX-NEXT: v_mov_b32_e32 v24, s24
4431 ; GPRIDX-NEXT: v_mov_b32_e32 v25, s25
4432 ; GPRIDX-NEXT: v_mov_b32_e32 v26, s26
4433 ; GPRIDX-NEXT: v_mov_b32_e32 v27, s27
4434 ; GPRIDX-NEXT: v_mov_b32_e32 v28, s28
4435 ; GPRIDX-NEXT: v_mov_b32_e32 v29, s29
4436 ; GPRIDX-NEXT: v_mov_b32_e32 v30, s30
4437 ; GPRIDX-NEXT: v_mov_b32_e32 v31, s31
4438 ; GPRIDX-NEXT: s_set_gpr_idx_on s34, gpr_idx(DST)
4439 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v32
4440 ; GPRIDX-NEXT: s_set_gpr_idx_off
4441 ; GPRIDX-NEXT: ; return to shader part epilog
4443 ; GFX10-LABEL: dyn_insertelement_v32f32_s_v_s:
4444 ; GFX10: ; %bb.0: ; %entry
4445 ; GFX10-NEXT: s_mov_b32 s0, s2
4446 ; GFX10-NEXT: s_mov_b32 s1, s3
4447 ; GFX10-NEXT: s_mov_b32 s2, s4
4448 ; GFX10-NEXT: s_mov_b32 s3, s5
4449 ; GFX10-NEXT: s_mov_b32 s4, s6
4450 ; GFX10-NEXT: s_mov_b32 s5, s7
4451 ; GFX10-NEXT: s_mov_b32 s6, s8
4452 ; GFX10-NEXT: s_mov_b32 s7, s9
4453 ; GFX10-NEXT: s_mov_b32 s8, s10
4454 ; GFX10-NEXT: s_mov_b32 s9, s11
4455 ; GFX10-NEXT: s_mov_b32 s10, s12
4456 ; GFX10-NEXT: s_mov_b32 s11, s13
4457 ; GFX10-NEXT: s_mov_b32 s12, s14
4458 ; GFX10-NEXT: s_mov_b32 s13, s15
4459 ; GFX10-NEXT: s_mov_b32 s14, s16
4460 ; GFX10-NEXT: s_mov_b32 s15, s17
4461 ; GFX10-NEXT: s_mov_b32 s16, s18
4462 ; GFX10-NEXT: s_mov_b32 s17, s19
4463 ; GFX10-NEXT: s_mov_b32 s18, s20
4464 ; GFX10-NEXT: s_mov_b32 s19, s21
4465 ; GFX10-NEXT: s_mov_b32 s20, s22
4466 ; GFX10-NEXT: s_mov_b32 s21, s23
4467 ; GFX10-NEXT: s_mov_b32 s22, s24
4468 ; GFX10-NEXT: s_mov_b32 s23, s25
4469 ; GFX10-NEXT: s_mov_b32 s24, s26
4470 ; GFX10-NEXT: s_mov_b32 s25, s27
4471 ; GFX10-NEXT: s_mov_b32 s26, s28
4472 ; GFX10-NEXT: s_mov_b32 s27, s29
4473 ; GFX10-NEXT: s_mov_b32 s28, s30
4474 ; GFX10-NEXT: s_mov_b32 s29, s31
4475 ; GFX10-NEXT: s_mov_b32 s31, s33
4476 ; GFX10-NEXT: s_mov_b32 s30, s32
4477 ; GFX10-NEXT: v_mov_b32_e32 v32, v0
4478 ; GFX10-NEXT: v_mov_b32_e32 v0, s0
4479 ; GFX10-NEXT: s_mov_b32 m0, s34
4480 ; GFX10-NEXT: v_mov_b32_e32 v1, s1
4481 ; GFX10-NEXT: v_mov_b32_e32 v2, s2
4482 ; GFX10-NEXT: v_mov_b32_e32 v3, s3
4483 ; GFX10-NEXT: v_mov_b32_e32 v4, s4
4484 ; GFX10-NEXT: v_mov_b32_e32 v5, s5
4485 ; GFX10-NEXT: v_mov_b32_e32 v6, s6
4486 ; GFX10-NEXT: v_mov_b32_e32 v7, s7
4487 ; GFX10-NEXT: v_mov_b32_e32 v8, s8
4488 ; GFX10-NEXT: v_mov_b32_e32 v9, s9
4489 ; GFX10-NEXT: v_mov_b32_e32 v10, s10
4490 ; GFX10-NEXT: v_mov_b32_e32 v11, s11
4491 ; GFX10-NEXT: v_mov_b32_e32 v12, s12
4492 ; GFX10-NEXT: v_mov_b32_e32 v13, s13
4493 ; GFX10-NEXT: v_mov_b32_e32 v14, s14
4494 ; GFX10-NEXT: v_mov_b32_e32 v15, s15
4495 ; GFX10-NEXT: v_mov_b32_e32 v16, s16
4496 ; GFX10-NEXT: v_mov_b32_e32 v17, s17
4497 ; GFX10-NEXT: v_mov_b32_e32 v18, s18
4498 ; GFX10-NEXT: v_mov_b32_e32 v19, s19
4499 ; GFX10-NEXT: v_mov_b32_e32 v20, s20
4500 ; GFX10-NEXT: v_mov_b32_e32 v21, s21
4501 ; GFX10-NEXT: v_mov_b32_e32 v22, s22
4502 ; GFX10-NEXT: v_mov_b32_e32 v23, s23
4503 ; GFX10-NEXT: v_mov_b32_e32 v24, s24
4504 ; GFX10-NEXT: v_mov_b32_e32 v25, s25
4505 ; GFX10-NEXT: v_mov_b32_e32 v26, s26
4506 ; GFX10-NEXT: v_mov_b32_e32 v27, s27
4507 ; GFX10-NEXT: v_mov_b32_e32 v28, s28
4508 ; GFX10-NEXT: v_mov_b32_e32 v29, s29
4509 ; GFX10-NEXT: v_mov_b32_e32 v30, s30
4510 ; GFX10-NEXT: v_mov_b32_e32 v31, s31
4511 ; GFX10-NEXT: v_movreld_b32_e32 v0, v32
4512 ; GFX10-NEXT: ; return to shader part epilog
4514 ; GFX11-LABEL: dyn_insertelement_v32f32_s_v_s:
4515 ; GFX11: ; %bb.0: ; %entry
4516 ; GFX11-NEXT: s_mov_b32 s0, s2
4517 ; GFX11-NEXT: s_mov_b32 s1, s3
4518 ; GFX11-NEXT: s_mov_b32 s2, s4
4519 ; GFX11-NEXT: s_mov_b32 s3, s5
4520 ; GFX11-NEXT: s_mov_b32 s4, s6
4521 ; GFX11-NEXT: s_mov_b32 s5, s7
4522 ; GFX11-NEXT: s_mov_b32 s6, s8
4523 ; GFX11-NEXT: s_mov_b32 s7, s9
4524 ; GFX11-NEXT: s_mov_b32 s8, s10
4525 ; GFX11-NEXT: s_mov_b32 s9, s11
4526 ; GFX11-NEXT: s_mov_b32 s10, s12
4527 ; GFX11-NEXT: s_mov_b32 s11, s13
4528 ; GFX11-NEXT: s_mov_b32 s12, s14
4529 ; GFX11-NEXT: s_mov_b32 s13, s15
4530 ; GFX11-NEXT: s_mov_b32 s14, s16
4531 ; GFX11-NEXT: s_mov_b32 s15, s17
4532 ; GFX11-NEXT: s_mov_b32 s16, s18
4533 ; GFX11-NEXT: s_mov_b32 s17, s19
4534 ; GFX11-NEXT: s_mov_b32 s18, s20
4535 ; GFX11-NEXT: s_mov_b32 s19, s21
4536 ; GFX11-NEXT: s_mov_b32 s20, s22
4537 ; GFX11-NEXT: s_mov_b32 s21, s23
4538 ; GFX11-NEXT: s_mov_b32 s22, s24
4539 ; GFX11-NEXT: s_mov_b32 s23, s25
4540 ; GFX11-NEXT: s_mov_b32 s24, s26
4541 ; GFX11-NEXT: s_mov_b32 s25, s27
4542 ; GFX11-NEXT: s_mov_b32 s26, s28
4543 ; GFX11-NEXT: s_mov_b32 s27, s29
4544 ; GFX11-NEXT: s_mov_b32 s28, s30
4545 ; GFX11-NEXT: s_mov_b32 s29, s31
4546 ; GFX11-NEXT: s_mov_b32 s31, s33
4547 ; GFX11-NEXT: s_mov_b32 s30, s32
4548 ; GFX11-NEXT: v_mov_b32_e32 v32, v0
4549 ; GFX11-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v3, s3
4550 ; GFX11-NEXT: s_mov_b32 m0, s34
4551 ; GFX11-NEXT: v_dual_mov_b32 v1, s1 :: v_dual_mov_b32 v2, s2
4552 ; GFX11-NEXT: v_dual_mov_b32 v5, s5 :: v_dual_mov_b32 v4, s4
4553 ; GFX11-NEXT: v_dual_mov_b32 v7, s7 :: v_dual_mov_b32 v6, s6
4554 ; GFX11-NEXT: v_dual_mov_b32 v9, s9 :: v_dual_mov_b32 v8, s8
4555 ; GFX11-NEXT: v_dual_mov_b32 v11, s11 :: v_dual_mov_b32 v10, s10
4556 ; GFX11-NEXT: v_dual_mov_b32 v13, s13 :: v_dual_mov_b32 v12, s12
4557 ; GFX11-NEXT: v_dual_mov_b32 v15, s15 :: v_dual_mov_b32 v14, s14
4558 ; GFX11-NEXT: v_dual_mov_b32 v17, s17 :: v_dual_mov_b32 v16, s16
4559 ; GFX11-NEXT: v_dual_mov_b32 v19, s19 :: v_dual_mov_b32 v18, s18
4560 ; GFX11-NEXT: v_dual_mov_b32 v21, s21 :: v_dual_mov_b32 v20, s20
4561 ; GFX11-NEXT: v_dual_mov_b32 v23, s23 :: v_dual_mov_b32 v22, s22
4562 ; GFX11-NEXT: v_dual_mov_b32 v25, s25 :: v_dual_mov_b32 v24, s24
4563 ; GFX11-NEXT: v_dual_mov_b32 v27, s27 :: v_dual_mov_b32 v26, s26
4564 ; GFX11-NEXT: v_dual_mov_b32 v29, s29 :: v_dual_mov_b32 v28, s28
4565 ; GFX11-NEXT: v_dual_mov_b32 v31, s31 :: v_dual_mov_b32 v30, s30
4566 ; GFX11-NEXT: v_movreld_b32_e32 v0, v32
4567 ; GFX11-NEXT: ; return to shader part epilog
4569 %insert = insertelement <32 x float> %vec, float %val, i32 %idx
4570 ret <32 x float> %insert
4573 define amdgpu_ps <16 x i64> @dyn_insertelement_v16i64_s_v_s(<16 x i64> inreg %vec, i64 %val, i32 inreg %idx) {
4574 ; GPRIDX-LABEL: dyn_insertelement_v16i64_s_v_s:
4575 ; GPRIDX: ; %bb.0: ; %entry
4576 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4577 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4578 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4579 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4580 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4581 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4582 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4583 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4584 ; GPRIDX-NEXT: s_mov_b32 s17, s19
4585 ; GPRIDX-NEXT: s_mov_b32 s19, s21
4586 ; GPRIDX-NEXT: s_mov_b32 s21, s23
4587 ; GPRIDX-NEXT: s_mov_b32 s23, s25
4588 ; GPRIDX-NEXT: s_mov_b32 s25, s27
4589 ; GPRIDX-NEXT: s_mov_b32 s27, s29
4590 ; GPRIDX-NEXT: s_mov_b32 s29, s31
4591 ; GPRIDX-NEXT: s_mov_b32 s31, s33
4592 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4593 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4594 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4595 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4596 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4597 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4598 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4599 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4600 ; GPRIDX-NEXT: s_mov_b32 s16, s18
4601 ; GPRIDX-NEXT: s_mov_b32 s18, s20
4602 ; GPRIDX-NEXT: s_mov_b32 s20, s22
4603 ; GPRIDX-NEXT: s_mov_b32 s22, s24
4604 ; GPRIDX-NEXT: s_mov_b32 s24, s26
4605 ; GPRIDX-NEXT: s_mov_b32 s26, s28
4606 ; GPRIDX-NEXT: s_mov_b32 s28, s30
4607 ; GPRIDX-NEXT: s_mov_b32 s30, s32
4608 ; GPRIDX-NEXT: v_mov_b32_e32 v33, s31
4609 ; GPRIDX-NEXT: s_lshl_b32 s33, s34, 1
4610 ; GPRIDX-NEXT: v_mov_b32_e32 v32, s30
4611 ; GPRIDX-NEXT: v_mov_b32_e32 v31, s29
4612 ; GPRIDX-NEXT: v_mov_b32_e32 v30, s28
4613 ; GPRIDX-NEXT: v_mov_b32_e32 v29, s27
4614 ; GPRIDX-NEXT: v_mov_b32_e32 v28, s26
4615 ; GPRIDX-NEXT: v_mov_b32_e32 v27, s25
4616 ; GPRIDX-NEXT: v_mov_b32_e32 v26, s24
4617 ; GPRIDX-NEXT: v_mov_b32_e32 v25, s23
4618 ; GPRIDX-NEXT: v_mov_b32_e32 v24, s22
4619 ; GPRIDX-NEXT: v_mov_b32_e32 v23, s21
4620 ; GPRIDX-NEXT: v_mov_b32_e32 v22, s20
4621 ; GPRIDX-NEXT: v_mov_b32_e32 v21, s19
4622 ; GPRIDX-NEXT: v_mov_b32_e32 v20, s18
4623 ; GPRIDX-NEXT: v_mov_b32_e32 v19, s17
4624 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s16
4625 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s15
4626 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s14
4627 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s13
4628 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s12
4629 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s11
4630 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s10
4631 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
4632 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
4633 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s7
4634 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s6
4635 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s5
4636 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s4
4637 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s3
4638 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s2
4639 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s1
4640 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s0
4641 ; GPRIDX-NEXT: s_set_gpr_idx_on s33, gpr_idx(DST)
4642 ; GPRIDX-NEXT: v_mov_b32_e32 v2, v0
4643 ; GPRIDX-NEXT: v_mov_b32_e32 v3, v1
4644 ; GPRIDX-NEXT: s_set_gpr_idx_off
4645 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v2
4646 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v3
4647 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v4
4648 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v5
4649 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v6
4650 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v7
4651 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v8
4652 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v9
4653 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v10
4654 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v11
4655 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v12
4656 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v13
4657 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v14
4658 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v15
4659 ; GPRIDX-NEXT: v_readfirstlane_b32 s14, v16
4660 ; GPRIDX-NEXT: v_readfirstlane_b32 s15, v17
4661 ; GPRIDX-NEXT: v_readfirstlane_b32 s16, v18
4662 ; GPRIDX-NEXT: v_readfirstlane_b32 s17, v19
4663 ; GPRIDX-NEXT: v_readfirstlane_b32 s18, v20
4664 ; GPRIDX-NEXT: v_readfirstlane_b32 s19, v21
4665 ; GPRIDX-NEXT: v_readfirstlane_b32 s20, v22
4666 ; GPRIDX-NEXT: v_readfirstlane_b32 s21, v23
4667 ; GPRIDX-NEXT: v_readfirstlane_b32 s22, v24
4668 ; GPRIDX-NEXT: v_readfirstlane_b32 s23, v25
4669 ; GPRIDX-NEXT: v_readfirstlane_b32 s24, v26
4670 ; GPRIDX-NEXT: v_readfirstlane_b32 s25, v27
4671 ; GPRIDX-NEXT: v_readfirstlane_b32 s26, v28
4672 ; GPRIDX-NEXT: v_readfirstlane_b32 s27, v29
4673 ; GPRIDX-NEXT: v_readfirstlane_b32 s28, v30
4674 ; GPRIDX-NEXT: v_readfirstlane_b32 s29, v31
4675 ; GPRIDX-NEXT: v_readfirstlane_b32 s30, v32
4676 ; GPRIDX-NEXT: v_readfirstlane_b32 s31, v33
4677 ; GPRIDX-NEXT: ; return to shader part epilog
4679 ; GFX10-LABEL: dyn_insertelement_v16i64_s_v_s:
4680 ; GFX10: ; %bb.0: ; %entry
4681 ; GFX10-NEXT: s_mov_b32 s1, s3
4682 ; GFX10-NEXT: s_mov_b32 s3, s5
4683 ; GFX10-NEXT: s_mov_b32 s5, s7
4684 ; GFX10-NEXT: s_mov_b32 s7, s9
4685 ; GFX10-NEXT: s_mov_b32 s9, s11
4686 ; GFX10-NEXT: s_mov_b32 s11, s13
4687 ; GFX10-NEXT: s_mov_b32 s13, s15
4688 ; GFX10-NEXT: s_mov_b32 s15, s17
4689 ; GFX10-NEXT: s_mov_b32 s17, s19
4690 ; GFX10-NEXT: s_mov_b32 s19, s21
4691 ; GFX10-NEXT: s_mov_b32 s21, s23
4692 ; GFX10-NEXT: s_mov_b32 s23, s25
4693 ; GFX10-NEXT: s_mov_b32 s25, s27
4694 ; GFX10-NEXT: s_mov_b32 s27, s29
4695 ; GFX10-NEXT: s_mov_b32 s29, s31
4696 ; GFX10-NEXT: s_mov_b32 s31, s33
4697 ; GFX10-NEXT: s_mov_b32 s0, s2
4698 ; GFX10-NEXT: s_mov_b32 s2, s4
4699 ; GFX10-NEXT: s_mov_b32 s4, s6
4700 ; GFX10-NEXT: s_mov_b32 s6, s8
4701 ; GFX10-NEXT: s_mov_b32 s8, s10
4702 ; GFX10-NEXT: s_mov_b32 s10, s12
4703 ; GFX10-NEXT: s_mov_b32 s12, s14
4704 ; GFX10-NEXT: s_mov_b32 s14, s16
4705 ; GFX10-NEXT: s_mov_b32 s16, s18
4706 ; GFX10-NEXT: s_mov_b32 s18, s20
4707 ; GFX10-NEXT: s_mov_b32 s20, s22
4708 ; GFX10-NEXT: s_mov_b32 s22, s24
4709 ; GFX10-NEXT: s_mov_b32 s24, s26
4710 ; GFX10-NEXT: s_mov_b32 s26, s28
4711 ; GFX10-NEXT: s_mov_b32 s28, s30
4712 ; GFX10-NEXT: s_mov_b32 s30, s32
4713 ; GFX10-NEXT: v_mov_b32_e32 v33, s31
4714 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
4715 ; GFX10-NEXT: s_lshl_b32 m0, s34, 1
4716 ; GFX10-NEXT: v_mov_b32_e32 v32, s30
4717 ; GFX10-NEXT: v_mov_b32_e32 v31, s29
4718 ; GFX10-NEXT: v_mov_b32_e32 v30, s28
4719 ; GFX10-NEXT: v_mov_b32_e32 v29, s27
4720 ; GFX10-NEXT: v_mov_b32_e32 v28, s26
4721 ; GFX10-NEXT: v_mov_b32_e32 v27, s25
4722 ; GFX10-NEXT: v_mov_b32_e32 v26, s24
4723 ; GFX10-NEXT: v_mov_b32_e32 v25, s23
4724 ; GFX10-NEXT: v_mov_b32_e32 v24, s22
4725 ; GFX10-NEXT: v_mov_b32_e32 v23, s21
4726 ; GFX10-NEXT: v_mov_b32_e32 v22, s20
4727 ; GFX10-NEXT: v_mov_b32_e32 v21, s19
4728 ; GFX10-NEXT: v_mov_b32_e32 v20, s18
4729 ; GFX10-NEXT: v_mov_b32_e32 v19, s17
4730 ; GFX10-NEXT: v_mov_b32_e32 v18, s16
4731 ; GFX10-NEXT: v_mov_b32_e32 v17, s15
4732 ; GFX10-NEXT: v_mov_b32_e32 v16, s14
4733 ; GFX10-NEXT: v_mov_b32_e32 v15, s13
4734 ; GFX10-NEXT: v_mov_b32_e32 v14, s12
4735 ; GFX10-NEXT: v_mov_b32_e32 v13, s11
4736 ; GFX10-NEXT: v_mov_b32_e32 v12, s10
4737 ; GFX10-NEXT: v_mov_b32_e32 v11, s9
4738 ; GFX10-NEXT: v_mov_b32_e32 v10, s8
4739 ; GFX10-NEXT: v_mov_b32_e32 v9, s7
4740 ; GFX10-NEXT: v_mov_b32_e32 v8, s6
4741 ; GFX10-NEXT: v_mov_b32_e32 v7, s5
4742 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
4743 ; GFX10-NEXT: v_mov_b32_e32 v5, s3
4744 ; GFX10-NEXT: v_mov_b32_e32 v4, s2
4745 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
4746 ; GFX10-NEXT: v_movreld_b32_e32 v2, v0
4747 ; GFX10-NEXT: v_movreld_b32_e32 v3, v1
4748 ; GFX10-NEXT: v_readfirstlane_b32 s0, v2
4749 ; GFX10-NEXT: v_readfirstlane_b32 s1, v3
4750 ; GFX10-NEXT: v_readfirstlane_b32 s2, v4
4751 ; GFX10-NEXT: v_readfirstlane_b32 s3, v5
4752 ; GFX10-NEXT: v_readfirstlane_b32 s4, v6
4753 ; GFX10-NEXT: v_readfirstlane_b32 s5, v7
4754 ; GFX10-NEXT: v_readfirstlane_b32 s6, v8
4755 ; GFX10-NEXT: v_readfirstlane_b32 s7, v9
4756 ; GFX10-NEXT: v_readfirstlane_b32 s8, v10
4757 ; GFX10-NEXT: v_readfirstlane_b32 s9, v11
4758 ; GFX10-NEXT: v_readfirstlane_b32 s10, v12
4759 ; GFX10-NEXT: v_readfirstlane_b32 s11, v13
4760 ; GFX10-NEXT: v_readfirstlane_b32 s12, v14
4761 ; GFX10-NEXT: v_readfirstlane_b32 s13, v15
4762 ; GFX10-NEXT: v_readfirstlane_b32 s14, v16
4763 ; GFX10-NEXT: v_readfirstlane_b32 s15, v17
4764 ; GFX10-NEXT: v_readfirstlane_b32 s16, v18
4765 ; GFX10-NEXT: v_readfirstlane_b32 s17, v19
4766 ; GFX10-NEXT: v_readfirstlane_b32 s18, v20
4767 ; GFX10-NEXT: v_readfirstlane_b32 s19, v21
4768 ; GFX10-NEXT: v_readfirstlane_b32 s20, v22
4769 ; GFX10-NEXT: v_readfirstlane_b32 s21, v23
4770 ; GFX10-NEXT: v_readfirstlane_b32 s22, v24
4771 ; GFX10-NEXT: v_readfirstlane_b32 s23, v25
4772 ; GFX10-NEXT: v_readfirstlane_b32 s24, v26
4773 ; GFX10-NEXT: v_readfirstlane_b32 s25, v27
4774 ; GFX10-NEXT: v_readfirstlane_b32 s26, v28
4775 ; GFX10-NEXT: v_readfirstlane_b32 s27, v29
4776 ; GFX10-NEXT: v_readfirstlane_b32 s28, v30
4777 ; GFX10-NEXT: v_readfirstlane_b32 s29, v31
4778 ; GFX10-NEXT: v_readfirstlane_b32 s30, v32
4779 ; GFX10-NEXT: v_readfirstlane_b32 s31, v33
4780 ; GFX10-NEXT: ; return to shader part epilog
4782 ; GFX11-LABEL: dyn_insertelement_v16i64_s_v_s:
4783 ; GFX11: ; %bb.0: ; %entry
4784 ; GFX11-NEXT: s_mov_b32 s1, s3
4785 ; GFX11-NEXT: s_mov_b32 s3, s5
4786 ; GFX11-NEXT: s_mov_b32 s5, s7
4787 ; GFX11-NEXT: s_mov_b32 s7, s9
4788 ; GFX11-NEXT: s_mov_b32 s9, s11
4789 ; GFX11-NEXT: s_mov_b32 s11, s13
4790 ; GFX11-NEXT: s_mov_b32 s13, s15
4791 ; GFX11-NEXT: s_mov_b32 s15, s17
4792 ; GFX11-NEXT: s_mov_b32 s17, s19
4793 ; GFX11-NEXT: s_mov_b32 s19, s21
4794 ; GFX11-NEXT: s_mov_b32 s21, s23
4795 ; GFX11-NEXT: s_mov_b32 s23, s25
4796 ; GFX11-NEXT: s_mov_b32 s25, s27
4797 ; GFX11-NEXT: s_mov_b32 s27, s29
4798 ; GFX11-NEXT: s_mov_b32 s29, s31
4799 ; GFX11-NEXT: s_mov_b32 s31, s33
4800 ; GFX11-NEXT: s_mov_b32 s0, s2
4801 ; GFX11-NEXT: s_mov_b32 s2, s4
4802 ; GFX11-NEXT: s_mov_b32 s4, s6
4803 ; GFX11-NEXT: s_mov_b32 s6, s8
4804 ; GFX11-NEXT: s_mov_b32 s8, s10
4805 ; GFX11-NEXT: s_mov_b32 s10, s12
4806 ; GFX11-NEXT: s_mov_b32 s12, s14
4807 ; GFX11-NEXT: s_mov_b32 s14, s16
4808 ; GFX11-NEXT: s_mov_b32 s16, s18
4809 ; GFX11-NEXT: s_mov_b32 s18, s20
4810 ; GFX11-NEXT: s_mov_b32 s20, s22
4811 ; GFX11-NEXT: s_mov_b32 s22, s24
4812 ; GFX11-NEXT: s_mov_b32 s24, s26
4813 ; GFX11-NEXT: s_mov_b32 s26, s28
4814 ; GFX11-NEXT: s_mov_b32 s28, s30
4815 ; GFX11-NEXT: s_mov_b32 s30, s32
4816 ; GFX11-NEXT: v_dual_mov_b32 v33, s31 :: v_dual_mov_b32 v32, s30
4817 ; GFX11-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
4818 ; GFX11-NEXT: s_lshl_b32 m0, s34, 1
4819 ; GFX11-NEXT: v_dual_mov_b32 v31, s29 :: v_dual_mov_b32 v30, s28
4820 ; GFX11-NEXT: v_dual_mov_b32 v29, s27 :: v_dual_mov_b32 v28, s26
4821 ; GFX11-NEXT: v_dual_mov_b32 v27, s25 :: v_dual_mov_b32 v26, s24
4822 ; GFX11-NEXT: v_dual_mov_b32 v25, s23 :: v_dual_mov_b32 v24, s22
4823 ; GFX11-NEXT: v_dual_mov_b32 v23, s21 :: v_dual_mov_b32 v22, s20
4824 ; GFX11-NEXT: v_dual_mov_b32 v21, s19 :: v_dual_mov_b32 v20, s18
4825 ; GFX11-NEXT: v_dual_mov_b32 v19, s17 :: v_dual_mov_b32 v18, s16
4826 ; GFX11-NEXT: v_dual_mov_b32 v17, s15 :: v_dual_mov_b32 v16, s14
4827 ; GFX11-NEXT: v_dual_mov_b32 v15, s13 :: v_dual_mov_b32 v14, s12
4828 ; GFX11-NEXT: v_dual_mov_b32 v13, s11 :: v_dual_mov_b32 v12, s10
4829 ; GFX11-NEXT: v_dual_mov_b32 v11, s9 :: v_dual_mov_b32 v10, s8
4830 ; GFX11-NEXT: v_dual_mov_b32 v9, s7 :: v_dual_mov_b32 v8, s6
4831 ; GFX11-NEXT: v_dual_mov_b32 v7, s5 :: v_dual_mov_b32 v6, s4
4832 ; GFX11-NEXT: v_dual_mov_b32 v5, s3 :: v_dual_mov_b32 v4, s2
4833 ; GFX11-NEXT: v_movreld_b32_e32 v2, v0
4834 ; GFX11-NEXT: v_movreld_b32_e32 v3, v1
4835 ; GFX11-NEXT: v_readfirstlane_b32 s0, v2
4836 ; GFX11-NEXT: v_readfirstlane_b32 s1, v3
4837 ; GFX11-NEXT: v_readfirstlane_b32 s2, v4
4838 ; GFX11-NEXT: v_readfirstlane_b32 s3, v5
4839 ; GFX11-NEXT: v_readfirstlane_b32 s4, v6
4840 ; GFX11-NEXT: v_readfirstlane_b32 s5, v7
4841 ; GFX11-NEXT: v_readfirstlane_b32 s6, v8
4842 ; GFX11-NEXT: v_readfirstlane_b32 s7, v9
4843 ; GFX11-NEXT: v_readfirstlane_b32 s8, v10
4844 ; GFX11-NEXT: v_readfirstlane_b32 s9, v11
4845 ; GFX11-NEXT: v_readfirstlane_b32 s10, v12
4846 ; GFX11-NEXT: v_readfirstlane_b32 s11, v13
4847 ; GFX11-NEXT: v_readfirstlane_b32 s12, v14
4848 ; GFX11-NEXT: v_readfirstlane_b32 s13, v15
4849 ; GFX11-NEXT: v_readfirstlane_b32 s14, v16
4850 ; GFX11-NEXT: v_readfirstlane_b32 s15, v17
4851 ; GFX11-NEXT: v_readfirstlane_b32 s16, v18
4852 ; GFX11-NEXT: v_readfirstlane_b32 s17, v19
4853 ; GFX11-NEXT: v_readfirstlane_b32 s18, v20
4854 ; GFX11-NEXT: v_readfirstlane_b32 s19, v21
4855 ; GFX11-NEXT: v_readfirstlane_b32 s20, v22
4856 ; GFX11-NEXT: v_readfirstlane_b32 s21, v23
4857 ; GFX11-NEXT: v_readfirstlane_b32 s22, v24
4858 ; GFX11-NEXT: v_readfirstlane_b32 s23, v25
4859 ; GFX11-NEXT: v_readfirstlane_b32 s24, v26
4860 ; GFX11-NEXT: v_readfirstlane_b32 s25, v27
4861 ; GFX11-NEXT: v_readfirstlane_b32 s26, v28
4862 ; GFX11-NEXT: v_readfirstlane_b32 s27, v29
4863 ; GFX11-NEXT: v_readfirstlane_b32 s28, v30
4864 ; GFX11-NEXT: v_readfirstlane_b32 s29, v31
4865 ; GFX11-NEXT: v_readfirstlane_b32 s30, v32
4866 ; GFX11-NEXT: v_readfirstlane_b32 s31, v33
4867 ; GFX11-NEXT: ; return to shader part epilog
4869 %insert = insertelement <16 x i64> %vec, i64 %val, i32 %idx
4870 ret <16 x i64> %insert
4873 define amdgpu_ps <16 x double> @dyn_insertelement_v16f64_s_v_s(<16 x double> inreg %vec, double %val, i32 inreg %idx) {
4874 ; GPRIDX-LABEL: dyn_insertelement_v16f64_s_v_s:
4875 ; GPRIDX: ; %bb.0: ; %entry
4876 ; GPRIDX-NEXT: s_mov_b32 s1, s3
4877 ; GPRIDX-NEXT: s_mov_b32 s3, s5
4878 ; GPRIDX-NEXT: s_mov_b32 s5, s7
4879 ; GPRIDX-NEXT: s_mov_b32 s7, s9
4880 ; GPRIDX-NEXT: s_mov_b32 s9, s11
4881 ; GPRIDX-NEXT: s_mov_b32 s11, s13
4882 ; GPRIDX-NEXT: s_mov_b32 s13, s15
4883 ; GPRIDX-NEXT: s_mov_b32 s15, s17
4884 ; GPRIDX-NEXT: s_mov_b32 s17, s19
4885 ; GPRIDX-NEXT: s_mov_b32 s19, s21
4886 ; GPRIDX-NEXT: s_mov_b32 s21, s23
4887 ; GPRIDX-NEXT: s_mov_b32 s23, s25
4888 ; GPRIDX-NEXT: s_mov_b32 s25, s27
4889 ; GPRIDX-NEXT: s_mov_b32 s27, s29
4890 ; GPRIDX-NEXT: s_mov_b32 s29, s31
4891 ; GPRIDX-NEXT: s_mov_b32 s31, s33
4892 ; GPRIDX-NEXT: s_mov_b32 s0, s2
4893 ; GPRIDX-NEXT: s_mov_b32 s2, s4
4894 ; GPRIDX-NEXT: s_mov_b32 s4, s6
4895 ; GPRIDX-NEXT: s_mov_b32 s6, s8
4896 ; GPRIDX-NEXT: s_mov_b32 s8, s10
4897 ; GPRIDX-NEXT: s_mov_b32 s10, s12
4898 ; GPRIDX-NEXT: s_mov_b32 s12, s14
4899 ; GPRIDX-NEXT: s_mov_b32 s14, s16
4900 ; GPRIDX-NEXT: s_mov_b32 s16, s18
4901 ; GPRIDX-NEXT: s_mov_b32 s18, s20
4902 ; GPRIDX-NEXT: s_mov_b32 s20, s22
4903 ; GPRIDX-NEXT: s_mov_b32 s22, s24
4904 ; GPRIDX-NEXT: s_mov_b32 s24, s26
4905 ; GPRIDX-NEXT: s_mov_b32 s26, s28
4906 ; GPRIDX-NEXT: s_mov_b32 s28, s30
4907 ; GPRIDX-NEXT: s_mov_b32 s30, s32
4908 ; GPRIDX-NEXT: v_mov_b32_e32 v33, s31
4909 ; GPRIDX-NEXT: s_lshl_b32 s33, s34, 1
4910 ; GPRIDX-NEXT: v_mov_b32_e32 v32, s30
4911 ; GPRIDX-NEXT: v_mov_b32_e32 v31, s29
4912 ; GPRIDX-NEXT: v_mov_b32_e32 v30, s28
4913 ; GPRIDX-NEXT: v_mov_b32_e32 v29, s27
4914 ; GPRIDX-NEXT: v_mov_b32_e32 v28, s26
4915 ; GPRIDX-NEXT: v_mov_b32_e32 v27, s25
4916 ; GPRIDX-NEXT: v_mov_b32_e32 v26, s24
4917 ; GPRIDX-NEXT: v_mov_b32_e32 v25, s23
4918 ; GPRIDX-NEXT: v_mov_b32_e32 v24, s22
4919 ; GPRIDX-NEXT: v_mov_b32_e32 v23, s21
4920 ; GPRIDX-NEXT: v_mov_b32_e32 v22, s20
4921 ; GPRIDX-NEXT: v_mov_b32_e32 v21, s19
4922 ; GPRIDX-NEXT: v_mov_b32_e32 v20, s18
4923 ; GPRIDX-NEXT: v_mov_b32_e32 v19, s17
4924 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s16
4925 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s15
4926 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s14
4927 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s13
4928 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s12
4929 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s11
4930 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s10
4931 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
4932 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
4933 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s7
4934 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s6
4935 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s5
4936 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s4
4937 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s3
4938 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s2
4939 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s1
4940 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s0
4941 ; GPRIDX-NEXT: s_set_gpr_idx_on s33, gpr_idx(DST)
4942 ; GPRIDX-NEXT: v_mov_b32_e32 v2, v0
4943 ; GPRIDX-NEXT: v_mov_b32_e32 v3, v1
4944 ; GPRIDX-NEXT: s_set_gpr_idx_off
4945 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v2
4946 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v3
4947 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v4
4948 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v5
4949 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v6
4950 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v7
4951 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v8
4952 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v9
4953 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v10
4954 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v11
4955 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v12
4956 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v13
4957 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v14
4958 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v15
4959 ; GPRIDX-NEXT: v_readfirstlane_b32 s14, v16
4960 ; GPRIDX-NEXT: v_readfirstlane_b32 s15, v17
4961 ; GPRIDX-NEXT: v_readfirstlane_b32 s16, v18
4962 ; GPRIDX-NEXT: v_readfirstlane_b32 s17, v19
4963 ; GPRIDX-NEXT: v_readfirstlane_b32 s18, v20
4964 ; GPRIDX-NEXT: v_readfirstlane_b32 s19, v21
4965 ; GPRIDX-NEXT: v_readfirstlane_b32 s20, v22
4966 ; GPRIDX-NEXT: v_readfirstlane_b32 s21, v23
4967 ; GPRIDX-NEXT: v_readfirstlane_b32 s22, v24
4968 ; GPRIDX-NEXT: v_readfirstlane_b32 s23, v25
4969 ; GPRIDX-NEXT: v_readfirstlane_b32 s24, v26
4970 ; GPRIDX-NEXT: v_readfirstlane_b32 s25, v27
4971 ; GPRIDX-NEXT: v_readfirstlane_b32 s26, v28
4972 ; GPRIDX-NEXT: v_readfirstlane_b32 s27, v29
4973 ; GPRIDX-NEXT: v_readfirstlane_b32 s28, v30
4974 ; GPRIDX-NEXT: v_readfirstlane_b32 s29, v31
4975 ; GPRIDX-NEXT: v_readfirstlane_b32 s30, v32
4976 ; GPRIDX-NEXT: v_readfirstlane_b32 s31, v33
4977 ; GPRIDX-NEXT: ; return to shader part epilog
4979 ; GFX10-LABEL: dyn_insertelement_v16f64_s_v_s:
4980 ; GFX10: ; %bb.0: ; %entry
4981 ; GFX10-NEXT: s_mov_b32 s1, s3
4982 ; GFX10-NEXT: s_mov_b32 s3, s5
4983 ; GFX10-NEXT: s_mov_b32 s5, s7
4984 ; GFX10-NEXT: s_mov_b32 s7, s9
4985 ; GFX10-NEXT: s_mov_b32 s9, s11
4986 ; GFX10-NEXT: s_mov_b32 s11, s13
4987 ; GFX10-NEXT: s_mov_b32 s13, s15
4988 ; GFX10-NEXT: s_mov_b32 s15, s17
4989 ; GFX10-NEXT: s_mov_b32 s17, s19
4990 ; GFX10-NEXT: s_mov_b32 s19, s21
4991 ; GFX10-NEXT: s_mov_b32 s21, s23
4992 ; GFX10-NEXT: s_mov_b32 s23, s25
4993 ; GFX10-NEXT: s_mov_b32 s25, s27
4994 ; GFX10-NEXT: s_mov_b32 s27, s29
4995 ; GFX10-NEXT: s_mov_b32 s29, s31
4996 ; GFX10-NEXT: s_mov_b32 s31, s33
4997 ; GFX10-NEXT: s_mov_b32 s0, s2
4998 ; GFX10-NEXT: s_mov_b32 s2, s4
4999 ; GFX10-NEXT: s_mov_b32 s4, s6
5000 ; GFX10-NEXT: s_mov_b32 s6, s8
5001 ; GFX10-NEXT: s_mov_b32 s8, s10
5002 ; GFX10-NEXT: s_mov_b32 s10, s12
5003 ; GFX10-NEXT: s_mov_b32 s12, s14
5004 ; GFX10-NEXT: s_mov_b32 s14, s16
5005 ; GFX10-NEXT: s_mov_b32 s16, s18
5006 ; GFX10-NEXT: s_mov_b32 s18, s20
5007 ; GFX10-NEXT: s_mov_b32 s20, s22
5008 ; GFX10-NEXT: s_mov_b32 s22, s24
5009 ; GFX10-NEXT: s_mov_b32 s24, s26
5010 ; GFX10-NEXT: s_mov_b32 s26, s28
5011 ; GFX10-NEXT: s_mov_b32 s28, s30
5012 ; GFX10-NEXT: s_mov_b32 s30, s32
5013 ; GFX10-NEXT: v_mov_b32_e32 v33, s31
5014 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
5015 ; GFX10-NEXT: s_lshl_b32 m0, s34, 1
5016 ; GFX10-NEXT: v_mov_b32_e32 v32, s30
5017 ; GFX10-NEXT: v_mov_b32_e32 v31, s29
5018 ; GFX10-NEXT: v_mov_b32_e32 v30, s28
5019 ; GFX10-NEXT: v_mov_b32_e32 v29, s27
5020 ; GFX10-NEXT: v_mov_b32_e32 v28, s26
5021 ; GFX10-NEXT: v_mov_b32_e32 v27, s25
5022 ; GFX10-NEXT: v_mov_b32_e32 v26, s24
5023 ; GFX10-NEXT: v_mov_b32_e32 v25, s23
5024 ; GFX10-NEXT: v_mov_b32_e32 v24, s22
5025 ; GFX10-NEXT: v_mov_b32_e32 v23, s21
5026 ; GFX10-NEXT: v_mov_b32_e32 v22, s20
5027 ; GFX10-NEXT: v_mov_b32_e32 v21, s19
5028 ; GFX10-NEXT: v_mov_b32_e32 v20, s18
5029 ; GFX10-NEXT: v_mov_b32_e32 v19, s17
5030 ; GFX10-NEXT: v_mov_b32_e32 v18, s16
5031 ; GFX10-NEXT: v_mov_b32_e32 v17, s15
5032 ; GFX10-NEXT: v_mov_b32_e32 v16, s14
5033 ; GFX10-NEXT: v_mov_b32_e32 v15, s13
5034 ; GFX10-NEXT: v_mov_b32_e32 v14, s12
5035 ; GFX10-NEXT: v_mov_b32_e32 v13, s11
5036 ; GFX10-NEXT: v_mov_b32_e32 v12, s10
5037 ; GFX10-NEXT: v_mov_b32_e32 v11, s9
5038 ; GFX10-NEXT: v_mov_b32_e32 v10, s8
5039 ; GFX10-NEXT: v_mov_b32_e32 v9, s7
5040 ; GFX10-NEXT: v_mov_b32_e32 v8, s6
5041 ; GFX10-NEXT: v_mov_b32_e32 v7, s5
5042 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
5043 ; GFX10-NEXT: v_mov_b32_e32 v5, s3
5044 ; GFX10-NEXT: v_mov_b32_e32 v4, s2
5045 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
5046 ; GFX10-NEXT: v_movreld_b32_e32 v2, v0
5047 ; GFX10-NEXT: v_movreld_b32_e32 v3, v1
5048 ; GFX10-NEXT: v_readfirstlane_b32 s0, v2
5049 ; GFX10-NEXT: v_readfirstlane_b32 s1, v3
5050 ; GFX10-NEXT: v_readfirstlane_b32 s2, v4
5051 ; GFX10-NEXT: v_readfirstlane_b32 s3, v5
5052 ; GFX10-NEXT: v_readfirstlane_b32 s4, v6
5053 ; GFX10-NEXT: v_readfirstlane_b32 s5, v7
5054 ; GFX10-NEXT: v_readfirstlane_b32 s6, v8
5055 ; GFX10-NEXT: v_readfirstlane_b32 s7, v9
5056 ; GFX10-NEXT: v_readfirstlane_b32 s8, v10
5057 ; GFX10-NEXT: v_readfirstlane_b32 s9, v11
5058 ; GFX10-NEXT: v_readfirstlane_b32 s10, v12
5059 ; GFX10-NEXT: v_readfirstlane_b32 s11, v13
5060 ; GFX10-NEXT: v_readfirstlane_b32 s12, v14
5061 ; GFX10-NEXT: v_readfirstlane_b32 s13, v15
5062 ; GFX10-NEXT: v_readfirstlane_b32 s14, v16
5063 ; GFX10-NEXT: v_readfirstlane_b32 s15, v17
5064 ; GFX10-NEXT: v_readfirstlane_b32 s16, v18
5065 ; GFX10-NEXT: v_readfirstlane_b32 s17, v19
5066 ; GFX10-NEXT: v_readfirstlane_b32 s18, v20
5067 ; GFX10-NEXT: v_readfirstlane_b32 s19, v21
5068 ; GFX10-NEXT: v_readfirstlane_b32 s20, v22
5069 ; GFX10-NEXT: v_readfirstlane_b32 s21, v23
5070 ; GFX10-NEXT: v_readfirstlane_b32 s22, v24
5071 ; GFX10-NEXT: v_readfirstlane_b32 s23, v25
5072 ; GFX10-NEXT: v_readfirstlane_b32 s24, v26
5073 ; GFX10-NEXT: v_readfirstlane_b32 s25, v27
5074 ; GFX10-NEXT: v_readfirstlane_b32 s26, v28
5075 ; GFX10-NEXT: v_readfirstlane_b32 s27, v29
5076 ; GFX10-NEXT: v_readfirstlane_b32 s28, v30
5077 ; GFX10-NEXT: v_readfirstlane_b32 s29, v31
5078 ; GFX10-NEXT: v_readfirstlane_b32 s30, v32
5079 ; GFX10-NEXT: v_readfirstlane_b32 s31, v33
5080 ; GFX10-NEXT: ; return to shader part epilog
5082 ; GFX11-LABEL: dyn_insertelement_v16f64_s_v_s:
5083 ; GFX11: ; %bb.0: ; %entry
5084 ; GFX11-NEXT: s_mov_b32 s1, s3
5085 ; GFX11-NEXT: s_mov_b32 s3, s5
5086 ; GFX11-NEXT: s_mov_b32 s5, s7
5087 ; GFX11-NEXT: s_mov_b32 s7, s9
5088 ; GFX11-NEXT: s_mov_b32 s9, s11
5089 ; GFX11-NEXT: s_mov_b32 s11, s13
5090 ; GFX11-NEXT: s_mov_b32 s13, s15
5091 ; GFX11-NEXT: s_mov_b32 s15, s17
5092 ; GFX11-NEXT: s_mov_b32 s17, s19
5093 ; GFX11-NEXT: s_mov_b32 s19, s21
5094 ; GFX11-NEXT: s_mov_b32 s21, s23
5095 ; GFX11-NEXT: s_mov_b32 s23, s25
5096 ; GFX11-NEXT: s_mov_b32 s25, s27
5097 ; GFX11-NEXT: s_mov_b32 s27, s29
5098 ; GFX11-NEXT: s_mov_b32 s29, s31
5099 ; GFX11-NEXT: s_mov_b32 s31, s33
5100 ; GFX11-NEXT: s_mov_b32 s0, s2
5101 ; GFX11-NEXT: s_mov_b32 s2, s4
5102 ; GFX11-NEXT: s_mov_b32 s4, s6
5103 ; GFX11-NEXT: s_mov_b32 s6, s8
5104 ; GFX11-NEXT: s_mov_b32 s8, s10
5105 ; GFX11-NEXT: s_mov_b32 s10, s12
5106 ; GFX11-NEXT: s_mov_b32 s12, s14
5107 ; GFX11-NEXT: s_mov_b32 s14, s16
5108 ; GFX11-NEXT: s_mov_b32 s16, s18
5109 ; GFX11-NEXT: s_mov_b32 s18, s20
5110 ; GFX11-NEXT: s_mov_b32 s20, s22
5111 ; GFX11-NEXT: s_mov_b32 s22, s24
5112 ; GFX11-NEXT: s_mov_b32 s24, s26
5113 ; GFX11-NEXT: s_mov_b32 s26, s28
5114 ; GFX11-NEXT: s_mov_b32 s28, s30
5115 ; GFX11-NEXT: s_mov_b32 s30, s32
5116 ; GFX11-NEXT: v_dual_mov_b32 v33, s31 :: v_dual_mov_b32 v32, s30
5117 ; GFX11-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
5118 ; GFX11-NEXT: s_lshl_b32 m0, s34, 1
5119 ; GFX11-NEXT: v_dual_mov_b32 v31, s29 :: v_dual_mov_b32 v30, s28
5120 ; GFX11-NEXT: v_dual_mov_b32 v29, s27 :: v_dual_mov_b32 v28, s26
5121 ; GFX11-NEXT: v_dual_mov_b32 v27, s25 :: v_dual_mov_b32 v26, s24
5122 ; GFX11-NEXT: v_dual_mov_b32 v25, s23 :: v_dual_mov_b32 v24, s22
5123 ; GFX11-NEXT: v_dual_mov_b32 v23, s21 :: v_dual_mov_b32 v22, s20
5124 ; GFX11-NEXT: v_dual_mov_b32 v21, s19 :: v_dual_mov_b32 v20, s18
5125 ; GFX11-NEXT: v_dual_mov_b32 v19, s17 :: v_dual_mov_b32 v18, s16
5126 ; GFX11-NEXT: v_dual_mov_b32 v17, s15 :: v_dual_mov_b32 v16, s14
5127 ; GFX11-NEXT: v_dual_mov_b32 v15, s13 :: v_dual_mov_b32 v14, s12
5128 ; GFX11-NEXT: v_dual_mov_b32 v13, s11 :: v_dual_mov_b32 v12, s10
5129 ; GFX11-NEXT: v_dual_mov_b32 v11, s9 :: v_dual_mov_b32 v10, s8
5130 ; GFX11-NEXT: v_dual_mov_b32 v9, s7 :: v_dual_mov_b32 v8, s6
5131 ; GFX11-NEXT: v_dual_mov_b32 v7, s5 :: v_dual_mov_b32 v6, s4
5132 ; GFX11-NEXT: v_dual_mov_b32 v5, s3 :: v_dual_mov_b32 v4, s2
5133 ; GFX11-NEXT: v_movreld_b32_e32 v2, v0
5134 ; GFX11-NEXT: v_movreld_b32_e32 v3, v1
5135 ; GFX11-NEXT: v_readfirstlane_b32 s0, v2
5136 ; GFX11-NEXT: v_readfirstlane_b32 s1, v3
5137 ; GFX11-NEXT: v_readfirstlane_b32 s2, v4
5138 ; GFX11-NEXT: v_readfirstlane_b32 s3, v5
5139 ; GFX11-NEXT: v_readfirstlane_b32 s4, v6
5140 ; GFX11-NEXT: v_readfirstlane_b32 s5, v7
5141 ; GFX11-NEXT: v_readfirstlane_b32 s6, v8
5142 ; GFX11-NEXT: v_readfirstlane_b32 s7, v9
5143 ; GFX11-NEXT: v_readfirstlane_b32 s8, v10
5144 ; GFX11-NEXT: v_readfirstlane_b32 s9, v11
5145 ; GFX11-NEXT: v_readfirstlane_b32 s10, v12
5146 ; GFX11-NEXT: v_readfirstlane_b32 s11, v13
5147 ; GFX11-NEXT: v_readfirstlane_b32 s12, v14
5148 ; GFX11-NEXT: v_readfirstlane_b32 s13, v15
5149 ; GFX11-NEXT: v_readfirstlane_b32 s14, v16
5150 ; GFX11-NEXT: v_readfirstlane_b32 s15, v17
5151 ; GFX11-NEXT: v_readfirstlane_b32 s16, v18
5152 ; GFX11-NEXT: v_readfirstlane_b32 s17, v19
5153 ; GFX11-NEXT: v_readfirstlane_b32 s18, v20
5154 ; GFX11-NEXT: v_readfirstlane_b32 s19, v21
5155 ; GFX11-NEXT: v_readfirstlane_b32 s20, v22
5156 ; GFX11-NEXT: v_readfirstlane_b32 s21, v23
5157 ; GFX11-NEXT: v_readfirstlane_b32 s22, v24
5158 ; GFX11-NEXT: v_readfirstlane_b32 s23, v25
5159 ; GFX11-NEXT: v_readfirstlane_b32 s24, v26
5160 ; GFX11-NEXT: v_readfirstlane_b32 s25, v27
5161 ; GFX11-NEXT: v_readfirstlane_b32 s26, v28
5162 ; GFX11-NEXT: v_readfirstlane_b32 s27, v29
5163 ; GFX11-NEXT: v_readfirstlane_b32 s28, v30
5164 ; GFX11-NEXT: v_readfirstlane_b32 s29, v31
5165 ; GFX11-NEXT: v_readfirstlane_b32 s30, v32
5166 ; GFX11-NEXT: v_readfirstlane_b32 s31, v33
5167 ; GFX11-NEXT: ; return to shader part epilog
5169 %insert = insertelement <16 x double> %vec, double %val, i32 %idx
5170 ret <16 x double> %insert
5173 define amdgpu_ps <7 x i32> @dyn_insertelement_v7i32_s_s_s(<7 x i32> inreg %vec, i32 inreg %val, i32 inreg %idx) {
5174 ; GPRIDX-LABEL: dyn_insertelement_v7i32_s_s_s:
5175 ; GPRIDX: ; %bb.0: ; %entry
5176 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 0
5177 ; GPRIDX-NEXT: s_cselect_b32 s0, s9, s2
5178 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 1
5179 ; GPRIDX-NEXT: s_cselect_b32 s1, s9, s3
5180 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 2
5181 ; GPRIDX-NEXT: s_cselect_b32 s2, s9, s4
5182 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 3
5183 ; GPRIDX-NEXT: s_cselect_b32 s3, s9, s5
5184 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 4
5185 ; GPRIDX-NEXT: s_cselect_b32 s4, s9, s6
5186 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 5
5187 ; GPRIDX-NEXT: s_cselect_b32 s5, s9, s7
5188 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 6
5189 ; GPRIDX-NEXT: s_cselect_b32 s6, s9, s8
5190 ; GPRIDX-NEXT: ; return to shader part epilog
5192 ; GFX10PLUS-LABEL: dyn_insertelement_v7i32_s_s_s:
5193 ; GFX10PLUS: ; %bb.0: ; %entry
5194 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 0
5195 ; GFX10PLUS-NEXT: s_cselect_b32 s0, s9, s2
5196 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 1
5197 ; GFX10PLUS-NEXT: s_cselect_b32 s1, s9, s3
5198 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 2
5199 ; GFX10PLUS-NEXT: s_cselect_b32 s2, s9, s4
5200 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 3
5201 ; GFX10PLUS-NEXT: s_cselect_b32 s3, s9, s5
5202 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 4
5203 ; GFX10PLUS-NEXT: s_cselect_b32 s4, s9, s6
5204 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 5
5205 ; GFX10PLUS-NEXT: s_cselect_b32 s5, s9, s7
5206 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 6
5207 ; GFX10PLUS-NEXT: s_cselect_b32 s6, s9, s8
5208 ; GFX10PLUS-NEXT: ; return to shader part epilog
5210 %insert = insertelement <7 x i32> %vec, i32 %val, i32 %idx
5211 ret <7 x i32> %insert
5214 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) {
5215 ; GPRIDX-LABEL: dyn_insertelement_v7p3i8_s_s_s:
5216 ; GPRIDX: ; %bb.0: ; %entry
5217 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 0
5218 ; GPRIDX-NEXT: s_cselect_b32 s0, s9, s2
5219 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 1
5220 ; GPRIDX-NEXT: s_cselect_b32 s1, s9, s3
5221 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 2
5222 ; GPRIDX-NEXT: s_cselect_b32 s2, s9, s4
5223 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 3
5224 ; GPRIDX-NEXT: s_cselect_b32 s3, s9, s5
5225 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 4
5226 ; GPRIDX-NEXT: s_cselect_b32 s4, s9, s6
5227 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 5
5228 ; GPRIDX-NEXT: s_cselect_b32 s5, s9, s7
5229 ; GPRIDX-NEXT: s_cmp_eq_u32 s10, 6
5230 ; GPRIDX-NEXT: s_cselect_b32 s6, s9, s8
5231 ; GPRIDX-NEXT: ; return to shader part epilog
5233 ; GFX10PLUS-LABEL: dyn_insertelement_v7p3i8_s_s_s:
5234 ; GFX10PLUS: ; %bb.0: ; %entry
5235 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 0
5236 ; GFX10PLUS-NEXT: s_cselect_b32 s0, s9, s2
5237 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 1
5238 ; GFX10PLUS-NEXT: s_cselect_b32 s1, s9, s3
5239 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 2
5240 ; GFX10PLUS-NEXT: s_cselect_b32 s2, s9, s4
5241 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 3
5242 ; GFX10PLUS-NEXT: s_cselect_b32 s3, s9, s5
5243 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 4
5244 ; GFX10PLUS-NEXT: s_cselect_b32 s4, s9, s6
5245 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 5
5246 ; GFX10PLUS-NEXT: s_cselect_b32 s5, s9, s7
5247 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s10, 6
5248 ; GFX10PLUS-NEXT: s_cselect_b32 s6, s9, s8
5249 ; GFX10PLUS-NEXT: ; return to shader part epilog
5251 %insert = insertelement <7 x ptr addrspace(3)> %vec, ptr addrspace(3) %val, i32 %idx
5252 ret <7 x ptr addrspace(3)> %insert
5255 define amdgpu_ps <7 x float> @dyn_insertelement_v7f32_s_v_s(<7 x float> inreg %vec, float %val, i32 inreg %idx) {
5256 ; GPRIDX-LABEL: dyn_insertelement_v7f32_s_v_s:
5257 ; GPRIDX: ; %bb.0: ; %entry
5258 ; GPRIDX-NEXT: v_mov_b32_e32 v1, s2
5259 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 0
5260 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s3
5261 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v1, v0, vcc
5262 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 1
5263 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s4
5264 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v2, v0, vcc
5265 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 2
5266 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s5
5267 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v3, v0, vcc
5268 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 3
5269 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s6
5270 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v4, v0, vcc
5271 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 4
5272 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s7
5273 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v5, v0, vcc
5274 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 5
5275 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s8
5276 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v6, v0, vcc
5277 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s9, 6
5278 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v8, v0, vcc
5279 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v7
5280 ; GPRIDX-NEXT: ; return to shader part epilog
5282 ; GFX10PLUS-LABEL: dyn_insertelement_v7f32_s_v_s:
5283 ; GFX10PLUS: ; %bb.0: ; %entry
5284 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 0
5285 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v7, s2, v0, vcc_lo
5286 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 1
5287 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, s3, v0, vcc_lo
5288 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 2
5289 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
5290 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 3
5291 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
5292 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 4
5293 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
5294 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 5
5295 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
5296 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s9, 6
5297 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
5298 ; GFX10PLUS-NEXT: v_mov_b32_e32 v0, v7
5299 ; GFX10PLUS-NEXT: ; return to shader part epilog
5301 %insert = insertelement <7 x float> %vec, float %val, i32 %idx
5302 ret <7 x float> %insert
5305 define amdgpu_ps <7 x float> @dyn_insertelement_v7f32_s_v_v(<7 x float> inreg %vec, float %val, i32 %idx) {
5306 ; GPRIDX-LABEL: dyn_insertelement_v7f32_s_v_v:
5307 ; GPRIDX: ; %bb.0: ; %entry
5308 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s2
5309 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v1
5310 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s3
5311 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v2, v0, vcc
5312 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v1
5313 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s4
5314 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v3, v0, vcc
5315 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v1
5316 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s5
5317 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v4, v0, vcc
5318 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v1
5319 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s6
5320 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v5, v0, vcc
5321 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v1
5322 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s7
5323 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v6, v0, vcc
5324 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v1
5325 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
5326 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v9, v0, vcc
5327 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v1
5328 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v10, v0, vcc
5329 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v8
5330 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v7
5331 ; GPRIDX-NEXT: ; return to shader part epilog
5333 ; GFX10-LABEL: dyn_insertelement_v7f32_s_v_v:
5334 ; GFX10: ; %bb.0: ; %entry
5335 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
5336 ; GFX10-NEXT: v_cndmask_b32_e32 v8, s2, v0, vcc_lo
5337 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
5338 ; GFX10-NEXT: v_cndmask_b32_e32 v7, s3, v0, vcc_lo
5339 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
5340 ; GFX10-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
5341 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
5342 ; GFX10-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
5343 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
5344 ; GFX10-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
5345 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
5346 ; GFX10-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
5347 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
5348 ; GFX10-NEXT: v_mov_b32_e32 v1, v7
5349 ; GFX10-NEXT: v_cndmask_b32_e32 v6, s8, v0, vcc_lo
5350 ; GFX10-NEXT: v_mov_b32_e32 v0, v8
5351 ; GFX10-NEXT: ; return to shader part epilog
5353 ; GFX11-LABEL: dyn_insertelement_v7f32_s_v_v:
5354 ; GFX11: ; %bb.0: ; %entry
5355 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v1
5356 ; GFX11-NEXT: v_cndmask_b32_e32 v8, s2, v0, vcc_lo
5357 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v1
5358 ; GFX11-NEXT: v_cndmask_b32_e32 v7, s3, v0, vcc_lo
5359 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v1
5360 ; GFX11-NEXT: v_cndmask_b32_e32 v2, s4, v0, vcc_lo
5361 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v1
5362 ; GFX11-NEXT: v_cndmask_b32_e32 v3, s5, v0, vcc_lo
5363 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v1
5364 ; GFX11-NEXT: v_cndmask_b32_e32 v4, s6, v0, vcc_lo
5365 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v1
5366 ; GFX11-NEXT: v_cndmask_b32_e32 v5, s7, v0, vcc_lo
5367 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v1
5368 ; GFX11-NEXT: v_dual_mov_b32 v1, v7 :: v_dual_cndmask_b32 v6, s8, v0
5369 ; GFX11-NEXT: v_mov_b32_e32 v0, v8
5370 ; GFX11-NEXT: ; return to shader part epilog
5372 %insert = insertelement <7 x float> %vec, float %val, i32 %idx
5373 ret <7 x float> %insert
5376 define amdgpu_ps <7 x float> @dyn_insertelement_v7f32_v_v_s(<7 x float> %vec, float %val, i32 inreg %idx) {
5377 ; GPRIDX-LABEL: dyn_insertelement_v7f32_v_v_s:
5378 ; GPRIDX: ; %bb.0: ; %entry
5379 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 0
5380 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v7, vcc
5381 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 1
5382 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v7, vcc
5383 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 2
5384 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v7, vcc
5385 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 3
5386 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v7, vcc
5387 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 4
5388 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v7, vcc
5389 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 5
5390 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc
5391 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 6
5392 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc
5393 ; GPRIDX-NEXT: ; return to shader part epilog
5395 ; GFX10PLUS-LABEL: dyn_insertelement_v7f32_v_v_s:
5396 ; GFX10PLUS: ; %bb.0: ; %entry
5397 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 0
5398 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v7, vcc_lo
5399 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 1
5400 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v7, vcc_lo
5401 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 2
5402 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v7, vcc_lo
5403 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 3
5404 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v7, vcc_lo
5405 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 4
5406 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v7, vcc_lo
5407 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 5
5408 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc_lo
5409 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 6
5410 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc_lo
5411 ; GFX10PLUS-NEXT: ; return to shader part epilog
5413 %insert = insertelement <7 x float> %vec, float %val, i32 %idx
5414 ret <7 x float> %insert
5417 define amdgpu_ps <7 x float> @dyn_insertelement_v7f32_v_v_v(<7 x float> %vec, float %val, i32 %idx) {
5418 ; GPRIDX-LABEL: dyn_insertelement_v7f32_v_v_v:
5419 ; GPRIDX: ; %bb.0: ; %entry
5420 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v8
5421 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v7, vcc
5422 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v8
5423 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v7, vcc
5424 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v8
5425 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v7, vcc
5426 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v8
5427 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v7, vcc
5428 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v8
5429 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v7, vcc
5430 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v8
5431 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc
5432 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v8
5433 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc
5434 ; GPRIDX-NEXT: ; return to shader part epilog
5436 ; GFX10PLUS-LABEL: dyn_insertelement_v7f32_v_v_v:
5437 ; GFX10PLUS: ; %bb.0: ; %entry
5438 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v8
5439 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v0, v0, v7, vcc_lo
5440 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 1, v8
5441 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v1, v1, v7, vcc_lo
5442 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v8
5443 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v2, v2, v7, vcc_lo
5444 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 3, v8
5445 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v3, v3, v7, vcc_lo
5446 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v8
5447 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v4, v4, v7, vcc_lo
5448 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 5, v8
5449 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v5, v5, v7, vcc_lo
5450 ; GFX10PLUS-NEXT: v_cmp_eq_u32_e32 vcc_lo, 6, v8
5451 ; GFX10PLUS-NEXT: v_cndmask_b32_e32 v6, v6, v7, vcc_lo
5452 ; GFX10PLUS-NEXT: ; return to shader part epilog
5454 %insert = insertelement <7 x float> %vec, float %val, i32 %idx
5455 ret <7 x float> %insert
5458 define amdgpu_ps <7 x double> @dyn_insertelement_v7f64_s_s_s(<7 x double> inreg %vec, double inreg %val, i32 inreg %idx) {
5459 ; GPRIDX-LABEL: dyn_insertelement_v7f64_s_s_s:
5460 ; GPRIDX: ; %bb.0: ; %entry
5461 ; GPRIDX-NEXT: s_mov_b32 s0, s2
5462 ; GPRIDX-NEXT: s_mov_b32 s1, s3
5463 ; GPRIDX-NEXT: s_mov_b32 s2, s4
5464 ; GPRIDX-NEXT: s_mov_b32 s3, s5
5465 ; GPRIDX-NEXT: s_mov_b32 s4, s6
5466 ; GPRIDX-NEXT: s_mov_b32 s5, s7
5467 ; GPRIDX-NEXT: s_mov_b32 s6, s8
5468 ; GPRIDX-NEXT: s_mov_b32 s7, s9
5469 ; GPRIDX-NEXT: s_mov_b32 s8, s10
5470 ; GPRIDX-NEXT: s_mov_b32 s9, s11
5471 ; GPRIDX-NEXT: s_mov_b32 s10, s12
5472 ; GPRIDX-NEXT: s_mov_b32 s11, s13
5473 ; GPRIDX-NEXT: s_mov_b32 s12, s14
5474 ; GPRIDX-NEXT: s_mov_b32 s13, s15
5475 ; GPRIDX-NEXT: s_mov_b32 m0, s18
5476 ; GPRIDX-NEXT: s_nop 0
5477 ; GPRIDX-NEXT: s_movreld_b64 s[0:1], s[16:17]
5478 ; GPRIDX-NEXT: ; return to shader part epilog
5480 ; GFX10PLUS-LABEL: dyn_insertelement_v7f64_s_s_s:
5481 ; GFX10PLUS: ; %bb.0: ; %entry
5482 ; GFX10PLUS-NEXT: s_mov_b32 s0, s2
5483 ; GFX10PLUS-NEXT: s_mov_b32 s1, s3
5484 ; GFX10PLUS-NEXT: s_mov_b32 m0, s18
5485 ; GFX10PLUS-NEXT: s_mov_b32 s2, s4
5486 ; GFX10PLUS-NEXT: s_mov_b32 s3, s5
5487 ; GFX10PLUS-NEXT: s_mov_b32 s4, s6
5488 ; GFX10PLUS-NEXT: s_mov_b32 s5, s7
5489 ; GFX10PLUS-NEXT: s_mov_b32 s6, s8
5490 ; GFX10PLUS-NEXT: s_mov_b32 s7, s9
5491 ; GFX10PLUS-NEXT: s_mov_b32 s8, s10
5492 ; GFX10PLUS-NEXT: s_mov_b32 s9, s11
5493 ; GFX10PLUS-NEXT: s_mov_b32 s10, s12
5494 ; GFX10PLUS-NEXT: s_mov_b32 s11, s13
5495 ; GFX10PLUS-NEXT: s_mov_b32 s12, s14
5496 ; GFX10PLUS-NEXT: s_mov_b32 s13, s15
5497 ; GFX10PLUS-NEXT: s_movreld_b64 s[0:1], s[16:17]
5498 ; GFX10PLUS-NEXT: ; return to shader part epilog
5500 %insert = insertelement <7 x double> %vec, double %val, i32 %idx
5501 ret <7 x double> %insert
5504 define amdgpu_ps <7 x double> @dyn_insertelement_v7f64_s_v_s(<7 x double> inreg %vec, double %val, i32 inreg %idx) {
5505 ; GPRIDX-LABEL: dyn_insertelement_v7f64_s_v_s:
5506 ; GPRIDX: ; %bb.0: ; %entry
5507 ; GPRIDX-NEXT: s_mov_b32 s0, s2
5508 ; GPRIDX-NEXT: s_mov_b32 s1, s3
5509 ; GPRIDX-NEXT: s_mov_b32 s2, s4
5510 ; GPRIDX-NEXT: s_mov_b32 s3, s5
5511 ; GPRIDX-NEXT: s_mov_b32 s4, s6
5512 ; GPRIDX-NEXT: s_mov_b32 s5, s7
5513 ; GPRIDX-NEXT: s_mov_b32 s6, s8
5514 ; GPRIDX-NEXT: s_mov_b32 s7, s9
5515 ; GPRIDX-NEXT: s_mov_b32 s8, s10
5516 ; GPRIDX-NEXT: s_mov_b32 s9, s11
5517 ; GPRIDX-NEXT: s_mov_b32 s10, s12
5518 ; GPRIDX-NEXT: s_mov_b32 s11, s13
5519 ; GPRIDX-NEXT: s_mov_b32 s12, s14
5520 ; GPRIDX-NEXT: s_mov_b32 s13, s15
5521 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s15
5522 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s14
5523 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s13
5524 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s12
5525 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s11
5526 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s10
5527 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
5528 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
5529 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s7
5530 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s6
5531 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s5
5532 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s4
5533 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s3
5534 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s2
5535 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s1
5536 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s0
5537 ; GPRIDX-NEXT: s_lshl_b32 s0, s16, 1
5538 ; GPRIDX-NEXT: s_set_gpr_idx_on s0, gpr_idx(DST)
5539 ; GPRIDX-NEXT: v_mov_b32_e32 v2, v0
5540 ; GPRIDX-NEXT: v_mov_b32_e32 v3, v1
5541 ; GPRIDX-NEXT: s_set_gpr_idx_off
5542 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v2
5543 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v3
5544 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v4
5545 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v5
5546 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v6
5547 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v7
5548 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v8
5549 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v9
5550 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v10
5551 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v11
5552 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v12
5553 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v13
5554 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v14
5555 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v15
5556 ; GPRIDX-NEXT: ; return to shader part epilog
5558 ; GFX10-LABEL: dyn_insertelement_v7f64_s_v_s:
5559 ; GFX10: ; %bb.0: ; %entry
5560 ; GFX10-NEXT: s_mov_b32 s0, s2
5561 ; GFX10-NEXT: s_mov_b32 s1, s3
5562 ; GFX10-NEXT: s_mov_b32 s2, s4
5563 ; GFX10-NEXT: s_mov_b32 s3, s5
5564 ; GFX10-NEXT: s_mov_b32 s4, s6
5565 ; GFX10-NEXT: s_mov_b32 s5, s7
5566 ; GFX10-NEXT: s_mov_b32 s6, s8
5567 ; GFX10-NEXT: s_mov_b32 s7, s9
5568 ; GFX10-NEXT: s_mov_b32 s8, s10
5569 ; GFX10-NEXT: s_mov_b32 s9, s11
5570 ; GFX10-NEXT: s_mov_b32 s10, s12
5571 ; GFX10-NEXT: s_mov_b32 s11, s13
5572 ; GFX10-NEXT: s_mov_b32 s12, s14
5573 ; GFX10-NEXT: s_mov_b32 s13, s15
5574 ; GFX10-NEXT: v_mov_b32_e32 v17, s15
5575 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
5576 ; GFX10-NEXT: s_lshl_b32 m0, s16, 1
5577 ; GFX10-NEXT: v_mov_b32_e32 v16, s14
5578 ; GFX10-NEXT: v_mov_b32_e32 v15, s13
5579 ; GFX10-NEXT: v_mov_b32_e32 v14, s12
5580 ; GFX10-NEXT: v_mov_b32_e32 v13, s11
5581 ; GFX10-NEXT: v_mov_b32_e32 v12, s10
5582 ; GFX10-NEXT: v_mov_b32_e32 v11, s9
5583 ; GFX10-NEXT: v_mov_b32_e32 v10, s8
5584 ; GFX10-NEXT: v_mov_b32_e32 v9, s7
5585 ; GFX10-NEXT: v_mov_b32_e32 v8, s6
5586 ; GFX10-NEXT: v_mov_b32_e32 v7, s5
5587 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
5588 ; GFX10-NEXT: v_mov_b32_e32 v5, s3
5589 ; GFX10-NEXT: v_mov_b32_e32 v4, s2
5590 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
5591 ; GFX10-NEXT: v_movreld_b32_e32 v2, v0
5592 ; GFX10-NEXT: v_movreld_b32_e32 v3, v1
5593 ; GFX10-NEXT: v_readfirstlane_b32 s0, v2
5594 ; GFX10-NEXT: v_readfirstlane_b32 s1, v3
5595 ; GFX10-NEXT: v_readfirstlane_b32 s2, v4
5596 ; GFX10-NEXT: v_readfirstlane_b32 s3, v5
5597 ; GFX10-NEXT: v_readfirstlane_b32 s4, v6
5598 ; GFX10-NEXT: v_readfirstlane_b32 s5, v7
5599 ; GFX10-NEXT: v_readfirstlane_b32 s6, v8
5600 ; GFX10-NEXT: v_readfirstlane_b32 s7, v9
5601 ; GFX10-NEXT: v_readfirstlane_b32 s8, v10
5602 ; GFX10-NEXT: v_readfirstlane_b32 s9, v11
5603 ; GFX10-NEXT: v_readfirstlane_b32 s10, v12
5604 ; GFX10-NEXT: v_readfirstlane_b32 s11, v13
5605 ; GFX10-NEXT: v_readfirstlane_b32 s12, v14
5606 ; GFX10-NEXT: v_readfirstlane_b32 s13, v15
5607 ; GFX10-NEXT: ; return to shader part epilog
5609 ; GFX11-LABEL: dyn_insertelement_v7f64_s_v_s:
5610 ; GFX11: ; %bb.0: ; %entry
5611 ; GFX11-NEXT: s_mov_b32 s0, s2
5612 ; GFX11-NEXT: s_mov_b32 s1, s3
5613 ; GFX11-NEXT: s_mov_b32 s2, s4
5614 ; GFX11-NEXT: s_mov_b32 s3, s5
5615 ; GFX11-NEXT: s_mov_b32 s4, s6
5616 ; GFX11-NEXT: s_mov_b32 s5, s7
5617 ; GFX11-NEXT: s_mov_b32 s6, s8
5618 ; GFX11-NEXT: s_mov_b32 s7, s9
5619 ; GFX11-NEXT: s_mov_b32 s8, s10
5620 ; GFX11-NEXT: s_mov_b32 s9, s11
5621 ; GFX11-NEXT: s_mov_b32 s10, s12
5622 ; GFX11-NEXT: s_mov_b32 s11, s13
5623 ; GFX11-NEXT: s_mov_b32 s12, s14
5624 ; GFX11-NEXT: s_mov_b32 s13, s15
5625 ; GFX11-NEXT: v_dual_mov_b32 v17, s15 :: v_dual_mov_b32 v16, s14
5626 ; GFX11-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
5627 ; GFX11-NEXT: s_lshl_b32 m0, s16, 1
5628 ; GFX11-NEXT: v_dual_mov_b32 v15, s13 :: v_dual_mov_b32 v14, s12
5629 ; GFX11-NEXT: v_dual_mov_b32 v13, s11 :: v_dual_mov_b32 v12, s10
5630 ; GFX11-NEXT: v_dual_mov_b32 v11, s9 :: v_dual_mov_b32 v10, s8
5631 ; GFX11-NEXT: v_dual_mov_b32 v9, s7 :: v_dual_mov_b32 v8, s6
5632 ; GFX11-NEXT: v_dual_mov_b32 v7, s5 :: v_dual_mov_b32 v6, s4
5633 ; GFX11-NEXT: v_dual_mov_b32 v5, s3 :: v_dual_mov_b32 v4, s2
5634 ; GFX11-NEXT: v_movreld_b32_e32 v2, v0
5635 ; GFX11-NEXT: v_movreld_b32_e32 v3, v1
5636 ; GFX11-NEXT: v_readfirstlane_b32 s0, v2
5637 ; GFX11-NEXT: v_readfirstlane_b32 s1, v3
5638 ; GFX11-NEXT: v_readfirstlane_b32 s2, v4
5639 ; GFX11-NEXT: v_readfirstlane_b32 s3, v5
5640 ; GFX11-NEXT: v_readfirstlane_b32 s4, v6
5641 ; GFX11-NEXT: v_readfirstlane_b32 s5, v7
5642 ; GFX11-NEXT: v_readfirstlane_b32 s6, v8
5643 ; GFX11-NEXT: v_readfirstlane_b32 s7, v9
5644 ; GFX11-NEXT: v_readfirstlane_b32 s8, v10
5645 ; GFX11-NEXT: v_readfirstlane_b32 s9, v11
5646 ; GFX11-NEXT: v_readfirstlane_b32 s10, v12
5647 ; GFX11-NEXT: v_readfirstlane_b32 s11, v13
5648 ; GFX11-NEXT: v_readfirstlane_b32 s12, v14
5649 ; GFX11-NEXT: v_readfirstlane_b32 s13, v15
5650 ; GFX11-NEXT: ; return to shader part epilog
5652 %insert = insertelement <7 x double> %vec, double %val, i32 %idx
5653 ret <7 x double> %insert
5656 define amdgpu_ps <7 x double> @dyn_insertelement_v7f64_s_v_v(<7 x double> inreg %vec, double %val, i32 %idx) {
5657 ; GPRIDX-LABEL: dyn_insertelement_v7f64_s_v_v:
5658 ; GPRIDX: ; %bb.0: ; %entry
5659 ; GPRIDX-NEXT: s_mov_b32 s0, s2
5660 ; GPRIDX-NEXT: s_mov_b32 s1, s3
5661 ; GPRIDX-NEXT: s_mov_b32 s2, s4
5662 ; GPRIDX-NEXT: s_mov_b32 s3, s5
5663 ; GPRIDX-NEXT: s_mov_b32 s4, s6
5664 ; GPRIDX-NEXT: s_mov_b32 s5, s7
5665 ; GPRIDX-NEXT: s_mov_b32 s6, s8
5666 ; GPRIDX-NEXT: s_mov_b32 s7, s9
5667 ; GPRIDX-NEXT: s_mov_b32 s8, s10
5668 ; GPRIDX-NEXT: s_mov_b32 s9, s11
5669 ; GPRIDX-NEXT: s_mov_b32 s10, s12
5670 ; GPRIDX-NEXT: s_mov_b32 s11, s13
5671 ; GPRIDX-NEXT: s_mov_b32 s12, s14
5672 ; GPRIDX-NEXT: s_mov_b32 s13, s15
5673 ; GPRIDX-NEXT: v_mov_b32_e32 v18, s15
5674 ; GPRIDX-NEXT: v_mov_b32_e32 v17, s14
5675 ; GPRIDX-NEXT: v_mov_b32_e32 v16, s13
5676 ; GPRIDX-NEXT: v_mov_b32_e32 v15, s12
5677 ; GPRIDX-NEXT: v_mov_b32_e32 v14, s11
5678 ; GPRIDX-NEXT: v_mov_b32_e32 v13, s10
5679 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s9
5680 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s8
5681 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s7
5682 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s6
5683 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s5
5684 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s4
5685 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s3
5686 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s2
5687 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s1
5688 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s0
5689 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v2
5690 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[0:1], 2, v2
5691 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[2:3], 3, v2
5692 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[4:5], 4, v2
5693 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[6:7], 5, v2
5694 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[8:9], 6, v2
5695 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[10:11], 1, v2
5696 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc
5697 ; GPRIDX-NEXT: v_cndmask_b32_e64 v2, v5, v0, s[10:11]
5698 ; GPRIDX-NEXT: v_cndmask_b32_e64 v5, v7, v0, s[0:1]
5699 ; GPRIDX-NEXT: v_cndmask_b32_e64 v7, v9, v0, s[2:3]
5700 ; GPRIDX-NEXT: v_cndmask_b32_e64 v9, v11, v0, s[4:5]
5701 ; GPRIDX-NEXT: v_cndmask_b32_e64 v11, v13, v0, s[6:7]
5702 ; GPRIDX-NEXT: v_cndmask_b32_e64 v0, v15, v0, s[8:9]
5703 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v1, vcc
5704 ; GPRIDX-NEXT: v_cndmask_b32_e64 v6, v6, v1, s[10:11]
5705 ; GPRIDX-NEXT: v_cndmask_b32_e64 v8, v8, v1, s[0:1]
5706 ; GPRIDX-NEXT: v_cndmask_b32_e64 v10, v10, v1, s[2:3]
5707 ; GPRIDX-NEXT: v_cndmask_b32_e64 v12, v12, v1, s[4:5]
5708 ; GPRIDX-NEXT: v_cndmask_b32_e64 v13, v14, v1, s[6:7]
5709 ; GPRIDX-NEXT: v_cndmask_b32_e64 v1, v16, v1, s[8:9]
5710 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v3
5711 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v4
5712 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v2
5713 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v6
5714 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v5
5715 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v8
5716 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v7
5717 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v10
5718 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v9
5719 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v12
5720 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v11
5721 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v13
5722 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v0
5723 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v1
5724 ; GPRIDX-NEXT: ; return to shader part epilog
5726 ; GFX10-LABEL: dyn_insertelement_v7f64_s_v_v:
5727 ; GFX10: ; %bb.0: ; %entry
5728 ; GFX10-NEXT: s_mov_b32 s0, s2
5729 ; GFX10-NEXT: s_mov_b32 s1, s3
5730 ; GFX10-NEXT: s_mov_b32 s2, s4
5731 ; GFX10-NEXT: s_mov_b32 s3, s5
5732 ; GFX10-NEXT: s_mov_b32 s4, s6
5733 ; GFX10-NEXT: s_mov_b32 s5, s7
5734 ; GFX10-NEXT: s_mov_b32 s6, s8
5735 ; GFX10-NEXT: s_mov_b32 s7, s9
5736 ; GFX10-NEXT: s_mov_b32 s8, s10
5737 ; GFX10-NEXT: s_mov_b32 s9, s11
5738 ; GFX10-NEXT: s_mov_b32 s10, s12
5739 ; GFX10-NEXT: s_mov_b32 s11, s13
5740 ; GFX10-NEXT: s_mov_b32 s12, s14
5741 ; GFX10-NEXT: s_mov_b32 s13, s15
5742 ; GFX10-NEXT: v_mov_b32_e32 v18, s15
5743 ; GFX10-NEXT: v_mov_b32_e32 v17, s14
5744 ; GFX10-NEXT: v_mov_b32_e32 v16, s13
5745 ; GFX10-NEXT: v_mov_b32_e32 v15, s12
5746 ; GFX10-NEXT: v_mov_b32_e32 v14, s11
5747 ; GFX10-NEXT: v_mov_b32_e32 v13, s10
5748 ; GFX10-NEXT: v_mov_b32_e32 v12, s9
5749 ; GFX10-NEXT: v_mov_b32_e32 v11, s8
5750 ; GFX10-NEXT: v_mov_b32_e32 v10, s7
5751 ; GFX10-NEXT: v_mov_b32_e32 v9, s6
5752 ; GFX10-NEXT: v_mov_b32_e32 v8, s5
5753 ; GFX10-NEXT: v_mov_b32_e32 v7, s4
5754 ; GFX10-NEXT: v_mov_b32_e32 v6, s3
5755 ; GFX10-NEXT: v_mov_b32_e32 v5, s2
5756 ; GFX10-NEXT: v_mov_b32_e32 v4, s1
5757 ; GFX10-NEXT: v_mov_b32_e32 v3, s0
5758 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
5759 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 1, v2
5760 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 6, v2
5761 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc_lo
5762 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v1, vcc_lo
5763 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
5764 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, v0, s0
5765 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v1, s0
5766 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 3, v2
5767 ; GFX10-NEXT: v_cndmask_b32_e32 v7, v7, v0, vcc_lo
5768 ; GFX10-NEXT: v_cndmask_b32_e32 v8, v8, v1, vcc_lo
5769 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v2
5770 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v0, s0
5771 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, v1, s0
5772 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 5, v2
5773 ; GFX10-NEXT: v_readfirstlane_b32 s2, v5
5774 ; GFX10-NEXT: v_cndmask_b32_e32 v11, v11, v0, vcc_lo
5775 ; GFX10-NEXT: v_cndmask_b32_e32 v2, v12, v1, vcc_lo
5776 ; GFX10-NEXT: v_readfirstlane_b32 s3, v6
5777 ; GFX10-NEXT: v_cndmask_b32_e64 v12, v13, v0, s0
5778 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v14, v1, s0
5779 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v15, v0, s1
5780 ; GFX10-NEXT: v_cndmask_b32_e64 v1, v16, v1, s1
5781 ; GFX10-NEXT: v_readfirstlane_b32 s0, v3
5782 ; GFX10-NEXT: v_readfirstlane_b32 s1, v4
5783 ; GFX10-NEXT: v_readfirstlane_b32 s4, v7
5784 ; GFX10-NEXT: v_readfirstlane_b32 s5, v8
5785 ; GFX10-NEXT: v_readfirstlane_b32 s6, v9
5786 ; GFX10-NEXT: v_readfirstlane_b32 s7, v10
5787 ; GFX10-NEXT: v_readfirstlane_b32 s8, v11
5788 ; GFX10-NEXT: v_readfirstlane_b32 s9, v2
5789 ; GFX10-NEXT: v_readfirstlane_b32 s10, v12
5790 ; GFX10-NEXT: v_readfirstlane_b32 s11, v13
5791 ; GFX10-NEXT: v_readfirstlane_b32 s12, v0
5792 ; GFX10-NEXT: v_readfirstlane_b32 s13, v1
5793 ; GFX10-NEXT: ; return to shader part epilog
5795 ; GFX11-LABEL: dyn_insertelement_v7f64_s_v_v:
5796 ; GFX11: ; %bb.0: ; %entry
5797 ; GFX11-NEXT: s_mov_b32 s0, s2
5798 ; GFX11-NEXT: s_mov_b32 s1, s3
5799 ; GFX11-NEXT: s_mov_b32 s2, s4
5800 ; GFX11-NEXT: s_mov_b32 s3, s5
5801 ; GFX11-NEXT: s_mov_b32 s4, s6
5802 ; GFX11-NEXT: s_mov_b32 s5, s7
5803 ; GFX11-NEXT: s_mov_b32 s6, s8
5804 ; GFX11-NEXT: s_mov_b32 s7, s9
5805 ; GFX11-NEXT: s_mov_b32 s8, s10
5806 ; GFX11-NEXT: s_mov_b32 s9, s11
5807 ; GFX11-NEXT: s_mov_b32 s10, s12
5808 ; GFX11-NEXT: s_mov_b32 s11, s13
5809 ; GFX11-NEXT: s_mov_b32 s12, s14
5810 ; GFX11-NEXT: s_mov_b32 s13, s15
5811 ; GFX11-NEXT: v_dual_mov_b32 v18, s15 :: v_dual_mov_b32 v17, s14
5812 ; GFX11-NEXT: v_dual_mov_b32 v16, s13 :: v_dual_mov_b32 v15, s12
5813 ; GFX11-NEXT: v_dual_mov_b32 v14, s11 :: v_dual_mov_b32 v13, s10
5814 ; GFX11-NEXT: v_dual_mov_b32 v12, s9 :: v_dual_mov_b32 v11, s8
5815 ; GFX11-NEXT: v_dual_mov_b32 v10, s7 :: v_dual_mov_b32 v9, s6
5816 ; GFX11-NEXT: v_dual_mov_b32 v8, s5 :: v_dual_mov_b32 v7, s4
5817 ; GFX11-NEXT: v_dual_mov_b32 v6, s3 :: v_dual_mov_b32 v5, s2
5818 ; GFX11-NEXT: v_dual_mov_b32 v4, s1 :: v_dual_mov_b32 v3, s0
5819 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
5820 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 1, v2
5821 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 6, v2
5822 ; GFX11-NEXT: v_dual_cndmask_b32 v3, v3, v0 :: v_dual_cndmask_b32 v4, v4, v1
5823 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
5824 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, v0, s0
5825 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v1, s0
5826 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 3, v2
5827 ; GFX11-NEXT: v_dual_cndmask_b32 v7, v7, v0 :: v_dual_cndmask_b32 v8, v8, v1
5828 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v2
5829 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, v0, s0
5830 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, v1, s0
5831 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 5, v2
5832 ; GFX11-NEXT: v_readfirstlane_b32 s2, v5
5833 ; GFX11-NEXT: v_dual_cndmask_b32 v11, v11, v0 :: v_dual_cndmask_b32 v2, v12, v1
5834 ; GFX11-NEXT: v_readfirstlane_b32 s3, v6
5835 ; GFX11-NEXT: v_cndmask_b32_e64 v12, v13, v0, s0
5836 ; GFX11-NEXT: v_cndmask_b32_e64 v13, v14, v1, s0
5837 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v15, v0, s1
5838 ; GFX11-NEXT: v_cndmask_b32_e64 v1, v16, v1, s1
5839 ; GFX11-NEXT: v_readfirstlane_b32 s0, v3
5840 ; GFX11-NEXT: v_readfirstlane_b32 s1, v4
5841 ; GFX11-NEXT: v_readfirstlane_b32 s4, v7
5842 ; GFX11-NEXT: v_readfirstlane_b32 s5, v8
5843 ; GFX11-NEXT: v_readfirstlane_b32 s6, v9
5844 ; GFX11-NEXT: v_readfirstlane_b32 s7, v10
5845 ; GFX11-NEXT: v_readfirstlane_b32 s8, v11
5846 ; GFX11-NEXT: v_readfirstlane_b32 s9, v2
5847 ; GFX11-NEXT: v_readfirstlane_b32 s10, v12
5848 ; GFX11-NEXT: v_readfirstlane_b32 s11, v13
5849 ; GFX11-NEXT: v_readfirstlane_b32 s12, v0
5850 ; GFX11-NEXT: v_readfirstlane_b32 s13, v1
5851 ; GFX11-NEXT: ; return to shader part epilog
5853 %insert = insertelement <7 x double> %vec, double %val, i32 %idx
5854 ret <7 x double> %insert
5857 define amdgpu_ps <7 x double> @dyn_insertelement_v7f64_v_v_s(<7 x double> %vec, double %val, i32 inreg %idx) {
5858 ; GPRIDX-LABEL: dyn_insertelement_v7f64_v_v_s:
5859 ; GPRIDX: ; %bb.0: ; %entry
5860 ; GPRIDX-NEXT: s_lshl_b32 s0, s2, 1
5861 ; GPRIDX-NEXT: v_mov_b32_e32 v16, v15
5862 ; GPRIDX-NEXT: s_set_gpr_idx_on s0, gpr_idx(DST)
5863 ; GPRIDX-NEXT: v_mov_b32_e32 v0, v14
5864 ; GPRIDX-NEXT: v_mov_b32_e32 v1, v16
5865 ; GPRIDX-NEXT: s_set_gpr_idx_off
5866 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v0
5867 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v1
5868 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v2
5869 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v3
5870 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v4
5871 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v5
5872 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v6
5873 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v7
5874 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v8
5875 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v9
5876 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v10
5877 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v11
5878 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v12
5879 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v13
5880 ; GPRIDX-NEXT: ; return to shader part epilog
5882 ; GFX10PLUS-LABEL: dyn_insertelement_v7f64_v_v_s:
5883 ; GFX10PLUS: ; %bb.0: ; %entry
5884 ; GFX10PLUS-NEXT: v_mov_b32_e32 v16, v15
5885 ; GFX10PLUS-NEXT: s_lshl_b32 m0, s2, 1
5886 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v0, v14
5887 ; GFX10PLUS-NEXT: v_movreld_b32_e32 v1, v16
5888 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s0, v0
5889 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s1, v1
5890 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s2, v2
5891 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s3, v3
5892 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s4, v4
5893 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s5, v5
5894 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s6, v6
5895 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s7, v7
5896 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s8, v8
5897 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s9, v9
5898 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s10, v10
5899 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s11, v11
5900 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s12, v12
5901 ; GFX10PLUS-NEXT: v_readfirstlane_b32 s13, v13
5902 ; GFX10PLUS-NEXT: ; return to shader part epilog
5904 %insert = insertelement <7 x double> %vec, double %val, i32 %idx
5905 ret <7 x double> %insert
5908 define amdgpu_ps <7 x double> @dyn_insertelement_v7f64_v_v_v(<7 x double> %vec, double %val, i32 %idx) {
5909 ; GPRIDX-LABEL: dyn_insertelement_v7f64_v_v_v:
5910 ; GPRIDX: ; %bb.0: ; %entry
5911 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v16
5912 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v14, vcc
5913 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v15, vcc
5914 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v16
5915 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v14, vcc
5916 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v15, vcc
5917 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v16
5918 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v14, vcc
5919 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v15, vcc
5920 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v16
5921 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v14, vcc
5922 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v15, vcc
5923 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v16
5924 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v14, vcc
5925 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v15, vcc
5926 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 5, v16
5927 ; GPRIDX-NEXT: v_cndmask_b32_e32 v10, v10, v14, vcc
5928 ; GPRIDX-NEXT: v_cndmask_b32_e32 v11, v11, v15, vcc
5929 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 6, v16
5930 ; GPRIDX-NEXT: v_cndmask_b32_e32 v12, v12, v14, vcc
5931 ; GPRIDX-NEXT: v_cndmask_b32_e32 v13, v13, v15, vcc
5932 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v0
5933 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v1
5934 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v2
5935 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v3
5936 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v4
5937 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v5
5938 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v6
5939 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v7
5940 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v8
5941 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v9
5942 ; GPRIDX-NEXT: v_readfirstlane_b32 s10, v10
5943 ; GPRIDX-NEXT: v_readfirstlane_b32 s11, v11
5944 ; GPRIDX-NEXT: v_readfirstlane_b32 s12, v12
5945 ; GPRIDX-NEXT: v_readfirstlane_b32 s13, v13
5946 ; GPRIDX-NEXT: ; return to shader part epilog
5948 ; GFX10-LABEL: dyn_insertelement_v7f64_v_v_v:
5949 ; GFX10: ; %bb.0: ; %entry
5950 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v16
5951 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 1, v16
5952 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 6, v16
5953 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v0, v14, vcc_lo
5954 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v1, v15, vcc_lo
5955 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v16
5956 ; GFX10-NEXT: v_cndmask_b32_e64 v2, v2, v14, s0
5957 ; GFX10-NEXT: v_cndmask_b32_e64 v3, v3, v15, s0
5958 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 3, v16
5959 ; GFX10-NEXT: v_cndmask_b32_e64 v12, v12, v14, s1
5960 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v14, vcc_lo
5961 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v5, v15, vcc_lo
5962 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v16
5963 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v14, s0
5964 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, v15, s0
5965 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 5, v16
5966 ; GFX10-NEXT: v_cndmask_b32_e64 v13, v13, v15, s1
5967 ; GFX10-NEXT: v_cndmask_b32_e32 v8, v8, v14, vcc_lo
5968 ; GFX10-NEXT: v_cndmask_b32_e32 v9, v9, v15, vcc_lo
5969 ; GFX10-NEXT: v_readfirstlane_b32 s1, v1
5970 ; GFX10-NEXT: v_cndmask_b32_e64 v10, v10, v14, s0
5971 ; GFX10-NEXT: v_cndmask_b32_e64 v11, v11, v15, s0
5972 ; GFX10-NEXT: v_readfirstlane_b32 s0, v0
5973 ; GFX10-NEXT: v_readfirstlane_b32 s2, v2
5974 ; GFX10-NEXT: v_readfirstlane_b32 s3, v3
5975 ; GFX10-NEXT: v_readfirstlane_b32 s4, v4
5976 ; GFX10-NEXT: v_readfirstlane_b32 s5, v5
5977 ; GFX10-NEXT: v_readfirstlane_b32 s6, v6
5978 ; GFX10-NEXT: v_readfirstlane_b32 s7, v7
5979 ; GFX10-NEXT: v_readfirstlane_b32 s8, v8
5980 ; GFX10-NEXT: v_readfirstlane_b32 s9, v9
5981 ; GFX10-NEXT: v_readfirstlane_b32 s10, v10
5982 ; GFX10-NEXT: v_readfirstlane_b32 s11, v11
5983 ; GFX10-NEXT: v_readfirstlane_b32 s12, v12
5984 ; GFX10-NEXT: v_readfirstlane_b32 s13, v13
5985 ; GFX10-NEXT: ; return to shader part epilog
5987 ; GFX11-LABEL: dyn_insertelement_v7f64_v_v_v:
5988 ; GFX11: ; %bb.0: ; %entry
5989 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v16
5990 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 1, v16
5991 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 6, v16
5992 ; GFX11-NEXT: v_dual_cndmask_b32 v0, v0, v14 :: v_dual_cndmask_b32 v1, v1, v15
5993 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v16
5994 ; GFX11-NEXT: v_cndmask_b32_e64 v2, v2, v14, s0
5995 ; GFX11-NEXT: v_cndmask_b32_e64 v3, v3, v15, s0
5996 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 3, v16
5997 ; GFX11-NEXT: v_cndmask_b32_e64 v12, v12, v14, s1
5998 ; GFX11-NEXT: v_dual_cndmask_b32 v4, v4, v14 :: v_dual_cndmask_b32 v5, v5, v15
5999 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 4, v16
6000 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v14, s0
6001 ; GFX11-NEXT: v_cndmask_b32_e64 v7, v7, v15, s0
6002 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 5, v16
6003 ; GFX11-NEXT: v_cndmask_b32_e64 v13, v13, v15, s1
6004 ; GFX11-NEXT: v_dual_cndmask_b32 v8, v8, v14 :: v_dual_cndmask_b32 v9, v9, v15
6005 ; GFX11-NEXT: v_readfirstlane_b32 s1, v1
6006 ; GFX11-NEXT: v_cndmask_b32_e64 v10, v10, v14, s0
6007 ; GFX11-NEXT: v_cndmask_b32_e64 v11, v11, v15, s0
6008 ; GFX11-NEXT: v_readfirstlane_b32 s0, v0
6009 ; GFX11-NEXT: v_readfirstlane_b32 s2, v2
6010 ; GFX11-NEXT: v_readfirstlane_b32 s3, v3
6011 ; GFX11-NEXT: v_readfirstlane_b32 s4, v4
6012 ; GFX11-NEXT: v_readfirstlane_b32 s5, v5
6013 ; GFX11-NEXT: v_readfirstlane_b32 s6, v6
6014 ; GFX11-NEXT: v_readfirstlane_b32 s7, v7
6015 ; GFX11-NEXT: v_readfirstlane_b32 s8, v8
6016 ; GFX11-NEXT: v_readfirstlane_b32 s9, v9
6017 ; GFX11-NEXT: v_readfirstlane_b32 s10, v10
6018 ; GFX11-NEXT: v_readfirstlane_b32 s11, v11
6019 ; GFX11-NEXT: v_readfirstlane_b32 s12, v12
6020 ; GFX11-NEXT: v_readfirstlane_b32 s13, v13
6021 ; GFX11-NEXT: ; return to shader part epilog
6023 %insert = insertelement <7 x double> %vec, double %val, i32 %idx
6024 ret <7 x double> %insert
6027 define amdgpu_ps <5 x double> @dyn_insertelement_v5f64_s_s_s(<5 x double> inreg %vec, double inreg %val, i32 inreg %idx) {
6028 ; GPRIDX-LABEL: dyn_insertelement_v5f64_s_s_s:
6029 ; GPRIDX: ; %bb.0: ; %entry
6030 ; GPRIDX-NEXT: s_cmp_eq_u32 s14, 0
6031 ; GPRIDX-NEXT: s_cselect_b64 s[0:1], s[12:13], s[2:3]
6032 ; GPRIDX-NEXT: s_cmp_eq_u32 s14, 1
6033 ; GPRIDX-NEXT: s_cselect_b64 s[2:3], s[12:13], s[4:5]
6034 ; GPRIDX-NEXT: s_cmp_eq_u32 s14, 2
6035 ; GPRIDX-NEXT: s_cselect_b64 s[4:5], s[12:13], s[6:7]
6036 ; GPRIDX-NEXT: s_cmp_eq_u32 s14, 3
6037 ; GPRIDX-NEXT: s_cselect_b64 s[6:7], s[12:13], s[8:9]
6038 ; GPRIDX-NEXT: s_cmp_eq_u32 s14, 4
6039 ; GPRIDX-NEXT: s_cselect_b64 s[8:9], s[12:13], s[10:11]
6040 ; GPRIDX-NEXT: ; return to shader part epilog
6042 ; GFX10PLUS-LABEL: dyn_insertelement_v5f64_s_s_s:
6043 ; GFX10PLUS: ; %bb.0: ; %entry
6044 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s14, 0
6045 ; GFX10PLUS-NEXT: s_cselect_b64 s[0:1], s[12:13], s[2:3]
6046 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s14, 1
6047 ; GFX10PLUS-NEXT: s_cselect_b64 s[2:3], s[12:13], s[4:5]
6048 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s14, 2
6049 ; GFX10PLUS-NEXT: s_cselect_b64 s[4:5], s[12:13], s[6:7]
6050 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s14, 3
6051 ; GFX10PLUS-NEXT: s_cselect_b64 s[6:7], s[12:13], s[8:9]
6052 ; GFX10PLUS-NEXT: s_cmp_eq_u32 s14, 4
6053 ; GFX10PLUS-NEXT: s_cselect_b64 s[8:9], s[12:13], s[10:11]
6054 ; GFX10PLUS-NEXT: ; return to shader part epilog
6056 %insert = insertelement <5 x double> %vec, double %val, i32 %idx
6057 ret <5 x double> %insert
6060 define amdgpu_ps <5 x double> @dyn_insertelement_v5f64_s_v_s(<5 x double> inreg %vec, double %val, i32 inreg %idx) {
6061 ; GPRIDX-LABEL: dyn_insertelement_v5f64_s_v_s:
6062 ; GPRIDX: ; %bb.0: ; %entry
6063 ; GPRIDX-NEXT: s_mov_b32 s1, s3
6064 ; GPRIDX-NEXT: s_mov_b32 s3, s5
6065 ; GPRIDX-NEXT: s_mov_b32 s5, s7
6066 ; GPRIDX-NEXT: s_mov_b32 s7, s9
6067 ; GPRIDX-NEXT: s_mov_b32 s9, s11
6068 ; GPRIDX-NEXT: s_mov_b32 s0, s2
6069 ; GPRIDX-NEXT: s_mov_b32 s2, s4
6070 ; GPRIDX-NEXT: s_mov_b32 s4, s6
6071 ; GPRIDX-NEXT: s_mov_b32 s6, s8
6072 ; GPRIDX-NEXT: s_mov_b32 s8, s10
6073 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s9
6074 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s1
6075 ; GPRIDX-NEXT: v_mov_b32_e32 v2, s0
6076 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s12, 0
6077 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s3
6078 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s2
6079 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v0, vcc
6080 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v1, vcc
6081 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s12, 1
6082 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s5
6083 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s4
6084 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v0, vcc
6085 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v1, vcc
6086 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s12, 2
6087 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s7
6088 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s6
6089 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v0, vcc
6090 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v1, vcc
6091 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s12, 3
6092 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s8
6093 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v0, vcc
6094 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v1, vcc
6095 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s12, 4
6096 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v10, v0, vcc
6097 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v11, v1, vcc
6098 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v2
6099 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v3
6100 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v4
6101 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v5
6102 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v6
6103 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v7
6104 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v8
6105 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v9
6106 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v0
6107 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v1
6108 ; GPRIDX-NEXT: ; return to shader part epilog
6110 ; GFX10-LABEL: dyn_insertelement_v5f64_s_v_s:
6111 ; GFX10: ; %bb.0: ; %entry
6112 ; GFX10-NEXT: s_mov_b32 s1, s3
6113 ; GFX10-NEXT: s_mov_b32 s3, s5
6114 ; GFX10-NEXT: s_mov_b32 s5, s7
6115 ; GFX10-NEXT: s_mov_b32 s7, s9
6116 ; GFX10-NEXT: s_mov_b32 s9, s11
6117 ; GFX10-NEXT: s_mov_b32 s0, s2
6118 ; GFX10-NEXT: s_mov_b32 s2, s4
6119 ; GFX10-NEXT: s_mov_b32 s4, s6
6120 ; GFX10-NEXT: s_mov_b32 s6, s8
6121 ; GFX10-NEXT: s_mov_b32 s8, s10
6122 ; GFX10-NEXT: v_mov_b32_e32 v11, s9
6123 ; GFX10-NEXT: v_mov_b32_e32 v10, s8
6124 ; GFX10-NEXT: v_mov_b32_e32 v9, s7
6125 ; GFX10-NEXT: v_mov_b32_e32 v8, s6
6126 ; GFX10-NEXT: v_mov_b32_e32 v7, s5
6127 ; GFX10-NEXT: v_mov_b32_e32 v6, s4
6128 ; GFX10-NEXT: v_mov_b32_e32 v5, s3
6129 ; GFX10-NEXT: v_mov_b32_e32 v4, s2
6130 ; GFX10-NEXT: v_mov_b32_e32 v3, s1
6131 ; GFX10-NEXT: v_mov_b32_e32 v2, s0
6132 ; GFX10-NEXT: v_cmp_eq_u32_e64 vcc_lo, s12, 0
6133 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, s12, 1
6134 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, s12, 4
6135 ; GFX10-NEXT: v_cndmask_b32_e32 v2, v2, v0, vcc_lo
6136 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v1, vcc_lo
6137 ; GFX10-NEXT: v_cndmask_b32_e64 v4, v4, v0, s0
6138 ; GFX10-NEXT: v_cmp_eq_u32_e64 vcc_lo, s12, 2
6139 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, v1, s0
6140 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, s12, 3
6141 ; GFX10-NEXT: v_readfirstlane_b32 s2, v4
6142 ; GFX10-NEXT: v_cndmask_b32_e32 v6, v6, v0, vcc_lo
6143 ; GFX10-NEXT: v_cndmask_b32_e32 v7, v7, v1, vcc_lo
6144 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, v0, s0
6145 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v1, s0
6146 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v10, v0, s1
6147 ; GFX10-NEXT: v_cndmask_b32_e64 v1, v11, v1, s1
6148 ; GFX10-NEXT: v_readfirstlane_b32 s0, v2
6149 ; GFX10-NEXT: v_readfirstlane_b32 s1, v3
6150 ; GFX10-NEXT: v_readfirstlane_b32 s3, v5
6151 ; GFX10-NEXT: v_readfirstlane_b32 s4, v6
6152 ; GFX10-NEXT: v_readfirstlane_b32 s5, v7
6153 ; GFX10-NEXT: v_readfirstlane_b32 s6, v8
6154 ; GFX10-NEXT: v_readfirstlane_b32 s7, v9
6155 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
6156 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
6157 ; GFX10-NEXT: ; return to shader part epilog
6159 ; GFX11-LABEL: dyn_insertelement_v5f64_s_v_s:
6160 ; GFX11: ; %bb.0: ; %entry
6161 ; GFX11-NEXT: s_mov_b32 s1, s3
6162 ; GFX11-NEXT: s_mov_b32 s3, s5
6163 ; GFX11-NEXT: s_mov_b32 s5, s7
6164 ; GFX11-NEXT: s_mov_b32 s7, s9
6165 ; GFX11-NEXT: s_mov_b32 s9, s11
6166 ; GFX11-NEXT: s_mov_b32 s0, s2
6167 ; GFX11-NEXT: s_mov_b32 s2, s4
6168 ; GFX11-NEXT: s_mov_b32 s4, s6
6169 ; GFX11-NEXT: s_mov_b32 s6, s8
6170 ; GFX11-NEXT: s_mov_b32 s8, s10
6171 ; GFX11-NEXT: v_dual_mov_b32 v11, s9 :: v_dual_mov_b32 v10, s8
6172 ; GFX11-NEXT: v_dual_mov_b32 v9, s7 :: v_dual_mov_b32 v8, s6
6173 ; GFX11-NEXT: v_dual_mov_b32 v7, s5 :: v_dual_mov_b32 v6, s4
6174 ; GFX11-NEXT: v_dual_mov_b32 v5, s3 :: v_dual_mov_b32 v4, s2
6175 ; GFX11-NEXT: v_dual_mov_b32 v3, s1 :: v_dual_mov_b32 v2, s0
6176 ; GFX11-NEXT: v_cmp_eq_u32_e64 vcc_lo, s12, 0
6177 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, s12, 1
6178 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, s12, 4
6179 ; GFX11-NEXT: v_dual_cndmask_b32 v2, v2, v0 :: v_dual_cndmask_b32 v3, v3, v1
6180 ; GFX11-NEXT: v_cndmask_b32_e64 v4, v4, v0, s0
6181 ; GFX11-NEXT: v_cmp_eq_u32_e64 vcc_lo, s12, 2
6182 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, v1, s0
6183 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, s12, 3
6184 ; GFX11-NEXT: v_readfirstlane_b32 s2, v4
6185 ; GFX11-NEXT: v_dual_cndmask_b32 v6, v6, v0 :: v_dual_cndmask_b32 v7, v7, v1
6186 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v8, v0, s0
6187 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, v1, s0
6188 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v10, v0, s1
6189 ; GFX11-NEXT: v_cndmask_b32_e64 v1, v11, v1, s1
6190 ; GFX11-NEXT: v_readfirstlane_b32 s0, v2
6191 ; GFX11-NEXT: v_readfirstlane_b32 s1, v3
6192 ; GFX11-NEXT: v_readfirstlane_b32 s3, v5
6193 ; GFX11-NEXT: v_readfirstlane_b32 s4, v6
6194 ; GFX11-NEXT: v_readfirstlane_b32 s5, v7
6195 ; GFX11-NEXT: v_readfirstlane_b32 s6, v8
6196 ; GFX11-NEXT: v_readfirstlane_b32 s7, v9
6197 ; GFX11-NEXT: v_readfirstlane_b32 s8, v0
6198 ; GFX11-NEXT: v_readfirstlane_b32 s9, v1
6199 ; GFX11-NEXT: ; return to shader part epilog
6201 %insert = insertelement <5 x double> %vec, double %val, i32 %idx
6202 ret <5 x double> %insert
6205 define amdgpu_ps <5 x double> @dyn_insertelement_v5f64_s_v_v(<5 x double> inreg %vec, double %val, i32 %idx) {
6206 ; GPRIDX-LABEL: dyn_insertelement_v5f64_s_v_v:
6207 ; GPRIDX: ; %bb.0: ; %entry
6208 ; GPRIDX-NEXT: s_mov_b32 s1, s3
6209 ; GPRIDX-NEXT: s_mov_b32 s3, s5
6210 ; GPRIDX-NEXT: s_mov_b32 s5, s7
6211 ; GPRIDX-NEXT: s_mov_b32 s7, s9
6212 ; GPRIDX-NEXT: s_mov_b32 s9, s11
6213 ; GPRIDX-NEXT: s_mov_b32 s0, s2
6214 ; GPRIDX-NEXT: s_mov_b32 s2, s4
6215 ; GPRIDX-NEXT: s_mov_b32 s4, s6
6216 ; GPRIDX-NEXT: s_mov_b32 s6, s8
6217 ; GPRIDX-NEXT: s_mov_b32 s8, s10
6218 ; GPRIDX-NEXT: v_mov_b32_e32 v12, s9
6219 ; GPRIDX-NEXT: v_mov_b32_e32 v4, s1
6220 ; GPRIDX-NEXT: v_mov_b32_e32 v3, s0
6221 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 0, v2
6222 ; GPRIDX-NEXT: v_mov_b32_e32 v6, s3
6223 ; GPRIDX-NEXT: v_mov_b32_e32 v5, s2
6224 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc
6225 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v1, vcc
6226 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v2
6227 ; GPRIDX-NEXT: v_mov_b32_e32 v8, s5
6228 ; GPRIDX-NEXT: v_mov_b32_e32 v7, s4
6229 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v0, vcc
6230 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v1, vcc
6231 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v2
6232 ; GPRIDX-NEXT: v_mov_b32_e32 v11, s8
6233 ; GPRIDX-NEXT: v_mov_b32_e32 v10, s7
6234 ; GPRIDX-NEXT: v_mov_b32_e32 v9, s6
6235 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v0, vcc
6236 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v1, vcc
6237 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v2
6238 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 s[0:1], 4, v2
6239 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v0, vcc
6240 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v10, v1, vcc
6241 ; GPRIDX-NEXT: v_cndmask_b32_e64 v0, v11, v0, s[0:1]
6242 ; GPRIDX-NEXT: v_cndmask_b32_e64 v1, v12, v1, s[0:1]
6243 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v3
6244 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v4
6245 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v5
6246 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v6
6247 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v7
6248 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v8
6249 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v9
6250 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v2
6251 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v0
6252 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v1
6253 ; GPRIDX-NEXT: ; return to shader part epilog
6255 ; GFX10-LABEL: dyn_insertelement_v5f64_s_v_v:
6256 ; GFX10: ; %bb.0: ; %entry
6257 ; GFX10-NEXT: s_mov_b32 s1, s3
6258 ; GFX10-NEXT: s_mov_b32 s3, s5
6259 ; GFX10-NEXT: s_mov_b32 s5, s7
6260 ; GFX10-NEXT: s_mov_b32 s7, s9
6261 ; GFX10-NEXT: s_mov_b32 s9, s11
6262 ; GFX10-NEXT: s_mov_b32 s0, s2
6263 ; GFX10-NEXT: s_mov_b32 s2, s4
6264 ; GFX10-NEXT: s_mov_b32 s4, s6
6265 ; GFX10-NEXT: s_mov_b32 s6, s8
6266 ; GFX10-NEXT: s_mov_b32 s8, s10
6267 ; GFX10-NEXT: v_mov_b32_e32 v12, s9
6268 ; GFX10-NEXT: v_mov_b32_e32 v11, s8
6269 ; GFX10-NEXT: v_mov_b32_e32 v10, s7
6270 ; GFX10-NEXT: v_mov_b32_e32 v9, s6
6271 ; GFX10-NEXT: v_mov_b32_e32 v8, s5
6272 ; GFX10-NEXT: v_mov_b32_e32 v7, s4
6273 ; GFX10-NEXT: v_mov_b32_e32 v6, s3
6274 ; GFX10-NEXT: v_mov_b32_e32 v5, s2
6275 ; GFX10-NEXT: v_mov_b32_e32 v4, s1
6276 ; GFX10-NEXT: v_mov_b32_e32 v3, s0
6277 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
6278 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 1, v2
6279 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 4, v2
6280 ; GFX10-NEXT: v_cndmask_b32_e32 v3, v3, v0, vcc_lo
6281 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v1, vcc_lo
6282 ; GFX10-NEXT: v_cndmask_b32_e64 v5, v5, v0, s0
6283 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
6284 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v1, s0
6285 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 3, v2
6286 ; GFX10-NEXT: v_readfirstlane_b32 s2, v5
6287 ; GFX10-NEXT: v_cndmask_b32_e32 v7, v7, v0, vcc_lo
6288 ; GFX10-NEXT: v_cndmask_b32_e32 v2, v8, v1, vcc_lo
6289 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v9, v0, s0
6290 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v10, v1, s0
6291 ; GFX10-NEXT: v_cndmask_b32_e64 v0, v11, v0, s1
6292 ; GFX10-NEXT: v_cndmask_b32_e64 v1, v12, v1, s1
6293 ; GFX10-NEXT: v_readfirstlane_b32 s0, v3
6294 ; GFX10-NEXT: v_readfirstlane_b32 s1, v4
6295 ; GFX10-NEXT: v_readfirstlane_b32 s3, v6
6296 ; GFX10-NEXT: v_readfirstlane_b32 s4, v7
6297 ; GFX10-NEXT: v_readfirstlane_b32 s5, v2
6298 ; GFX10-NEXT: v_readfirstlane_b32 s6, v8
6299 ; GFX10-NEXT: v_readfirstlane_b32 s7, v9
6300 ; GFX10-NEXT: v_readfirstlane_b32 s8, v0
6301 ; GFX10-NEXT: v_readfirstlane_b32 s9, v1
6302 ; GFX10-NEXT: ; return to shader part epilog
6304 ; GFX11-LABEL: dyn_insertelement_v5f64_s_v_v:
6305 ; GFX11: ; %bb.0: ; %entry
6306 ; GFX11-NEXT: s_mov_b32 s1, s3
6307 ; GFX11-NEXT: s_mov_b32 s3, s5
6308 ; GFX11-NEXT: s_mov_b32 s5, s7
6309 ; GFX11-NEXT: s_mov_b32 s7, s9
6310 ; GFX11-NEXT: s_mov_b32 s9, s11
6311 ; GFX11-NEXT: s_mov_b32 s0, s2
6312 ; GFX11-NEXT: s_mov_b32 s2, s4
6313 ; GFX11-NEXT: s_mov_b32 s4, s6
6314 ; GFX11-NEXT: s_mov_b32 s6, s8
6315 ; GFX11-NEXT: s_mov_b32 s8, s10
6316 ; GFX11-NEXT: v_dual_mov_b32 v12, s9 :: v_dual_mov_b32 v11, s8
6317 ; GFX11-NEXT: v_dual_mov_b32 v10, s7 :: v_dual_mov_b32 v9, s6
6318 ; GFX11-NEXT: v_dual_mov_b32 v8, s5 :: v_dual_mov_b32 v7, s4
6319 ; GFX11-NEXT: v_dual_mov_b32 v6, s3 :: v_dual_mov_b32 v5, s2
6320 ; GFX11-NEXT: v_dual_mov_b32 v4, s1 :: v_dual_mov_b32 v3, s0
6321 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 0, v2
6322 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 1, v2
6323 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, 4, v2
6324 ; GFX11-NEXT: v_dual_cndmask_b32 v3, v3, v0 :: v_dual_cndmask_b32 v4, v4, v1
6325 ; GFX11-NEXT: v_cndmask_b32_e64 v5, v5, v0, s0
6326 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v2
6327 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v1, s0
6328 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 3, v2
6329 ; GFX11-NEXT: v_readfirstlane_b32 s2, v5
6330 ; GFX11-NEXT: v_dual_cndmask_b32 v7, v7, v0 :: v_dual_cndmask_b32 v2, v8, v1
6331 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v9, v0, s0
6332 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v10, v1, s0
6333 ; GFX11-NEXT: v_cndmask_b32_e64 v0, v11, v0, s1
6334 ; GFX11-NEXT: v_cndmask_b32_e64 v1, v12, v1, s1
6335 ; GFX11-NEXT: v_readfirstlane_b32 s0, v3
6336 ; GFX11-NEXT: v_readfirstlane_b32 s1, v4
6337 ; GFX11-NEXT: v_readfirstlane_b32 s3, v6
6338 ; GFX11-NEXT: v_readfirstlane_b32 s4, v7
6339 ; GFX11-NEXT: v_readfirstlane_b32 s5, v2
6340 ; GFX11-NEXT: v_readfirstlane_b32 s6, v8
6341 ; GFX11-NEXT: v_readfirstlane_b32 s7, v9
6342 ; GFX11-NEXT: v_readfirstlane_b32 s8, v0
6343 ; GFX11-NEXT: v_readfirstlane_b32 s9, v1
6344 ; GFX11-NEXT: ; return to shader part epilog
6346 %insert = insertelement <5 x double> %vec, double %val, i32 %idx
6347 ret <5 x double> %insert
6350 define amdgpu_ps <5 x double> @dyn_insertelement_v5f64_v_v_s(<5 x double> %vec, double %val, i32 inreg %idx) {
6351 ; GPRIDX-LABEL: dyn_insertelement_v5f64_v_v_s:
6352 ; GPRIDX: ; %bb.0: ; %entry
6353 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 0
6354 ; GPRIDX-NEXT: v_cndmask_b32_e32 v0, v0, v10, vcc
6355 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v11, vcc
6356 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 1
6357 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v10, vcc
6358 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v11, vcc
6359 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 2
6360 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v10, vcc
6361 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v11, vcc
6362 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 3
6363 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v10, vcc
6364 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v11, vcc
6365 ; GPRIDX-NEXT: v_cmp_eq_u32_e64 vcc, s2, 4
6366 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v10, vcc
6367 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v11, vcc
6368 ; GPRIDX-NEXT: v_readfirstlane_b32 s0, v0
6369 ; GPRIDX-NEXT: v_readfirstlane_b32 s1, v1
6370 ; GPRIDX-NEXT: v_readfirstlane_b32 s2, v2
6371 ; GPRIDX-NEXT: v_readfirstlane_b32 s3, v3
6372 ; GPRIDX-NEXT: v_readfirstlane_b32 s4, v4
6373 ; GPRIDX-NEXT: v_readfirstlane_b32 s5, v5
6374 ; GPRIDX-NEXT: v_readfirstlane_b32 s6, v6
6375 ; GPRIDX-NEXT: v_readfirstlane_b32 s7, v7
6376 ; GPRIDX-NEXT: v_readfirstlane_b32 s8, v8
6377 ; GPRIDX-NEXT: v_readfirstlane_b32 s9, v9
6378 ; GPRIDX-NEXT: ; return to shader part epilog
6380 ; GFX10-LABEL: dyn_insertelement_v5f64_v_v_s:
6381 ; GFX10: ; %bb.0: ; %entry
6382 ; GFX10-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 0
6383 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, s2, 1
6384 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 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_cndmask_b32_e64 v2, v2, v10, s0
6388 ; GFX10-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 2
6389 ; GFX10-NEXT: v_cndmask_b32_e64 v3, v3, v11, s0
6390 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, s2, 3
6391 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, v10, s1
6392 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v11, s1
6393 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v10, vcc_lo
6394 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v5, v11, vcc_lo
6395 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v10, s0
6396 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, v11, s0
6397 ; GFX10-NEXT: v_readfirstlane_b32 s0, v0
6398 ; GFX10-NEXT: v_readfirstlane_b32 s1, v1
6399 ; GFX10-NEXT: v_readfirstlane_b32 s2, v2
6400 ; GFX10-NEXT: v_readfirstlane_b32 s3, v3
6401 ; GFX10-NEXT: v_readfirstlane_b32 s4, v4
6402 ; GFX10-NEXT: v_readfirstlane_b32 s5, v5
6403 ; GFX10-NEXT: v_readfirstlane_b32 s6, v6
6404 ; GFX10-NEXT: v_readfirstlane_b32 s7, v7
6405 ; GFX10-NEXT: v_readfirstlane_b32 s8, v8
6406 ; GFX10-NEXT: v_readfirstlane_b32 s9, v9
6407 ; GFX10-NEXT: ; return to shader part epilog
6409 ; GFX11-LABEL: dyn_insertelement_v5f64_v_v_s:
6410 ; GFX11: ; %bb.0: ; %entry
6411 ; GFX11-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 0
6412 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, s2, 1
6413 ; GFX11-NEXT: v_cmp_eq_u32_e64 s1, s2, 4
6414 ; GFX11-NEXT: v_dual_cndmask_b32 v0, v0, v10 :: v_dual_cndmask_b32 v1, v1, v11
6415 ; GFX11-NEXT: v_cndmask_b32_e64 v2, v2, v10, s0
6416 ; GFX11-NEXT: v_cmp_eq_u32_e64 vcc_lo, s2, 2
6417 ; GFX11-NEXT: v_cndmask_b32_e64 v3, v3, v11, s0
6418 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, s2, 3
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 v4, v4, v10 :: v_dual_cndmask_b32 v5, v5, v11
6422 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v10, s0
6423 ; GFX11-NEXT: v_cndmask_b32_e64 v7, v7, v11, s0
6424 ; GFX11-NEXT: v_readfirstlane_b32 s0, v0
6425 ; GFX11-NEXT: v_readfirstlane_b32 s1, v1
6426 ; GFX11-NEXT: v_readfirstlane_b32 s2, v2
6427 ; GFX11-NEXT: v_readfirstlane_b32 s3, v3
6428 ; GFX11-NEXT: v_readfirstlane_b32 s4, v4
6429 ; GFX11-NEXT: v_readfirstlane_b32 s5, v5
6430 ; GFX11-NEXT: v_readfirstlane_b32 s6, v6
6431 ; GFX11-NEXT: v_readfirstlane_b32 s7, v7
6432 ; GFX11-NEXT: v_readfirstlane_b32 s8, v8
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_cndmask_b32_e32 v0, v0, v10, vcc
6445 ; GPRIDX-NEXT: v_cndmask_b32_e32 v1, v1, v11, vcc
6446 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 1, v12
6447 ; GPRIDX-NEXT: v_cndmask_b32_e32 v2, v2, v10, vcc
6448 ; GPRIDX-NEXT: v_cndmask_b32_e32 v3, v3, v11, vcc
6449 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 2, v12
6450 ; GPRIDX-NEXT: v_cndmask_b32_e32 v4, v4, v10, vcc
6451 ; GPRIDX-NEXT: v_cndmask_b32_e32 v5, v5, v11, vcc
6452 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 3, v12
6453 ; GPRIDX-NEXT: v_cndmask_b32_e32 v6, v6, v10, vcc
6454 ; GPRIDX-NEXT: v_cndmask_b32_e32 v7, v7, v11, vcc
6455 ; GPRIDX-NEXT: v_cmp_eq_u32_e32 vcc, 4, v12
6456 ; GPRIDX-NEXT: v_cndmask_b32_e32 v8, v8, v10, vcc
6457 ; GPRIDX-NEXT: v_cndmask_b32_e32 v9, v9, v11, vcc
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, 1, v12
6474 ; GFX10-NEXT: v_cmp_eq_u32_e64 s1, 4, v12
6475 ; GFX10-NEXT: v_cndmask_b32_e32 v0, v0, v10, vcc_lo
6476 ; GFX10-NEXT: v_cndmask_b32_e32 v1, v1, v11, vcc_lo
6477 ; GFX10-NEXT: v_cndmask_b32_e64 v2, v2, v10, s0
6478 ; GFX10-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v12
6479 ; GFX10-NEXT: v_cndmask_b32_e64 v3, v3, v11, s0
6480 ; GFX10-NEXT: v_cmp_eq_u32_e64 s0, 3, v12
6481 ; GFX10-NEXT: v_cndmask_b32_e64 v8, v8, v10, s1
6482 ; GFX10-NEXT: v_cndmask_b32_e64 v9, v9, v11, s1
6483 ; GFX10-NEXT: v_cndmask_b32_e32 v4, v4, v10, vcc_lo
6484 ; GFX10-NEXT: v_cndmask_b32_e32 v5, v5, v11, vcc_lo
6485 ; GFX10-NEXT: v_cndmask_b32_e64 v6, v6, v10, s0
6486 ; GFX10-NEXT: v_cndmask_b32_e64 v7, v7, v11, s0
6487 ; GFX10-NEXT: v_readfirstlane_b32 s0, v0
6488 ; GFX10-NEXT: v_readfirstlane_b32 s1, v1
6489 ; GFX10-NEXT: v_readfirstlane_b32 s2, v2
6490 ; GFX10-NEXT: v_readfirstlane_b32 s3, v3
6491 ; GFX10-NEXT: v_readfirstlane_b32 s4, v4
6492 ; GFX10-NEXT: v_readfirstlane_b32 s5, v5
6493 ; GFX10-NEXT: v_readfirstlane_b32 s6, v6
6494 ; GFX10-NEXT: v_readfirstlane_b32 s7, v7
6495 ; GFX10-NEXT: v_readfirstlane_b32 s8, v8
6496 ; GFX10-NEXT: v_readfirstlane_b32 s9, v9
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, 1, 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_cndmask_b32_e64 v2, v2, v10, s0
6506 ; GFX11-NEXT: v_cmp_eq_u32_e32 vcc_lo, 2, v12
6507 ; GFX11-NEXT: v_cndmask_b32_e64 v3, v3, v11, s0
6508 ; GFX11-NEXT: v_cmp_eq_u32_e64 s0, 3, v12
6509 ; GFX11-NEXT: v_cndmask_b32_e64 v8, v8, v10, s1
6510 ; GFX11-NEXT: v_cndmask_b32_e64 v9, v9, v11, s1
6511 ; GFX11-NEXT: v_dual_cndmask_b32 v4, v4, v10 :: v_dual_cndmask_b32 v5, v5, v11
6512 ; GFX11-NEXT: v_cndmask_b32_e64 v6, v6, v10, s0
6513 ; GFX11-NEXT: v_cndmask_b32_e64 v7, v7, v11, s0
6514 ; GFX11-NEXT: v_readfirstlane_b32 s0, v0
6515 ; GFX11-NEXT: v_readfirstlane_b32 s1, v1
6516 ; GFX11-NEXT: v_readfirstlane_b32 s2, v2
6517 ; GFX11-NEXT: v_readfirstlane_b32 s3, v3
6518 ; GFX11-NEXT: v_readfirstlane_b32 s4, v4
6519 ; GFX11-NEXT: v_readfirstlane_b32 s5, v5
6520 ; GFX11-NEXT: v_readfirstlane_b32 s6, v6
6521 ; GFX11-NEXT: v_readfirstlane_b32 s7, v7
6522 ; GFX11-NEXT: v_readfirstlane_b32 s8, v8
6523 ; GFX11-NEXT: v_readfirstlane_b32 s9, v9
6524 ; GFX11-NEXT: ; return to shader part epilog
6526 %insert = insertelement <5 x double> %vec, double %val, i32 %idx
6527 ret <5 x double> %insert