2015-01-07 02:00:21 +08:00
|
|
|
; RUN: llc < %s -march=amdgcn -mcpu=tahiti -verify-machineinstrs | FileCheck %s
|
2017-01-25 06:02:15 +08:00
|
|
|
; RUN: llc < %s -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs | FileCheck %s
|
2013-07-13 02:15:19 +08:00
|
|
|
|
2014-11-14 07:03:09 +08:00
|
|
|
; CHECK-LABEL: {{^}}flt_f64:
|
2017-07-05 01:32:00 +08:00
|
|
|
; CHECK: v_cmp_nge_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @flt_f64(i32 addrspace(1)* %out, double addrspace(1)* %in1,
|
2013-07-13 02:15:19 +08:00
|
|
|
double addrspace(1)* %in2) {
|
2015-02-28 05:17:42 +08:00
|
|
|
%r0 = load double, double addrspace(1)* %in1
|
|
|
|
%r1 = load double, double addrspace(1)* %in2
|
2013-07-13 02:15:19 +08:00
|
|
|
%r2 = fcmp ult double %r0, %r1
|
2014-11-14 07:03:09 +08:00
|
|
|
%r3 = zext i1 %r2 to i32
|
|
|
|
store i32 %r3, i32 addrspace(1)* %out
|
2013-07-13 02:15:19 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-14 07:03:09 +08:00
|
|
|
; CHECK-LABEL: {{^}}fle_f64:
|
2017-07-05 01:32:00 +08:00
|
|
|
; CHECK: v_cmp_ngt_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @fle_f64(i32 addrspace(1)* %out, double addrspace(1)* %in1,
|
2013-07-13 02:15:19 +08:00
|
|
|
double addrspace(1)* %in2) {
|
2015-02-28 05:17:42 +08:00
|
|
|
%r0 = load double, double addrspace(1)* %in1
|
|
|
|
%r1 = load double, double addrspace(1)* %in2
|
2013-07-13 02:15:19 +08:00
|
|
|
%r2 = fcmp ule double %r0, %r1
|
2014-11-14 07:03:09 +08:00
|
|
|
%r3 = zext i1 %r2 to i32
|
|
|
|
store i32 %r3, i32 addrspace(1)* %out
|
2013-07-13 02:15:19 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-14 07:03:09 +08:00
|
|
|
; CHECK-LABEL: {{^}}fgt_f64:
|
2017-07-05 01:32:00 +08:00
|
|
|
; CHECK: v_cmp_nle_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @fgt_f64(i32 addrspace(1)* %out, double addrspace(1)* %in1,
|
2013-07-13 02:15:19 +08:00
|
|
|
double addrspace(1)* %in2) {
|
2015-02-28 05:17:42 +08:00
|
|
|
%r0 = load double, double addrspace(1)* %in1
|
|
|
|
%r1 = load double, double addrspace(1)* %in2
|
2013-07-13 02:15:19 +08:00
|
|
|
%r2 = fcmp ugt double %r0, %r1
|
2014-11-14 07:03:09 +08:00
|
|
|
%r3 = zext i1 %r2 to i32
|
|
|
|
store i32 %r3, i32 addrspace(1)* %out
|
2013-07-13 02:15:19 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-14 07:03:09 +08:00
|
|
|
; CHECK-LABEL: {{^}}fge_f64:
|
2017-07-05 01:32:00 +08:00
|
|
|
; CHECK: v_cmp_nlt_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @fge_f64(i32 addrspace(1)* %out, double addrspace(1)* %in1,
|
2013-07-13 02:15:19 +08:00
|
|
|
double addrspace(1)* %in2) {
|
2015-02-28 05:17:42 +08:00
|
|
|
%r0 = load double, double addrspace(1)* %in1
|
|
|
|
%r1 = load double, double addrspace(1)* %in2
|
2013-07-13 02:15:19 +08:00
|
|
|
%r2 = fcmp uge double %r0, %r1
|
2014-11-14 07:03:09 +08:00
|
|
|
%r3 = zext i1 %r2 to i32
|
|
|
|
store i32 %r3, i32 addrspace(1)* %out
|
2013-07-13 02:15:19 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-14 07:03:09 +08:00
|
|
|
; CHECK-LABEL: {{^}}fne_f64:
|
2017-07-05 01:32:00 +08:00
|
|
|
; CHECK: v_cmp_neq_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @fne_f64(double addrspace(1)* %out, double addrspace(1)* %in1,
|
2013-07-13 02:15:19 +08:00
|
|
|
double addrspace(1)* %in2) {
|
2015-02-28 05:17:42 +08:00
|
|
|
%r0 = load double, double addrspace(1)* %in1
|
|
|
|
%r1 = load double, double addrspace(1)* %in2
|
2013-07-13 02:15:19 +08:00
|
|
|
%r2 = fcmp une double %r0, %r1
|
|
|
|
%r3 = select i1 %r2, double %r0, double %r1
|
|
|
|
store double %r3, double addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-14 07:03:09 +08:00
|
|
|
; CHECK-LABEL: {{^}}feq_f64:
|
2017-07-05 01:32:00 +08:00
|
|
|
; CHECK: v_cmp_nlg_f64_e32 vcc, {{s[[0-9]+:[0-9]+], v[[0-9]+:[0-9]+]}}
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @feq_f64(double addrspace(1)* %out, double addrspace(1)* %in1,
|
2013-07-13 02:15:19 +08:00
|
|
|
double addrspace(1)* %in2) {
|
2015-02-28 05:17:42 +08:00
|
|
|
%r0 = load double, double addrspace(1)* %in1
|
|
|
|
%r1 = load double, double addrspace(1)* %in2
|
2013-07-13 02:15:19 +08:00
|
|
|
%r2 = fcmp ueq double %r0, %r1
|
|
|
|
%r3 = select i1 %r2, double %r0, double %r1
|
|
|
|
store double %r3, double addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|