1; RUN: llc -march=amdgcn -stop-after=amdgpu-isel < %s | FileCheck -check-prefix=GCN %s
2; RUN: llc -march=amdgcn -mcpu=gfx906 -stop-after=amdgpu-isel < %s | FileCheck -check-prefix=GCN_DL %s
3
4; GCN-LABEL: name:            uniform_xnor_i64
5; GCN: S_XNOR_B64
6define amdgpu_kernel void @uniform_xnor_i64(i64 addrspace(1)* %out, i64 %a, i64 %b) {
7  %xor = xor i64 %a, %b
8  %res = xor i64 %xor, -1
9  store i64 %res, i64 addrspace(1)* %out
10  ret void
11}
12; GCN-LABEL: name:            divergent_xnor_i64
13; GCN: V_XOR_B32_e64
14; GCN: V_XOR_B32_e64
15; GCN: V_NOT_B32_e32
16; GCN: V_NOT_B32_e32
17; GCN_DL: V_XNOR_B32_e64
18; GCN_DL: V_XNOR_B32_e64
19define i64 @divergent_xnor_i64(i64 addrspace(1)* %out, i64 %a, i64 %b) {
20  %xor = xor i64 %a, %b
21  %res = xor i64 %xor, -1
22  ret i64 %res
23}
24
25; GCN-LABEL: name:            uniform_xnor_i32
26; GCN: S_XNOR_B32
27define amdgpu_kernel void @uniform_xnor_i32(i32 addrspace(1)* %out, i32 %a, i32 %b) {
28  %xor = xor i32 %a, %b
29  %res = xor i32 %xor, -1
30  store i32 %res, i32 addrspace(1)* %out
31  ret void
32}
33
34; GCN-LABEL: name:            divergent_xnor_i32
35; GCN: V_XOR_B32_e64
36; GCN: V_NOT_B32_e32
37; GCN_DL: V_XNOR_B32_e64
38define i32 @divergent_xnor_i32(i32 addrspace(1)* %out, i32 %a, i32 %b) {
39  %xor = xor i32 %a, %b
40  %res = xor i32 %xor, -1
41  ret i32 %res
42}
43
44declare i32 @llvm.amdgcn.workitem.id.x() #0
45