1 ; RUN: llc < %s -mtriple=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck %s -check-prefix=CHECK
3 ; Test that buffer_load_format with VGPR resource descriptor is properly
6 ; Uses the old buffer_load_format intrinsics that don't take pointer
9 ; CHECK-LABEL: {{^}}test_none:
10 ; CHECK: buffer_load_format_x v0, off, {{s\[[0-9]+:[0-9]+\]}}, 0{{$}}
11 define amdgpu_vs float @test_none(ptr addrspace(4) inreg %base, i32 %i) {
13 %ptr = getelementptr <4 x i32>, ptr addrspace(4) %base, i32 %i
14 %tmp2 = load <4 x i32>, ptr addrspace(4) %ptr, align 32
15 %tmp7 = call float @llvm.amdgcn.raw.buffer.load.format.f32(<4 x i32> %tmp2, i32 0, i32 0, i32 0)
19 ; CHECK-LABEL: {{^}}test_idxen:
20 ; CHECK: buffer_load_format_x v0, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0 idxen{{$}}
21 define amdgpu_vs float @test_idxen(ptr addrspace(4) inreg %base, i32 %i) {
23 %ptr = getelementptr <4 x i32>, ptr addrspace(4) %base, i32 %i
24 %tmp2 = load <4 x i32>, ptr addrspace(4) %ptr, align 32
25 %tmp7 = call float @llvm.amdgcn.struct.buffer.load.format.f32(<4 x i32> %tmp2, i32 undef, i32 0, i32 0, i32 0)
29 ; CHECK-LABEL: {{^}}test_offen:
30 ; CHECK: buffer_load_format_x v0, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0 offen{{$}}
31 define amdgpu_vs float @test_offen(ptr addrspace(4) inreg %base, i32 %i) {
33 %ptr = getelementptr <4 x i32>, ptr addrspace(4) %base, i32 %i
34 %tmp2 = load <4 x i32>, ptr addrspace(4) %ptr, align 32
35 %tmp7 = call float @llvm.amdgcn.raw.buffer.load.format.f32(<4 x i32> %tmp2, i32 undef, i32 0, i32 0)
39 ; CHECK-LABEL: {{^}}test_both:
40 ; CHECK: buffer_load_format_x v0, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, 0 idxen offen{{$}}
41 define amdgpu_vs float @test_both(ptr addrspace(4) inreg %base, i32 %i) {
43 %ptr = getelementptr <4 x i32>, ptr addrspace(4) %base, i32 %i
44 %tmp2 = load <4 x i32>, ptr addrspace(4) %ptr, align 32
45 %tmp7 = call float @llvm.amdgcn.struct.buffer.load.format.f32(<4 x i32> %tmp2, i32 undef, i32 undef, i32 0, i32 0)
49 declare float @llvm.amdgcn.struct.buffer.load.format.f32(<4 x i32>, i32, i32, i32, i32 immarg) #1
50 declare float @llvm.amdgcn.raw.buffer.load.format.f32(<4 x i32>, i32, i32, i32 immarg) #1
52 attributes #0 = { nounwind readnone }
53 attributes #1 = { nounwind readonly }