1 ; RUN: llc < %s -march=amdgcn -mcpu=tahiti -verify-machineinstrs | FileCheck %s
2 ; RUN: llc < %s -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs | FileCheck %s
4 ; CHECK-LABEL: {{^}}flt_f64:
5 ; CHECK: v_cmp_nge_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
6 define amdgpu_kernel void @flt_f64(i32 addrspace(1)* %out, double addrspace(1)* %in1,
7 double addrspace(1)* %in2) {
8 %r0 = load double, double addrspace(1)* %in1
9 %r1 = load double, double addrspace(1)* %in2
10 %r2 = fcmp ult double %r0, %r1
11 %r3 = zext i1 %r2 to i32
12 store i32 %r3, i32 addrspace(1)* %out
16 ; CHECK-LABEL: {{^}}fle_f64:
17 ; CHECK: v_cmp_ngt_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
18 define amdgpu_kernel void @fle_f64(i32 addrspace(1)* %out, double addrspace(1)* %in1,
19 double addrspace(1)* %in2) {
20 %r0 = load double, double addrspace(1)* %in1
21 %r1 = load double, double addrspace(1)* %in2
22 %r2 = fcmp ule double %r0, %r1
23 %r3 = zext i1 %r2 to i32
24 store i32 %r3, i32 addrspace(1)* %out
28 ; CHECK-LABEL: {{^}}fgt_f64:
29 ; CHECK: v_cmp_nle_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
30 define amdgpu_kernel void @fgt_f64(i32 addrspace(1)* %out, double addrspace(1)* %in1,
31 double addrspace(1)* %in2) {
32 %r0 = load double, double addrspace(1)* %in1
33 %r1 = load double, double addrspace(1)* %in2
34 %r2 = fcmp ugt double %r0, %r1
35 %r3 = zext i1 %r2 to i32
36 store i32 %r3, i32 addrspace(1)* %out
40 ; CHECK-LABEL: {{^}}fge_f64:
41 ; CHECK: v_cmp_nlt_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
42 define amdgpu_kernel void @fge_f64(i32 addrspace(1)* %out, double addrspace(1)* %in1,
43 double addrspace(1)* %in2) {
44 %r0 = load double, double addrspace(1)* %in1
45 %r1 = load double, double addrspace(1)* %in2
46 %r2 = fcmp uge double %r0, %r1
47 %r3 = zext i1 %r2 to i32
48 store i32 %r3, i32 addrspace(1)* %out
52 ; CHECK-LABEL: {{^}}fne_f64:
53 ; CHECK: v_cmp_neq_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
54 define amdgpu_kernel void @fne_f64(double addrspace(1)* %out, double addrspace(1)* %in1,
55 double addrspace(1)* %in2) {
56 %r0 = load double, double addrspace(1)* %in1
57 %r1 = load double, double addrspace(1)* %in2
58 %r2 = fcmp une double %r0, %r1
59 %r3 = select i1 %r2, double %r0, double %r1
60 store double %r3, double addrspace(1)* %out
64 ; CHECK-LABEL: {{^}}feq_f64:
65 ; CHECK: v_cmp_nlg_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
66 define amdgpu_kernel void @feq_f64(double addrspace(1)* %out, double addrspace(1)* %in1,
67 double addrspace(1)* %in2) {
68 %r0 = load double, double addrspace(1)* %in1
69 %r1 = load double, double addrspace(1)* %in2
70 %r2 = fcmp ueq double %r0, %r1
71 %r3 = select i1 %r2, double %r0, double %r1
72 store double %r3, double addrspace(1)* %out