blob: 01b76422c03f83772c771e73149c9cebea9d988b [file] [log] [blame]
Tom Stellard49f8bfd2015-01-06 18:00:21 +00001;RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck %s
Marek Olsak75170772015-01-27 17:27:15 +00002;RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck %s
Tom Stellardafcf12f2013-09-12 02:55:14 +00003
Tom Stellard79243d92014-10-01 17:15:17 +00004;CHECK-LABEL: {{^}}test1:
David Stuttard70e8bc12017-06-22 16:29:22 +00005;CHECK: tbuffer_store_format_xyzw {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, dfmt:14, nfmt:4, 0 offen offset:32 glc slc
Nicolai Haehnledf3a20c2016-04-06 19:40:20 +00006define amdgpu_vs void @test1(i32 %a1, i32 %vaddr) {
Tom Stellardafcf12f2013-09-12 02:55:14 +00007 %vdata = insertelement <4 x i32> undef, i32 %a1, i32 0
Matt Arsenault7c525902017-06-28 21:38:50 +00008 call void @llvm.SI.tbuffer.store.v4i32(<4 x i32> undef, <4 x i32> %vdata,
Tom Stellardafcf12f2013-09-12 02:55:14 +00009 i32 4, i32 %vaddr, i32 0, i32 32, i32 14, i32 4, i32 1, i32 0, i32 1,
10 i32 1, i32 0)
11 ret void
12}
13
David Stuttard70e8bc12017-06-22 16:29:22 +000014;CHECK-LABEL: {{^}}test1_idx:
15;CHECK: tbuffer_store_format_xyzw {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, dfmt:14, nfmt:4, 0 idxen offset:32 glc slc
16define amdgpu_vs void @test1_idx(i32 %a1, i32 %vaddr) {
17 %vdata = insertelement <4 x i32> undef, i32 %a1, i32 0
Matt Arsenault7c525902017-06-28 21:38:50 +000018 call void @llvm.SI.tbuffer.store.v4i32(<4 x i32> undef, <4 x i32> %vdata,
David Stuttard70e8bc12017-06-22 16:29:22 +000019 i32 4, i32 %vaddr, i32 0, i32 32, i32 14, i32 4, i32 0, i32 1, i32 1,
20 i32 1, i32 0)
21 ret void
22}
23
24;CHECK-LABEL: {{^}}test1_scalar_offset:
25;CHECK: tbuffer_store_format_xyzw {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, dfmt:14, nfmt:4, {{s[0-9]+}} idxen offset:32 glc slc
26define amdgpu_vs void @test1_scalar_offset(i32 %a1, i32 %vaddr, i32 inreg %soffset) {
27 %vdata = insertelement <4 x i32> undef, i32 %a1, i32 0
Matt Arsenault7c525902017-06-28 21:38:50 +000028 call void @llvm.SI.tbuffer.store.v4i32(<4 x i32> undef, <4 x i32> %vdata,
David Stuttard70e8bc12017-06-22 16:29:22 +000029 i32 4, i32 %vaddr, i32 %soffset, i32 32, i32 14, i32 4, i32 0, i32 1, i32 1,
30 i32 1, i32 0)
31 ret void
32}
33
34;CHECK-LABEL: {{^}}test1_no_glc_slc:
35;CHECK: tbuffer_store_format_xyzw {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, dfmt:14, nfmt:4, 0 offen offset:32
36define amdgpu_vs void @test1_no_glc_slc(i32 %a1, i32 %vaddr) {
37 %vdata = insertelement <4 x i32> undef, i32 %a1, i32 0
Matt Arsenault7c525902017-06-28 21:38:50 +000038 call void @llvm.SI.tbuffer.store.v4i32(<4 x i32> undef, <4 x i32> %vdata,
David Stuttard70e8bc12017-06-22 16:29:22 +000039 i32 4, i32 %vaddr, i32 0, i32 32, i32 14, i32 4, i32 1, i32 0, i32 0,
40 i32 0, i32 0)
41 ret void
42}
43
Tom Stellard79243d92014-10-01 17:15:17 +000044;CHECK-LABEL: {{^}}test2:
David Stuttard70e8bc12017-06-22 16:29:22 +000045;CHECK: tbuffer_store_format_xyz {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, dfmt:13, nfmt:4, 0 offen offset:24 glc slc
Nicolai Haehnledf3a20c2016-04-06 19:40:20 +000046define amdgpu_vs void @test2(i32 %a1, i32 %vaddr) {
Tom Stellardafcf12f2013-09-12 02:55:14 +000047 %vdata = insertelement <4 x i32> undef, i32 %a1, i32 0
Matt Arsenault7c525902017-06-28 21:38:50 +000048 call void @llvm.SI.tbuffer.store.v4i32(<4 x i32> undef, <4 x i32> %vdata,
Tom Stellardafcf12f2013-09-12 02:55:14 +000049 i32 3, i32 %vaddr, i32 0, i32 24, i32 13, i32 4, i32 1, i32 0, i32 1,
50 i32 1, i32 0)
51 ret void
52}
53
Tom Stellard79243d92014-10-01 17:15:17 +000054;CHECK-LABEL: {{^}}test3:
David Stuttard70e8bc12017-06-22 16:29:22 +000055;CHECK: tbuffer_store_format_xy {{v\[[0-9]+:[0-9]+\]}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, dfmt:11, nfmt:4, 0 offen offset:16 glc slc
Nicolai Haehnledf3a20c2016-04-06 19:40:20 +000056define amdgpu_vs void @test3(i32 %a1, i32 %vaddr) {
Tom Stellardafcf12f2013-09-12 02:55:14 +000057 %vdata = insertelement <2 x i32> undef, i32 %a1, i32 0
Matt Arsenault7c525902017-06-28 21:38:50 +000058 call void @llvm.SI.tbuffer.store.v2i32(<4 x i32> undef, <2 x i32> %vdata,
Tom Stellardafcf12f2013-09-12 02:55:14 +000059 i32 2, i32 %vaddr, i32 0, i32 16, i32 11, i32 4, i32 1, i32 0, i32 1,
60 i32 1, i32 0)
61 ret void
62}
63
Tom Stellard79243d92014-10-01 17:15:17 +000064;CHECK-LABEL: {{^}}test4:
David Stuttard70e8bc12017-06-22 16:29:22 +000065;CHECK: tbuffer_store_format_x {{v[0-9]+}}, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, dfmt:4, nfmt:4, 0 offen offset:8 glc slc
Nicolai Haehnledf3a20c2016-04-06 19:40:20 +000066define amdgpu_vs void @test4(i32 %vdata, i32 %vaddr) {
Matt Arsenault7c525902017-06-28 21:38:50 +000067 call void @llvm.SI.tbuffer.store.i32(<4 x i32> undef, i32 %vdata,
Tom Stellardafcf12f2013-09-12 02:55:14 +000068 i32 1, i32 %vaddr, i32 0, i32 8, i32 4, i32 4, i32 1, i32 0, i32 1,
69 i32 1, i32 0)
70 ret void
71}
72
Matt Arsenault7c525902017-06-28 21:38:50 +000073declare void @llvm.SI.tbuffer.store.i32(<4 x i32>, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32)
74declare void @llvm.SI.tbuffer.store.v2i32(<4 x i32>, <2 x i32>, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32)
75declare void @llvm.SI.tbuffer.store.v4i32(<4 x i32>, <4 x i32>, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32)