blob: 7394842d156f7ada1cad4fecde2e902604d9079b [file] [log] [blame]
Matt Arsenault7aad8fd2017-01-24 22:02:15 +00001; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
Matt Arsenault4100ebd2014-07-20 07:13:17 +00003
Tom Stellard79243d92014-10-01 17:15:17 +00004; FUNC-LABEL: {{^}}test_concat_v1i32:
Tom Stellard4f575f72014-08-09 01:06:53 +00005; 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.
Tom Stellard326d6ec2014-11-05 14:50:53 +00009; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
10; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000011define amdgpu_kernel void @test_concat_v1i32(<2 x i32> addrspace(1)* %out, <1 x i32> %a, <1 x i32> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +000012 %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
14 ret void
15}
16
Tom Stellard79243d92014-10-01 17:15:17 +000017; FUNC-LABEL: {{^}}test_concat_v2i32:
Tom Stellard326d6ec2014-11-05 14:50:53 +000018; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
19; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000020define amdgpu_kernel void @test_concat_v2i32(<4 x i32> addrspace(1)* %out, <2 x i32> %a, <2 x i32> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +000021 %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
23 ret void
24}
25
Tom Stellard79243d92014-10-01 17:15:17 +000026; FUNC-LABEL: {{^}}test_concat_v4i32:
Tom Stellard326d6ec2014-11-05 14:50:53 +000027; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
28; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000029define amdgpu_kernel void @test_concat_v4i32(<8 x i32> addrspace(1)* %out, <4 x i32> %a, <4 x i32> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +000030 %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
32 ret void
33}
34
Tom Stellard79243d92014-10-01 17:15:17 +000035; FUNC-LABEL: {{^}}test_concat_v8i32:
Tom Stellard326d6ec2014-11-05 14:50:53 +000036; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
37; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000038define amdgpu_kernel void @test_concat_v8i32(<16 x i32> addrspace(1)* %out, <8 x i32> %a, <8 x i32> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +000039 %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
41 ret void
42}
43
Tom Stellard79243d92014-10-01 17:15:17 +000044; FUNC-LABEL: {{^}}test_concat_v16i32:
Tom Stellard326d6ec2014-11-05 14:50:53 +000045; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
46; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000047define amdgpu_kernel void @test_concat_v16i32(<32 x i32> addrspace(1)* %out, <16 x i32> %a, <16 x i32> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +000048 %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
50 ret void
51}
52
Tom Stellard79243d92014-10-01 17:15:17 +000053; FUNC-LABEL: {{^}}test_concat_v1f32:
Tom Stellard326d6ec2014-11-05 14:50:53 +000054; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
55; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000056define amdgpu_kernel void @test_concat_v1f32(<2 x float> addrspace(1)* %out, <1 x float> %a, <1 x float> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +000057 %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
59 ret void
60}
61
Tom Stellard79243d92014-10-01 17:15:17 +000062; FUNC-LABEL: {{^}}test_concat_v2f32:
Tom Stellard326d6ec2014-11-05 14:50:53 +000063; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
64; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000065define amdgpu_kernel void @test_concat_v2f32(<4 x float> addrspace(1)* %out, <2 x float> %a, <2 x float> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +000066 %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
68 ret void
69}
70
Tom Stellard79243d92014-10-01 17:15:17 +000071; FUNC-LABEL: {{^}}test_concat_v4f32:
Tom Stellard326d6ec2014-11-05 14:50:53 +000072; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
73; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000074define amdgpu_kernel void @test_concat_v4f32(<8 x float> addrspace(1)* %out, <4 x float> %a, <4 x float> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +000075 %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
77 ret void
78}
79
Tom Stellard79243d92014-10-01 17:15:17 +000080; FUNC-LABEL: {{^}}test_concat_v8f32:
Tom Stellard326d6ec2014-11-05 14:50:53 +000081; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
82; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000083define amdgpu_kernel void @test_concat_v8f32(<16 x float> addrspace(1)* %out, <8 x float> %a, <8 x float> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +000084 %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
86 ret void
87}
88
Tom Stellard79243d92014-10-01 17:15:17 +000089; FUNC-LABEL: {{^}}test_concat_v16f32:
Tom Stellard326d6ec2014-11-05 14:50:53 +000090; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
91; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +000092define amdgpu_kernel void @test_concat_v16f32(<32 x float> addrspace(1)* %out, <16 x float> %a, <16 x float> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +000093 %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
95 ret void
96}
97
Tom Stellard79243d92014-10-01 17:15:17 +000098; FUNC-LABEL: {{^}}test_concat_v1i64:
Tom Stellard326d6ec2014-11-05 14:50:53 +000099; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
100; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000101define amdgpu_kernel void @test_concat_v1i64(<2 x double> addrspace(1)* %out, <1 x double> %a, <1 x double> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000102 %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
104 ret void
105}
106
Tom Stellard79243d92014-10-01 17:15:17 +0000107; FUNC-LABEL: {{^}}test_concat_v2i64:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000108; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
109; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000110define amdgpu_kernel void @test_concat_v2i64(<4 x double> addrspace(1)* %out, <2 x double> %a, <2 x double> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000111 %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
113 ret void
114}
115
Tom Stellard79243d92014-10-01 17:15:17 +0000116; FUNC-LABEL: {{^}}test_concat_v4i64:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000117; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
118; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000119define amdgpu_kernel void @test_concat_v4i64(<8 x double> addrspace(1)* %out, <4 x double> %a, <4 x double> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000120 %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
122 ret void
123}
124
Tom Stellard79243d92014-10-01 17:15:17 +0000125; FUNC-LABEL: {{^}}test_concat_v8i64:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000126; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
127; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000128define amdgpu_kernel void @test_concat_v8i64(<16 x double> addrspace(1)* %out, <8 x double> %a, <8 x double> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000129 %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
131 ret void
132}
133
Tom Stellard79243d92014-10-01 17:15:17 +0000134; FUNC-LABEL: {{^}}test_concat_v16i64:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000135; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
136; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000137define amdgpu_kernel void @test_concat_v16i64(<32 x double> addrspace(1)* %out, <16 x double> %a, <16 x double> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000138 %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
140 ret void
141}
142
Tom Stellard79243d92014-10-01 17:15:17 +0000143; FUNC-LABEL: {{^}}test_concat_v1f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000144; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
145; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000146define amdgpu_kernel void @test_concat_v1f64(<2 x double> addrspace(1)* %out, <1 x double> %a, <1 x double> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000147 %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
149 ret void
150}
151
Tom Stellard79243d92014-10-01 17:15:17 +0000152; FUNC-LABEL: {{^}}test_concat_v2f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000153; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
154; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000155define amdgpu_kernel void @test_concat_v2f64(<4 x double> addrspace(1)* %out, <2 x double> %a, <2 x double> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000156 %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
158 ret void
159}
160
Tom Stellard79243d92014-10-01 17:15:17 +0000161; FUNC-LABEL: {{^}}test_concat_v4f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000162; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
163; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000164define amdgpu_kernel void @test_concat_v4f64(<8 x double> addrspace(1)* %out, <4 x double> %a, <4 x double> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000165 %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
167 ret void
168}
169
Tom Stellard79243d92014-10-01 17:15:17 +0000170; FUNC-LABEL: {{^}}test_concat_v8f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000171; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
172; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000173define amdgpu_kernel void @test_concat_v8f64(<16 x double> addrspace(1)* %out, <8 x double> %a, <8 x double> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000174 %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
176 ret void
177}
178
Tom Stellard79243d92014-10-01 17:15:17 +0000179; FUNC-LABEL: {{^}}test_concat_v16f64:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000180; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
181; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000182define amdgpu_kernel void @test_concat_v16f64(<32 x double> addrspace(1)* %out, <16 x double> %a, <16 x double> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000183 %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
185 ret void
186}
187
Tom Stellard79243d92014-10-01 17:15:17 +0000188; FUNC-LABEL: {{^}}test_concat_v1i1:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000189; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
190; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000191define amdgpu_kernel void @test_concat_v1i1(<2 x i1> addrspace(1)* %out, <1 x i1> %a, <1 x i1> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000192 %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
194 ret void
195}
196
Tom Stellard79243d92014-10-01 17:15:17 +0000197; FUNC-LABEL: {{^}}test_concat_v2i1:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000198; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
199; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000200define amdgpu_kernel void @test_concat_v2i1(<4 x i1> addrspace(1)* %out, <2 x i1> %a, <2 x i1> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000201 %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
203 ret void
204}
205
Tom Stellard79243d92014-10-01 17:15:17 +0000206; FUNC-LABEL: {{^}}test_concat_v4i1:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000207; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
208; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000209define amdgpu_kernel void @test_concat_v4i1(<8 x i1> addrspace(1)* %out, <4 x i1> %a, <4 x i1> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000210 %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
212 ret void
213}
214
Tom Stellard79243d92014-10-01 17:15:17 +0000215; FUNC-LABEL: {{^}}test_concat_v8i1:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000216; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
217; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000218define amdgpu_kernel void @test_concat_v8i1(<16 x i1> addrspace(1)* %out, <8 x i1> %a, <8 x i1> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000219 %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
221 ret void
222}
223
Tom Stellard79243d92014-10-01 17:15:17 +0000224; FUNC-LABEL: {{^}}test_concat_v16i1:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000225; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
226; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000227define amdgpu_kernel void @test_concat_v16i1(<32 x i1> addrspace(1)* %out, <16 x i1> %a, <16 x i1> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000228 %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
230 ret void
231}
232
Tom Stellard79243d92014-10-01 17:15:17 +0000233; FUNC-LABEL: {{^}}test_concat_v32i1:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000234; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
235; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000236define amdgpu_kernel void @test_concat_v32i1(<64 x i1> addrspace(1)* %out, <32 x i1> %a, <32 x i1> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000237 %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
239 ret void
240}
241
Tom Stellard79243d92014-10-01 17:15:17 +0000242; FUNC-LABEL: {{^}}test_concat_v1i16:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000243; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
244; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000245define amdgpu_kernel void @test_concat_v1i16(<2 x i16> addrspace(1)* %out, <1 x i16> %a, <1 x i16> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000246 %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
248 ret void
249}
250
Tom Stellard79243d92014-10-01 17:15:17 +0000251; FUNC-LABEL: {{^}}test_concat_v2i16:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000252; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
253; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000254define amdgpu_kernel void @test_concat_v2i16(<4 x i16> addrspace(1)* %out, <2 x i16> %a, <2 x i16> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000255 %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
257 ret void
258}
259
Tom Stellard79243d92014-10-01 17:15:17 +0000260; FUNC-LABEL: {{^}}test_concat_v4i16:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000261; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
262; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000263define amdgpu_kernel void @test_concat_v4i16(<8 x i16> addrspace(1)* %out, <4 x i16> %a, <4 x i16> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000264 %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
266 ret void
267}
268
Tom Stellard79243d92014-10-01 17:15:17 +0000269; FUNC-LABEL: {{^}}test_concat_v8i16:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000270; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
271; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000272define amdgpu_kernel void @test_concat_v8i16(<16 x i16> addrspace(1)* %out, <8 x i16> %a, <8 x i16> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000273 %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
275 ret void
276}
277
Tom Stellard79243d92014-10-01 17:15:17 +0000278; FUNC-LABEL: {{^}}test_concat_v16i16:
Tom Stellard326d6ec2014-11-05 14:50:53 +0000279; SI-NOT: s_mov_b32 s{{[0-9]}}, 0x80f000
280; SI-NOT: movrel
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000281define amdgpu_kernel void @test_concat_v16i16(<32 x i16> addrspace(1)* %out, <16 x i16> %a, <16 x i16> %b) nounwind {
Matt Arsenault4100ebd2014-07-20 07:13:17 +0000282 %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
284 ret void
285}
Tom Stellardff5cf0e2015-04-23 22:59:24 +0000286
287; FUNC-LABEL: {{^}}concat_vector_crash:
288; SI: s_endpgm
Matt Arsenault3dbeefa2017-03-21 21:39:51 +0000289define amdgpu_kernel void @concat_vector_crash(<8 x float> addrspace(1)* %out, <2 x float> addrspace(1)* %in) {
Tom Stellardff5cf0e2015-04-23 22:59:24 +0000290bb:
291 %tmp = load <2 x float>, <2 x float> addrspace(1)* %in, align 4
292 %tmp1 = shufflevector <2 x float> %tmp, <2 x float> undef, <8 x i32> <i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
293 %tmp2 = shufflevector <8 x float> undef, <8 x float> %tmp1, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 8, i32 9>
294 store <8 x float> %tmp2, <8 x float> addrspace(1)* %out, align 32
295 ret void
296}