brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.1 KiB · e37b877 Raw
88 lines · plain
1;RUN: llc < %s -mtriple=amdgcn -mcpu=verde | FileCheck %s2;RUN: llc < %s -mtriple=amdgcn -mcpu=tonga | FileCheck %s3 4;CHECK-LABEL: {{^}}buffer_load:5;CHECK: buffer_load_format_xyzw v[0:3], off, s[0:3], 06;CHECK: buffer_load_format_xyzw v[4:7], off, s[0:3], 0 glc7;CHECK: buffer_load_format_xyzw v[8:11], off, s[0:3], 0 slc8;CHECK: s_waitcnt9define amdgpu_ps {<4 x float>, <4 x float>, <4 x float>} @buffer_load(ptr addrspace(8) inreg) {10main_body:11  %data = call <4 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v4f32(ptr addrspace(8) %0, i32 0, i32 0, i32 0)12  %data_glc = call <4 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v4f32(ptr addrspace(8) %0, i32 0, i32 0, i32 1)13  %data_slc = call <4 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v4f32(ptr addrspace(8) %0, i32 0, i32 0, i32 2)14  %r0 = insertvalue {<4 x float>, <4 x float>, <4 x float>} poison, <4 x float> %data, 015  %r1 = insertvalue {<4 x float>, <4 x float>, <4 x float>} %r0, <4 x float> %data_glc, 116  %r2 = insertvalue {<4 x float>, <4 x float>, <4 x float>} %r1, <4 x float> %data_slc, 217  ret {<4 x float>, <4 x float>, <4 x float>} %r218}19 20;CHECK-LABEL: {{^}}buffer_load_immoffs:21;CHECK: buffer_load_format_xyzw v[0:3], off, s[0:3], 0 offset:4222;CHECK: s_waitcnt23define amdgpu_ps <4 x float> @buffer_load_immoffs(ptr addrspace(8) inreg) {24main_body:25  %data = call <4 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v4f32(ptr addrspace(8) %0, i32 42, i32 0, i32 0)26  ret <4 x float> %data27}28 29;CHECK-LABEL: {{^}}buffer_load_immoffs_large:30;CHECK-DAG: buffer_load_format_xyzw {{v\[[0-9]+:[0-9]+\]}}, off, s[0:3], 60 offset:409231;CHECK-DAG: s_movk_i32 [[OFS1:s[0-9]+]], 0x7ffc32;CHECK-DAG: buffer_load_format_xyzw {{v\[[0-9]+:[0-9]+\]}}, off, s[0:3], [[OFS1]] offset:409233;CHECK-DAG: s_mov_b32 [[OFS2:s[0-9]+]], 0x8ffc34;CHECK-DAG: buffer_load_format_xyzw {{v\[[0-9]+:[0-9]+\]}}, off, s[0:3], [[OFS2]] offset:435;CHECK: s_waitcnt36define amdgpu_ps <4 x float> @buffer_load_immoffs_large(ptr addrspace(8) inreg) {37main_body:38  %d.0 = call <4 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v4f32(ptr addrspace(8) %0, i32 4092, i32 60, i32 0)39  %d.1 = call <4 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v4f32(ptr addrspace(8) %0, i32 4092, i32 32764, i32 0)40  %d.2 = call <4 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v4f32(ptr addrspace(8) %0, i32 4, i32 36860, i32 0)41  %d.3 = fadd <4 x float> %d.0, %d.142  %data = fadd <4 x float> %d.2, %d.343  ret <4 x float> %data44}45 46;CHECK-LABEL: {{^}}buffer_load_ofs:47;CHECK: buffer_load_format_xyzw v[0:3], v0, s[0:3], 0 offen48;CHECK: s_waitcnt49define amdgpu_ps <4 x float> @buffer_load_ofs(ptr addrspace(8) inreg, i32) {50main_body:51  %data = call <4 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v4f32(ptr addrspace(8) %0, i32 %1, i32 0, i32 0)52  ret <4 x float> %data53}54 55;CHECK-LABEL: {{^}}buffer_load_ofs_imm:56;CHECK: buffer_load_format_xyzw v[0:3], v0, s[0:3], 0 offen offset:6057;CHECK: s_waitcnt58define amdgpu_ps <4 x float> @buffer_load_ofs_imm(ptr addrspace(8) inreg, i32) {59main_body:60  %ofs = add i32 %1, 6061  %data = call <4 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v4f32(ptr addrspace(8) %0, i32 %ofs, i32 0, i32 0)62  ret <4 x float> %data63}64 65;CHECK-LABEL: {{^}}buffer_load_x:66;CHECK: buffer_load_format_x v0, off, s[0:3], 067;CHECK: s_waitcnt68define amdgpu_ps float @buffer_load_x(ptr addrspace(8) inreg %rsrc) {69main_body:70  %data = call float @llvm.amdgcn.raw.ptr.buffer.load.format.f32(ptr addrspace(8) %rsrc, i32 0, i32 0, i32 0)71  ret float %data72}73 74;CHECK-LABEL: {{^}}buffer_load_xy:75;CHECK: buffer_load_format_xy v[0:1], off, s[0:3], 076;CHECK: s_waitcnt77define amdgpu_ps <2 x float> @buffer_load_xy(ptr addrspace(8) inreg %rsrc) {78main_body:79  %data = call <2 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v2f32(ptr addrspace(8) %rsrc, i32 0, i32 0, i32 0)80  ret <2 x float> %data81}82 83declare float @llvm.amdgcn.raw.ptr.buffer.load.format.f32(ptr addrspace(8), i32, i32, i32) #084declare <2 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v2f32(ptr addrspace(8), i32, i32, i32) #085declare <4 x float> @llvm.amdgcn.raw.ptr.buffer.load.format.v4f32(ptr addrspace(8), i32, i32, i32) #086 87attributes #0 = { nounwind readonly }88