2017-02-22 08:02:21 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=SI %s
|
2017-01-25 06:02:15 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=VI %s
|
2015-12-16 01:02:52 +08:00
|
|
|
|
2017-01-25 06:02:15 +08:00
|
|
|
; GCN-LABEL: {{^}}mbcnt_intrinsics:
|
2017-05-15 22:28:23 +08:00
|
|
|
; GCN: v_mbcnt_lo_u32_b32{{(_e64)*}} [[LO:v[0-9]+]], -1, 0
|
2017-01-25 06:02:15 +08:00
|
|
|
; SI: v_mbcnt_hi_u32_b32_e32 {{v[0-9]+}}, -1, [[LO]]
|
2017-05-15 22:28:23 +08:00
|
|
|
; VI: v_mbcnt_hi_u32_b32 {{v[0-9]+}}, -1, [[LO]]
|
2018-09-10 10:54:25 +08:00
|
|
|
define amdgpu_ps void @mbcnt_intrinsics(<16 x i8> addrspace(4)* inreg %arg, <16 x i8> addrspace(4)* inreg %arg1, <32 x i8> addrspace(4)* inreg %arg2, i32 inreg %arg3) {
|
2015-12-16 01:02:52 +08:00
|
|
|
main_body:
|
2017-02-22 08:02:21 +08:00
|
|
|
%lo = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
|
|
|
|
%hi = call i32 @llvm.amdgcn.mbcnt.hi(i32 -1, i32 %lo) #0
|
|
|
|
%tmp = bitcast i32 %hi to float
|
|
|
|
call void @llvm.amdgcn.exp.f32(i32 0, i32 15, float %tmp, float %tmp, float %tmp, float %tmp, i1 true, i1 true) #1
|
2015-12-16 01:02:52 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2017-11-14 06:55:05 +08:00
|
|
|
; GCN-LABEL: {{^}}mbcnt_lo_known_bits:
|
|
|
|
; GCN: v_mbcnt_lo_u32_b32
|
|
|
|
; GCN-NOT: and
|
|
|
|
define i32 @mbcnt_lo_known_bits(i32 %x, i32 %y) #0 {
|
|
|
|
%lo = call i32 @llvm.amdgcn.mbcnt.lo(i32 %x, i32 %y)
|
|
|
|
%mask = and i32 %lo, 63
|
|
|
|
ret i32 %mask
|
|
|
|
}
|
|
|
|
|
|
|
|
; GCN-LABEL: {{^}}mbcnt_hi_known_bits:
|
|
|
|
; GCN: v_mbcnt_hi_u32_b32
|
|
|
|
; GCN-NOT: and
|
|
|
|
define i32 @mbcnt_hi_known_bits(i32 %x, i32 %y) #0 {
|
|
|
|
%hi = call i32 @llvm.amdgcn.mbcnt.hi(i32 %x, i32 %y)
|
|
|
|
%mask = and i32 %hi, 63
|
|
|
|
ret i32 %mask
|
|
|
|
}
|
|
|
|
|
2017-02-22 08:02:21 +08:00
|
|
|
declare i32 @llvm.amdgcn.mbcnt.lo(i32, i32) #0
|
|
|
|
declare i32 @llvm.amdgcn.mbcnt.hi(i32, i32) #0
|
|
|
|
declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1) #1
|
2015-12-16 01:02:52 +08:00
|
|
|
|
2017-02-22 08:02:21 +08:00
|
|
|
attributes #0 = { nounwind readnone }
|
|
|
|
attributes #1 = { nounwind }
|