1 ; RUN: llc -mtriple=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=FUNC %s
2 ; RUN: llc -mtriple=amdgcn-amdhsa -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefix=FUNC %s
3 ; RUN: llc -mtriple=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=FUNC %s
4 ; RUN: llc -mtriple=r600 -mcpu=redwood < %s | FileCheck --check-prefixes=EG,FUNC %s
6 ; FIXME: This seems to not ever actually become an extload
7 ; FUNC-LABEL: {{^}}global_anyext_load_i8:
8 ; GCN: buffer_load_dword v{{[0-9]+}}
9 ; GCN: buffer_store_dword v{{[0-9]+}}
11 ; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+.[XYZW]]],
12 ; EG: VTX_READ_32 [[VAL]]
13 define amdgpu_kernel void @global_anyext_load_i8(ptr addrspace(1) nocapture noalias %out, ptr addrspace(1) nocapture noalias %src) nounwind {
14 %load = load i32, ptr addrspace(1) %src
15 %x = bitcast i32 %load to <4 x i8>
16 store <4 x i8> %x, ptr addrspace(1) %out
20 ; FUNC-LABEL: {{^}}global_anyext_load_i16:
21 ; GCN: buffer_load_dword v{{[0-9]+}}
22 ; GCN: buffer_store_dword v{{[0-9]+}}
24 ; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+.[XYZW]]],
25 ; EG: VTX_READ_32 [[VAL]]
26 define amdgpu_kernel void @global_anyext_load_i16(ptr addrspace(1) nocapture noalias %out, ptr addrspace(1) nocapture noalias %src) nounwind {
27 %load = load i32, ptr addrspace(1) %src
28 %x = bitcast i32 %load to <2 x i16>
29 store <2 x i16> %x, ptr addrspace(1) %out
33 ; FUNC-LABEL: {{^}}local_anyext_load_i8:
34 ; GCN: ds_read_b32 v{{[0-9]+}}
35 ; GCN: ds_write_b32 v{{[0-9]+}}
37 ; EG: LDS_READ_RET {{.*}}, [[VAL:T[0-9]+.[XYZW]]]
38 ; EG: LDS_WRITE * [[VAL]]
39 define amdgpu_kernel void @local_anyext_load_i8(ptr addrspace(3) nocapture noalias %out, ptr addrspace(3) nocapture noalias %src) nounwind {
40 %load = load i32, ptr addrspace(3) %src
41 %x = bitcast i32 %load to <4 x i8>
42 store <4 x i8> %x, ptr addrspace(3) %out
46 ; FUNC-LABEL: {{^}}local_anyext_load_i16:
47 ; GCN: ds_read_b32 v{{[0-9]+}}
48 ; GCN: ds_write_b32 v{{[0-9]+}}
50 ; EG: LDS_READ_RET {{.*}}, [[VAL:T[0-9]+.[XYZW]]]
51 ; EG: LDS_WRITE * [[VAL]]
52 define amdgpu_kernel void @local_anyext_load_i16(ptr addrspace(3) nocapture noalias %out, ptr addrspace(3) nocapture noalias %src) nounwind {
53 %load = load i32, ptr addrspace(3) %src
54 %x = bitcast i32 %load to <2 x i16>
55 store <2 x i16> %x, ptr addrspace(3) %out