1 ; RUN: llc -march=amdgcn -stop-after=amdgpu-isel < %s | FileCheck -check-prefix=GCN %s
3 ; GCN-LABEL: name: uniform_imin
5 define amdgpu_kernel void @uniform_imin(ptr addrspace(1) %out, i32 %a, i32 %b) #0 {
6 %cmp = icmp sle i32 %a, %b
7 %val = select i1 %cmp, i32 %a, i32 %b
8 store i32 %val, ptr addrspace(1) %out, align 4
12 ; GCN-LABEL: name: divergent_imin
14 define void @divergent_imin(ptr addrspace(1) %out, i32 %a, i32 %b) #0 {
15 %cmp = icmp sle i32 %a, %b
16 %val = select i1 %cmp, i32 %a, i32 %b
17 store i32 %val, ptr addrspace(1) %out, align 4
21 ; GCN-LABEL: name: uniform_umin
23 define amdgpu_kernel void @uniform_umin(ptr addrspace(1) %out, i32 %a, i32 %b) #0 {
24 %tmp = icmp ule i32 %a, %b
25 %val = select i1 %tmp, i32 %a, i32 %b
26 store i32 %val, ptr addrspace(1) %out, align 8
30 ; GCN-LABEL: name: divergent_umin
32 define void @divergent_umin(ptr addrspace(1) %out, i32 %a, i32 %b) #0 {
33 %tmp = icmp ule i32 %a, %b
34 %val = select i1 %tmp, i32 %a, i32 %b
35 store i32 %val, ptr addrspace(1) %out, align 8
39 ; GCN-LABEL: name: uniform_imax
41 define amdgpu_kernel void @uniform_imax(ptr addrspace(1) %out, i32 %a, i32 %b) nounwind {
42 %cmp = icmp sge i32 %a, %b
43 %val = select i1 %cmp, i32 %a, i32 %b
44 store i32 %val, ptr addrspace(1) %out, align 4
48 ; GCN-LABEL: name: divergent_imax
50 define void @divergent_imax(ptr addrspace(1) %out, i32 %a, i32 %b) nounwind {
51 %cmp = icmp sge i32 %a, %b
52 %val = select i1 %cmp, i32 %a, i32 %b
53 store i32 %val, ptr addrspace(1) %out, align 4
57 ; GCN-LABEL: name: uniform_umax
59 define amdgpu_kernel void @uniform_umax(ptr addrspace(1) %out, i32 %a, i32 %b) nounwind {
60 %cmp = icmp uge i32 %a, %b
61 %val = select i1 %cmp, i32 %a, i32 %b
62 store i32 %val, ptr addrspace(1) %out, align 4
66 ; GCN-LABEL: name: divergent_umax
68 define void @divergent_umax(ptr addrspace(1) %out, i32 %a, i32 %b) nounwind {
69 %cmp = icmp uge i32 %a, %b
70 %val = select i1 %cmp, i32 %a, i32 %b
71 store i32 %val, ptr addrspace(1) %out, align 4