1 ; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
4 ; FUNC-LABEL: {{^}}test_concat_v1i32:
5 ; 0x80f000 is the high 32 bits of the resource descriptor used by MUBUF
6 ; instructions that access scratch memory. Bit 23, which is the add_tid_enable
7 ; bit, is only set for scratch access, so we can check for the absence of this
8 ; value if we want to ensure scratch memory is not being used.
9 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
11 define void @test_concat_v1i32(<2 x i32> addrspace(1)* %out, <1 x i32> %a, <1 x i32> %b) nounwind {
12 %concat = shufflevector <1 x i32> %a, <1 x i32> %b, <2 x i32> <i32 0, i32 1>
13 store <2 x i32> %concat, <2 x i32> addrspace(1)* %out, align 8
17 ; FUNC-LABEL: {{^}}test_concat_v2i32:
18 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
20 define void @test_concat_v2i32(<4 x i32> addrspace(1)* %out, <2 x i32> %a, <2 x i32> %b) nounwind {
21 %concat = shufflevector <2 x i32> %a, <2 x i32> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
22 store <4 x i32> %concat, <4 x i32> addrspace(1)* %out, align 16
26 ; FUNC-LABEL: {{^}}test_concat_v4i32:
27 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
29 define void @test_concat_v4i32(<8 x i32> addrspace(1)* %out, <4 x i32> %a, <4 x i32> %b) nounwind {
30 %concat = shufflevector <4 x i32> %a, <4 x i32> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
31 store <8 x i32> %concat, <8 x i32> addrspace(1)* %out, align 32
35 ; FUNC-LABEL: {{^}}test_concat_v8i32:
36 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
38 define void @test_concat_v8i32(<16 x i32> addrspace(1)* %out, <8 x i32> %a, <8 x i32> %b) nounwind {
39 %concat = shufflevector <8 x i32> %a, <8 x i32> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
40 store <16 x i32> %concat, <16 x i32> addrspace(1)* %out, align 64
44 ; FUNC-LABEL: {{^}}test_concat_v16i32:
45 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
47 define void @test_concat_v16i32(<32 x i32> addrspace(1)* %out, <16 x i32> %a, <16 x i32> %b) nounwind {
48 %concat = shufflevector <16 x i32> %a, <16 x i32> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
49 store <32 x i32> %concat, <32 x i32> addrspace(1)* %out, align 128
53 ; FUNC-LABEL: {{^}}test_concat_v1f32:
54 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
56 define void @test_concat_v1f32(<2 x float> addrspace(1)* %out, <1 x float> %a, <1 x float> %b) nounwind {
57 %concat = shufflevector <1 x float> %a, <1 x float> %b, <2 x i32> <i32 0, i32 1>
58 store <2 x float> %concat, <2 x float> addrspace(1)* %out, align 8
62 ; FUNC-LABEL: {{^}}test_concat_v2f32:
63 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
65 define void @test_concat_v2f32(<4 x float> addrspace(1)* %out, <2 x float> %a, <2 x float> %b) nounwind {
66 %concat = shufflevector <2 x float> %a, <2 x float> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
67 store <4 x float> %concat, <4 x float> addrspace(1)* %out, align 16
71 ; FUNC-LABEL: {{^}}test_concat_v4f32:
72 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
74 define void @test_concat_v4f32(<8 x float> addrspace(1)* %out, <4 x float> %a, <4 x float> %b) nounwind {
75 %concat = shufflevector <4 x float> %a, <4 x float> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
76 store <8 x float> %concat, <8 x float> addrspace(1)* %out, align 32
80 ; FUNC-LABEL: {{^}}test_concat_v8f32:
81 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
83 define void @test_concat_v8f32(<16 x float> addrspace(1)* %out, <8 x float> %a, <8 x float> %b) nounwind {
84 %concat = shufflevector <8 x float> %a, <8 x float> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
85 store <16 x float> %concat, <16 x float> addrspace(1)* %out, align 64
89 ; FUNC-LABEL: {{^}}test_concat_v16f32:
90 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
92 define void @test_concat_v16f32(<32 x float> addrspace(1)* %out, <16 x float> %a, <16 x float> %b) nounwind {
93 %concat = shufflevector <16 x float> %a, <16 x float> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
94 store <32 x float> %concat, <32 x float> addrspace(1)* %out, align 128
98 ; FUNC-LABEL: {{^}}test_concat_v1i64:
99 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
101 define void @test_concat_v1i64(<2 x double> addrspace(1)* %out, <1 x double> %a, <1 x double> %b) nounwind {
102 %concat = shufflevector <1 x double> %a, <1 x double> %b, <2 x i32> <i32 0, i32 1>
103 store <2 x double> %concat, <2 x double> addrspace(1)* %out, align 16
107 ; FUNC-LABEL: {{^}}test_concat_v2i64:
108 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
110 define void @test_concat_v2i64(<4 x double> addrspace(1)* %out, <2 x double> %a, <2 x double> %b) nounwind {
111 %concat = shufflevector <2 x double> %a, <2 x double> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
112 store <4 x double> %concat, <4 x double> addrspace(1)* %out, align 32
116 ; FUNC-LABEL: {{^}}test_concat_v4i64:
117 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
119 define void @test_concat_v4i64(<8 x double> addrspace(1)* %out, <4 x double> %a, <4 x double> %b) nounwind {
120 %concat = shufflevector <4 x double> %a, <4 x double> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
121 store <8 x double> %concat, <8 x double> addrspace(1)* %out, align 64
125 ; FUNC-LABEL: {{^}}test_concat_v8i64:
126 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
128 define void @test_concat_v8i64(<16 x double> addrspace(1)* %out, <8 x double> %a, <8 x double> %b) nounwind {
129 %concat = shufflevector <8 x double> %a, <8 x double> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
130 store <16 x double> %concat, <16 x double> addrspace(1)* %out, align 128
134 ; FUNC-LABEL: {{^}}test_concat_v16i64:
135 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
137 define void @test_concat_v16i64(<32 x double> addrspace(1)* %out, <16 x double> %a, <16 x double> %b) nounwind {
138 %concat = shufflevector <16 x double> %a, <16 x double> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
139 store <32 x double> %concat, <32 x double> addrspace(1)* %out, align 256
143 ; FUNC-LABEL: {{^}}test_concat_v1f64:
144 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
146 define void @test_concat_v1f64(<2 x double> addrspace(1)* %out, <1 x double> %a, <1 x double> %b) nounwind {
147 %concat = shufflevector <1 x double> %a, <1 x double> %b, <2 x i32> <i32 0, i32 1>
148 store <2 x double> %concat, <2 x double> addrspace(1)* %out, align 16
152 ; FUNC-LABEL: {{^}}test_concat_v2f64:
153 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
155 define void @test_concat_v2f64(<4 x double> addrspace(1)* %out, <2 x double> %a, <2 x double> %b) nounwind {
156 %concat = shufflevector <2 x double> %a, <2 x double> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
157 store <4 x double> %concat, <4 x double> addrspace(1)* %out, align 32
161 ; FUNC-LABEL: {{^}}test_concat_v4f64:
162 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
164 define void @test_concat_v4f64(<8 x double> addrspace(1)* %out, <4 x double> %a, <4 x double> %b) nounwind {
165 %concat = shufflevector <4 x double> %a, <4 x double> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
166 store <8 x double> %concat, <8 x double> addrspace(1)* %out, align 64
170 ; FUNC-LABEL: {{^}}test_concat_v8f64:
171 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
173 define void @test_concat_v8f64(<16 x double> addrspace(1)* %out, <8 x double> %a, <8 x double> %b) nounwind {
174 %concat = shufflevector <8 x double> %a, <8 x double> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
175 store <16 x double> %concat, <16 x double> addrspace(1)* %out, align 128
179 ; FUNC-LABEL: {{^}}test_concat_v16f64:
180 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
182 define void @test_concat_v16f64(<32 x double> addrspace(1)* %out, <16 x double> %a, <16 x double> %b) nounwind {
183 %concat = shufflevector <16 x double> %a, <16 x double> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
184 store <32 x double> %concat, <32 x double> addrspace(1)* %out, align 256
188 ; FUNC-LABEL: {{^}}test_concat_v1i1:
189 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
191 define void @test_concat_v1i1(<2 x i1> addrspace(1)* %out, <1 x i1> %a, <1 x i1> %b) nounwind {
192 %concat = shufflevector <1 x i1> %a, <1 x i1> %b, <2 x i32> <i32 0, i32 1>
193 store <2 x i1> %concat, <2 x i1> addrspace(1)* %out
197 ; FUNC-LABEL: {{^}}test_concat_v2i1:
198 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
200 define void @test_concat_v2i1(<4 x i1> addrspace(1)* %out, <2 x i1> %a, <2 x i1> %b) nounwind {
201 %concat = shufflevector <2 x i1> %a, <2 x i1> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
202 store <4 x i1> %concat, <4 x i1> addrspace(1)* %out
206 ; FUNC-LABEL: {{^}}test_concat_v4i1:
207 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
209 define void @test_concat_v4i1(<8 x i1> addrspace(1)* %out, <4 x i1> %a, <4 x i1> %b) nounwind {
210 %concat = shufflevector <4 x i1> %a, <4 x i1> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
211 store <8 x i1> %concat, <8 x i1> addrspace(1)* %out
215 ; FUNC-LABEL: {{^}}test_concat_v8i1:
216 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
218 define void @test_concat_v8i1(<16 x i1> addrspace(1)* %out, <8 x i1> %a, <8 x i1> %b) nounwind {
219 %concat = shufflevector <8 x i1> %a, <8 x i1> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
220 store <16 x i1> %concat, <16 x i1> addrspace(1)* %out
224 ; FUNC-LABEL: {{^}}test_concat_v16i1:
225 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
227 define void @test_concat_v16i1(<32 x i1> addrspace(1)* %out, <16 x i1> %a, <16 x i1> %b) nounwind {
228 %concat = shufflevector <16 x i1> %a, <16 x i1> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
229 store <32 x i1> %concat, <32 x i1> addrspace(1)* %out
233 ; FUNC-LABEL: {{^}}test_concat_v32i1:
234 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
236 define void @test_concat_v32i1(<64 x i1> addrspace(1)* %out, <32 x i1> %a, <32 x i1> %b) nounwind {
237 %concat = shufflevector <32 x i1> %a, <32 x i1> %b, <64 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32, i32 33, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39, i32 40, i32 41, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48, i32 49, i32 50, i32 51, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 58, i32 59, i32 60, i32 61, i32 62, i32 63>
238 store <64 x i1> %concat, <64 x i1> addrspace(1)* %out
242 ; FUNC-LABEL: {{^}}test_concat_v1i16:
243 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
245 define void @test_concat_v1i16(<2 x i16> addrspace(1)* %out, <1 x i16> %a, <1 x i16> %b) nounwind {
246 %concat = shufflevector <1 x i16> %a, <1 x i16> %b, <2 x i32> <i32 0, i32 1>
247 store <2 x i16> %concat, <2 x i16> addrspace(1)* %out, align 4
251 ; FUNC-LABEL: {{^}}test_concat_v2i16:
252 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
254 define void @test_concat_v2i16(<4 x i16> addrspace(1)* %out, <2 x i16> %a, <2 x i16> %b) nounwind {
255 %concat = shufflevector <2 x i16> %a, <2 x i16> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
256 store <4 x i16> %concat, <4 x i16> addrspace(1)* %out, align 8
260 ; FUNC-LABEL: {{^}}test_concat_v4i16:
261 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
263 define void @test_concat_v4i16(<8 x i16> addrspace(1)* %out, <4 x i16> %a, <4 x i16> %b) nounwind {
264 %concat = shufflevector <4 x i16> %a, <4 x i16> %b, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
265 store <8 x i16> %concat, <8 x i16> addrspace(1)* %out, align 16
269 ; FUNC-LABEL: {{^}}test_concat_v8i16:
270 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
272 define void @test_concat_v8i16(<16 x i16> addrspace(1)* %out, <8 x i16> %a, <8 x i16> %b) nounwind {
273 %concat = shufflevector <8 x i16> %a, <8 x i16> %b, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
274 store <16 x i16> %concat, <16 x i16> addrspace(1)* %out, align 32
278 ; FUNC-LABEL: {{^}}test_concat_v16i16:
279 ; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
281 define void @test_concat_v16i16(<32 x i16> addrspace(1)* %out, <16 x i16> %a, <16 x i16> %b) nounwind {
282 %concat = shufflevector <16 x i16> %a, <16 x i16> %b, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
283 store <32 x i16> %concat, <32 x i16> addrspace(1)* %out, align 64