mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
R600: Compute masked bits for min and max
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205242 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -21,6 +21,21 @@ entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
; SI-LABEL: @trunc_zext_umax
|
||||
; SI: BUFFER_LOAD_UBYTE [[VREG:v[0-9]+]],
|
||||
; SI: V_MAX_U32_e32 [[RESULT:v[0-9]+]], 0, [[VREG]]
|
||||
; SI-NOT: AND
|
||||
; SI: BUFFER_STORE_SHORT [[RESULT]],
|
||||
define void @trunc_zext_umax(i16 addrspace(1)* nocapture %out, i8 addrspace(1)* nocapture %src) nounwind {
|
||||
%tmp5 = load i8 addrspace(1)* %src, align 1
|
||||
%tmp2 = zext i8 %tmp5 to i32
|
||||
%tmp3 = tail call i32 @llvm.AMDGPU.umax(i32 %tmp2, i32 0) nounwind readnone
|
||||
%tmp4 = trunc i32 %tmp3 to i8
|
||||
%tmp6 = zext i8 %tmp4 to i16
|
||||
store i16 %tmp6, i16 addrspace(1)* %out, align 2
|
||||
ret void
|
||||
}
|
||||
|
||||
; Function Attrs: readnone
|
||||
declare i32 @llvm.AMDGPU.umax(i32, i32) #1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user