2017-10-24 18:26:59 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=CHECK %s
|
|
|
|
|
|
|
|
;CHECK-LABEL: {{^}}ret:
|
|
|
|
;CHECK: v_cmp_eq_u32_e32 [[CMP:[^,]+]], v0, v1
|
|
|
|
;CHECK: s_wqm_b64 [[WQM:[^,]+]], [[CMP]]
|
|
|
|
;CHECK: v_cndmask_b32_e64 v0, 0, 1.0, [[WQM]]
|
|
|
|
define amdgpu_ps float @ret(i32 %v0, i32 %v1) #1 {
|
|
|
|
main_body:
|
|
|
|
%c = icmp eq i32 %v0, %v1
|
|
|
|
%w = call i1 @llvm.amdgcn.wqm.vote(i1 %c)
|
|
|
|
%r = select i1 %w, float 1.0, float 0.0
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
|
|
|
;CHECK-LABEL: {{^}}true:
|
|
|
|
;CHECK: s_wqm_b64
|
|
|
|
define amdgpu_ps float @true() #1 {
|
|
|
|
main_body:
|
|
|
|
%w = call i1 @llvm.amdgcn.wqm.vote(i1 true)
|
|
|
|
%r = select i1 %w, float 1.0, float 0.0
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
|
|
|
;CHECK-LABEL: {{^}}false:
|
|
|
|
;CHECK: s_wqm_b64
|
|
|
|
define amdgpu_ps float @false() #1 {
|
|
|
|
main_body:
|
|
|
|
%w = call i1 @llvm.amdgcn.wqm.vote(i1 false)
|
|
|
|
%r = select i1 %w, float 1.0, float 0.0
|
|
|
|
ret float %r
|
|
|
|
}
|
|
|
|
|
|
|
|
;CHECK-LABEL: {{^}}kill:
|
|
|
|
;CHECK: v_cmp_eq_u32_e32 [[CMP:[^,]+]], v0, v1
|
|
|
|
;CHECK: s_wqm_b64 [[WQM:[^,]+]], [[CMP]]
|
2018-12-08 01:46:16 +08:00
|
|
|
;CHECK: s_and_b64 exec, exec, [[WQM]]
|
2017-10-24 18:26:59 +08:00
|
|
|
;CHECK: s_endpgm
|
|
|
|
define amdgpu_ps void @kill(i32 %v0, i32 %v1) #1 {
|
|
|
|
main_body:
|
|
|
|
%c = icmp eq i32 %v0, %v1
|
|
|
|
%w = call i1 @llvm.amdgcn.wqm.vote(i1 %c)
|
2018-12-08 01:46:16 +08:00
|
|
|
call void @llvm.amdgcn.kill(i1 %w)
|
2017-10-24 18:26:59 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-12-08 01:46:16 +08:00
|
|
|
declare void @llvm.amdgcn.kill(i1) #1
|
2017-10-24 18:26:59 +08:00
|
|
|
declare i1 @llvm.amdgcn.wqm.vote(i1)
|
|
|
|
|
|
|
|
attributes #1 = { nounwind }
|