blob: e1055b98ba459371bf55145300b9ca3c2a2c2651 [file]
; RUN: llc -mtriple=amdgpu6.00 < %s | FileCheck --check-prefixes=SI-NOHSA,SI,FUNC %s
; RUN: llc -mtriple=amdgpu7.00-amdhsa < %s | FileCheck --check-prefixes=FUNC,CI-HSA,SI %s
; RUN: llc -mtriple=amdgpu8.02 -mattr=-flat-for-global < %s | FileCheck --check-prefixes=SI-NOHSA,SI,FUNC %s
; RUN: llc -mtriple=r600 -mcpu=redwood < %s | FileCheck -check-prefix=FUNC %s
; RUN: llc -mtriple=r600 -mcpu=cayman < %s | FileCheck -check-prefix=FUNC %s
; FUNC-LABEL: {{^}}load_i24:
; SI-DAG: {{flat|buffer}}_load_ubyte
; SI-DAG: {{flat|buffer}}_load_ushort
; SI: {{flat|buffer}}_store_dword
define amdgpu_kernel void @load_i24(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
%1 = load i24, ptr addrspace(1) %in
%2 = zext i24 %1 to i32
store i32 %2, ptr addrspace(1) %out
ret void
}
; FUNC-LABEL: {{^}}load_i25:
; SI-NOHSA: {{buffer|flat}}_load_dword [[VAL:v[0-9]+]]
; SI-NOHSA: buffer_store_dword [[VAL]]
; CI-HSA: flat_load_dword [[VAL:v[0-9]+]]
; CI-HSA: flat_store_dword v{{\[[0-9]+:[0-9]+\]}}, [[VAL]]
define amdgpu_kernel void @load_i25(ptr addrspace(1) %out, ptr addrspace(1) %in) #0 {
%tid = call i32 @llvm.amdgcn.workitem.id.x()
%in.tid = getelementptr inbounds i25, ptr addrspace(1) %in, i32 %tid
%1 = load i25, ptr addrspace(1) %in.tid
%2 = zext i25 %1 to i32
store i32 %2, ptr addrspace(1) %out
ret void
}
attributes #0 = { nounwind }