2015-01-07 02:00:21 +08:00
|
|
|
;RUN: llc < %s -march=amdgcn -mcpu=SI -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
|
2015-01-28 01:27:15 +08:00
|
|
|
;RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs| FileCheck --check-prefix=SI --check-prefix=FUNC %s
|
2013-11-23 07:07:58 +08:00
|
|
|
|
|
|
|
; XXX: Merge this into setcc, once R600 supports 64-bit operations
|
|
|
|
|
|
|
|
;;;==========================================================================;;;
|
|
|
|
;; Double comparisons
|
|
|
|
;;;==========================================================================;;;
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_oeq:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_eq_f64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_oeq(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp oeq double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_ogt:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_gt_f64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_ogt(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp ogt double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_oge:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_ge_f64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_oge(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp oge double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_olt:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_lt_f64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_olt(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp olt double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_ole:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_le_f64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_ole(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp ole double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_one:
|
2014-12-12 06:15:35 +08:00
|
|
|
; SI: v_cmp_lg_f64_e32 vcc
|
2016-03-31 00:35:09 +08:00
|
|
|
; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_one(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp one double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_ord:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_o_f64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_ord(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp ord double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_ueq:
|
2014-12-12 06:15:43 +08:00
|
|
|
; SI: v_cmp_nlg_f64_e32 vcc
|
2016-03-31 00:35:09 +08:00
|
|
|
; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_ueq(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp ueq double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_ugt:
|
2014-12-12 06:15:39 +08:00
|
|
|
|
|
|
|
; SI: v_cmp_nle_f64_e32 vcc
|
2016-03-31 00:35:09 +08:00
|
|
|
; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_ugt(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp ugt double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_uge:
|
2014-12-12 06:15:39 +08:00
|
|
|
; SI: v_cmp_nlt_f64_e32 vcc
|
2016-03-31 00:35:09 +08:00
|
|
|
; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_uge(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp uge double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_ult:
|
2014-12-12 06:15:39 +08:00
|
|
|
; SI: v_cmp_nge_f64_e32 vcc
|
2016-03-31 00:35:09 +08:00
|
|
|
; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_ult(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp ult double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_ule:
|
2014-12-12 06:15:39 +08:00
|
|
|
; SI: v_cmp_ngt_f64_e32 vcc
|
2016-03-31 00:35:09 +08:00
|
|
|
; SI: v_cndmask_b32_e64 {{v[0-9]+}}, 0, -1, vcc
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_ule(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp ule double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_une:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_neq_f64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_une(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp une double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}f64_uno:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_u_f64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @f64_uno(i32 addrspace(1)* %out, double %a, double %b) {
|
|
|
|
entry:
|
|
|
|
%0 = fcmp uno double %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
;;;==========================================================================;;;
|
|
|
|
;; 64-bit integer comparisons
|
|
|
|
;;;==========================================================================;;;
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}i64_eq:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_eq_i64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @i64_eq(i32 addrspace(1)* %out, i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
%0 = icmp eq i64 %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}i64_ne:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_ne_i64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @i64_ne(i32 addrspace(1)* %out, i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
%0 = icmp ne i64 %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}i64_ugt:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_gt_u64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @i64_ugt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
%0 = icmp ugt i64 %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}i64_uge:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_ge_u64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @i64_uge(i32 addrspace(1)* %out, i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
%0 = icmp uge i64 %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}i64_ult:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_lt_u64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @i64_ult(i32 addrspace(1)* %out, i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
%0 = icmp ult i64 %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}i64_ule:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_le_u64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @i64_ule(i32 addrspace(1)* %out, i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
%0 = icmp ule i64 %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}i64_sgt:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_gt_i64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @i64_sgt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
%0 = icmp sgt i64 %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}i64_sge:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_ge_i64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @i64_sge(i32 addrspace(1)* %out, i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
%0 = icmp sge i64 %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}i64_slt:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_lt_i64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @i64_slt(i32 addrspace(1)* %out, i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
%0 = icmp slt i64 %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}i64_sle:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: v_cmp_le_i64
|
2013-11-23 07:07:58 +08:00
|
|
|
define void @i64_sle(i32 addrspace(1)* %out, i64 %a, i64 %b) {
|
|
|
|
entry:
|
|
|
|
%0 = icmp sle i64 %a, %b
|
|
|
|
%1 = sext i1 %0 to i32
|
|
|
|
store i32 %1, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|