1 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=CHECK %s
3 ;CHECK-LABEL: {{^}}ret:
4 ;CHECK: v_cmp_eq_u32_e32 [[CMP:[^,]+]], v0, v1
5 ;CHECK: s_wqm_b64 [[WQM:[^,]+]], [[CMP]]
6 ;CHECK: v_cndmask_b32_e64 v0, 0, 1.0, [[WQM]]
7 define amdgpu_ps float @ret(i32 %v0, i32 %v1) #1 {
9 %c = icmp eq i32 %v0, %v1
10 %w = call i1 @llvm.amdgcn.wqm.vote(i1 %c)
11 %r = select i1 %w, float 1.0, float 0.0
15 ;CHECK-LABEL: {{^}}true:
17 define amdgpu_ps float @true() #1 {
19 %w = call i1 @llvm.amdgcn.wqm.vote(i1 true)
20 %r = select i1 %w, float 1.0, float 0.0
24 ;CHECK-LABEL: {{^}}false:
26 define amdgpu_ps float @false() #1 {
28 %w = call i1 @llvm.amdgcn.wqm.vote(i1 false)
29 %r = select i1 %w, float 1.0, float 0.0
33 ;CHECK-LABEL: {{^}}kill:
34 ;CHECK: v_cmp_eq_u32_e32 [[CMP:[^,]+]], v0, v1
35 ;CHECK: s_wqm_b64 [[WQM:[^,]+]], [[CMP]]
36 ;CHECK: s_and_b64 exec, exec, [[WQM]]
38 define amdgpu_ps void @kill(i32 %v0, i32 %v1) #1 {
40 %c = icmp eq i32 %v0, %v1
41 %w = call i1 @llvm.amdgcn.wqm.vote(i1 %c)
42 call void @llvm.amdgcn.kill(i1 %w)
46 declare void @llvm.amdgcn.kill(i1) #1
47 declare i1 @llvm.amdgcn.wqm.vote(i1)
49 attributes #1 = { nounwind }