2013-05-07 00:17:29 +08:00
|
|
|
; Test all condition-code masks that are relevant for floating-point
|
|
|
|
; comparisons.
|
|
|
|
;
|
|
|
|
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
|
|
|
|
|
|
|
|
define void @f1(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f1:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: je .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp oeq float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f2(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f2:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jlh .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp one float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f3(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f3:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jle .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp ole float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f4(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f4:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jl .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp olt float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f5(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f5:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jh .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp ogt float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f6(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f6:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jhe .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp oge float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f7(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f7:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jnlh .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp ueq float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f8(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f8:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jne .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp une float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f9(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f9:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jnh .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp ule float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f10(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f10:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jnhe .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp ult float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f11(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f11:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jnle .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp ugt float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @f12(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f12:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jnl .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp uge float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; "jno" == "jump if no overflow", which corresponds to "jump if ordered"
|
|
|
|
; rather than "jump if not ordered" after a floating-point comparison.
|
|
|
|
define void @f13(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f13:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jno .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp ord float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; "jo" == "jump if overflow", which corresponds to "jump if not ordered"
|
|
|
|
; rather than "jump if ordered" after a floating-point comparison.
|
|
|
|
define void @f14(float *%src, float %target) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f14:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: .cfi_startproc
|
|
|
|
; CHECK: .L[[LABEL:.*]]:
|
|
|
|
; CHECK: ceb %f0, 0(%r2)
|
2013-05-21 16:53:17 +08:00
|
|
|
; CHECK-NEXT: jo .L[[LABEL]]
|
2013-05-07 00:17:29 +08:00
|
|
|
br label %loop
|
|
|
|
loop:
|
2018-07-20 20:12:10 +08:00
|
|
|
%val = load volatile float, float *%src
|
2013-05-07 00:17:29 +08:00
|
|
|
%cond = fcmp uno float %target, %val
|
|
|
|
br i1 %cond, label %loop, label %exit
|
|
|
|
exit:
|
|
|
|
ret void
|
|
|
|
}
|