141 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=tonga < %s | FileCheck -enable-var-scope -check-prefixes=GCN,UNPACKED %s3; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx810 < %s | FileCheck -enable-var-scope -check-prefixes=GCN,PACKED %s4; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s | FileCheck -enable-var-scope -check-prefixes=GCN,PACKED %s5 6define amdgpu_kernel void @buffer_store_format_d16_x(ptr addrspace(8) %rsrc, [8 x i32], half %data, [8 x i32], i32 %index) {7; GCN-LABEL: buffer_store_format_d16_x:8; GCN: ; %bb.0: ; %main_body9; GCN-NEXT: s_load_dword s4, s[8:9], 0x3010; GCN-NEXT: s_load_dword s5, s[8:9], 0x5411; GCN-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x012; GCN-NEXT: s_waitcnt lgkmcnt(0)13; GCN-NEXT: v_mov_b32_e32 v0, s414; GCN-NEXT: v_mov_b32_e32 v1, s515; GCN-NEXT: buffer_store_format_d16_x v0, v1, s[0:3], 0 idxen16; GCN-NEXT: s_endpgm17main_body:18 call void @llvm.amdgcn.struct.ptr.buffer.store.format.f16(half %data, ptr addrspace(8) %rsrc, i32 %index, i32 0, i32 0, i32 0)19 ret void20}21 22define amdgpu_kernel void @buffer_store_format_d16_xy(ptr addrspace(8) %rsrc, <2 x half> %data, i32 %index) {23; UNPACKED-LABEL: buffer_store_format_d16_xy:24; UNPACKED: ; %bb.0: ; %main_body25; UNPACKED-NEXT: s_load_dwordx2 s[4:5], s[8:9], 0x1026; UNPACKED-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x027; UNPACKED-NEXT: s_waitcnt lgkmcnt(0)28; UNPACKED-NEXT: s_lshr_b32 s6, s4, 1629; UNPACKED-NEXT: s_and_b32 s4, s4, 0xffff30; UNPACKED-NEXT: v_mov_b32_e32 v0, s431; UNPACKED-NEXT: v_mov_b32_e32 v1, s632; UNPACKED-NEXT: v_mov_b32_e32 v2, s533; UNPACKED-NEXT: buffer_store_format_d16_xy v[0:1], v2, s[0:3], 0 idxen34; UNPACKED-NEXT: s_endpgm35;36; PACKED-LABEL: buffer_store_format_d16_xy:37; PACKED: ; %bb.0: ; %main_body38; PACKED-NEXT: s_load_dwordx2 s[4:5], s[8:9], 0x1039; PACKED-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x040; PACKED-NEXT: s_waitcnt lgkmcnt(0)41; PACKED-NEXT: v_mov_b32_e32 v0, s442; PACKED-NEXT: v_mov_b32_e32 v1, s543; PACKED-NEXT: buffer_store_format_d16_xy v0, v1, s[0:3], 0 idxen44; PACKED-NEXT: s_endpgm45main_body:46 call void @llvm.amdgcn.struct.ptr.buffer.store.format.v2f16(<2 x half> %data, ptr addrspace(8) %rsrc, i32 %index, i32 0, i32 0, i32 0)47 ret void48}49 50define amdgpu_kernel void @buffer_store_format_d16_xyz(ptr addrspace(8) %rsrc, <4 x half> %data, i32 %index) {51; UNPACKED-LABEL: buffer_store_format_d16_xyz:52; UNPACKED: ; %bb.0: ; %main_body53; UNPACKED-NEXT: s_load_dwordx2 s[4:5], s[8:9], 0x1054; UNPACKED-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x055; UNPACKED-NEXT: s_load_dword s6, s[8:9], 0x1856; UNPACKED-NEXT: s_waitcnt lgkmcnt(0)57; UNPACKED-NEXT: s_and_b32 s5, s5, 0xffff58; UNPACKED-NEXT: s_lshr_b32 s7, s4, 1659; UNPACKED-NEXT: s_and_b32 s4, s4, 0xffff60; UNPACKED-NEXT: v_mov_b32_e32 v0, s461; UNPACKED-NEXT: v_mov_b32_e32 v1, s762; UNPACKED-NEXT: v_mov_b32_e32 v2, s563; UNPACKED-NEXT: v_mov_b32_e32 v3, s664; UNPACKED-NEXT: buffer_store_format_d16_xyz v[0:2], v3, s[0:3], 0 idxen65; UNPACKED-NEXT: s_endpgm66;67; PACKED-LABEL: buffer_store_format_d16_xyz:68; PACKED: ; %bb.0: ; %main_body69; PACKED-NEXT: s_load_dwordx2 s[4:5], s[8:9], 0x1070; PACKED-NEXT: s_load_dword s6, s[8:9], 0x1871; PACKED-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x072; PACKED-NEXT: s_waitcnt lgkmcnt(0)73; PACKED-NEXT: s_and_b32 s5, s5, 0xffff74; PACKED-NEXT: v_mov_b32_e32 v0, s475; PACKED-NEXT: v_mov_b32_e32 v1, s576; PACKED-NEXT: v_mov_b32_e32 v2, s677; PACKED-NEXT: buffer_store_format_d16_xyz v[0:1], v2, s[0:3], 0 idxen78; PACKED-NEXT: s_endpgm79main_body:80 %data_subvec = shufflevector <4 x half> %data, <4 x half> poison, <3 x i32> <i32 0, i32 1, i32 2>81 call void @llvm.amdgcn.struct.ptr.buffer.store.format.v3f16(<3 x half> %data_subvec, ptr addrspace(8) %rsrc, i32 %index, i32 0, i32 0, i32 0)82 ret void83}84 85define amdgpu_kernel void @buffer_store_format_d16_xyzw(ptr addrspace(8) %rsrc, <4 x half> %data, i32 %index) {86; UNPACKED-LABEL: buffer_store_format_d16_xyzw:87; UNPACKED: ; %bb.0: ; %main_body88; UNPACKED-NEXT: s_load_dwordx2 s[4:5], s[8:9], 0x1089; UNPACKED-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x090; UNPACKED-NEXT: s_load_dword s6, s[8:9], 0x1891; UNPACKED-NEXT: s_waitcnt lgkmcnt(0)92; UNPACKED-NEXT: s_lshr_b32 s7, s5, 1693; UNPACKED-NEXT: s_and_b32 s5, s5, 0xffff94; UNPACKED-NEXT: s_lshr_b32 s8, s4, 1695; UNPACKED-NEXT: s_and_b32 s4, s4, 0xffff96; UNPACKED-NEXT: v_mov_b32_e32 v0, s497; UNPACKED-NEXT: v_mov_b32_e32 v1, s898; UNPACKED-NEXT: v_mov_b32_e32 v2, s599; UNPACKED-NEXT: v_mov_b32_e32 v3, s7100; UNPACKED-NEXT: v_mov_b32_e32 v4, s6101; UNPACKED-NEXT: buffer_store_format_d16_xyzw v[0:3], v4, s[0:3], 0 idxen102; UNPACKED-NEXT: s_endpgm103;104; PACKED-LABEL: buffer_store_format_d16_xyzw:105; PACKED: ; %bb.0: ; %main_body106; PACKED-NEXT: s_load_dwordx2 s[4:5], s[8:9], 0x10107; PACKED-NEXT: s_load_dword s6, s[8:9], 0x18108; PACKED-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0109; PACKED-NEXT: s_waitcnt lgkmcnt(0)110; PACKED-NEXT: v_mov_b32_e32 v0, s4111; PACKED-NEXT: v_mov_b32_e32 v1, s5112; PACKED-NEXT: v_mov_b32_e32 v2, s6113; PACKED-NEXT: buffer_store_format_d16_xyzw v[0:1], v2, s[0:3], 0 idxen114; PACKED-NEXT: s_endpgm115main_body:116 call void @llvm.amdgcn.struct.ptr.buffer.store.format.v4f16(<4 x half> %data, ptr addrspace(8) %rsrc, i32 %index, i32 0, i32 0, i32 0)117 ret void118}119 120define amdgpu_kernel void @buffer_store_format_i16_x(ptr addrspace(8) %rsrc, [8 x i32], i16 %data, [8 x i32], i32 %index) {121; GCN-LABEL: buffer_store_format_i16_x:122; GCN: ; %bb.0: ; %main_body123; GCN-NEXT: s_load_dword s4, s[8:9], 0x30124; GCN-NEXT: s_load_dword s5, s[8:9], 0x54125; GCN-NEXT: s_load_dwordx4 s[0:3], s[8:9], 0x0126; GCN-NEXT: s_waitcnt lgkmcnt(0)127; GCN-NEXT: v_mov_b32_e32 v0, s4128; GCN-NEXT: v_mov_b32_e32 v1, s5129; GCN-NEXT: buffer_store_format_d16_x v0, v1, s[0:3], 0 idxen130; GCN-NEXT: s_endpgm131main_body:132 call void @llvm.amdgcn.struct.ptr.buffer.store.format.i16(i16 %data, ptr addrspace(8) %rsrc, i32 %index, i32 0, i32 0, i32 0)133 ret void134}135 136declare void @llvm.amdgcn.struct.ptr.buffer.store.format.f16(half, ptr addrspace(8), i32, i32, i32, i32)137declare void @llvm.amdgcn.struct.ptr.buffer.store.format.v2f16(<2 x half>, ptr addrspace(8), i32, i32, i32, i32)138declare void @llvm.amdgcn.struct.ptr.buffer.store.format.v3f16(<3 x half>, ptr addrspace(8), i32, i32, i32, i32)139declare void @llvm.amdgcn.struct.ptr.buffer.store.format.v4f16(<4 x half>, ptr addrspace(8), i32, i32, i32, i32)140declare void @llvm.amdgcn.struct.ptr.buffer.store.format.i16(i16, ptr addrspace(8), i32, i32, i32, i32)141