2010-11-24 11:42:17 +00:00
|
|
|
; RUN: llc --march=cellspu %s -o - | FileCheck %s
|
2007-12-19 20:50:49 +00:00
|
|
|
|
2009-01-26 03:31:40 +00:00
|
|
|
; Exercise the floating point comparison operators for f32:
|
|
|
|
|
2007-12-19 20:50:49 +00:00
|
|
|
declare double @fabs(double)
|
|
|
|
declare float @fabsf(float)
|
|
|
|
|
|
|
|
define i1 @fcmp_eq(float %arg1, float %arg2) {
|
2010-11-24 11:42:17 +00:00
|
|
|
; CHECK: fceq
|
|
|
|
; CHECK: bi $lr
|
2009-01-26 03:31:40 +00:00
|
|
|
%A = fcmp oeq float %arg1, %arg2
|
2008-03-05 23:00:19 +00:00
|
|
|
ret i1 %A
|
2007-12-19 20:50:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define i1 @fcmp_mag_eq(float %arg1, float %arg2) {
|
2010-11-24 11:42:17 +00:00
|
|
|
; CHECK: fcmeq
|
|
|
|
; CHECK: bi $lr
|
2009-01-26 03:31:40 +00:00
|
|
|
%1 = call float @fabsf(float %arg1)
|
|
|
|
%2 = call float @fabsf(float %arg2)
|
|
|
|
%3 = fcmp oeq float %1, %2
|
|
|
|
ret i1 %3
|
2007-12-19 20:50:49 +00:00
|
|
|
}
|
2010-11-24 11:42:17 +00:00
|
|
|
|
|
|
|
define i1 @test_ogt(float %a, float %b) {
|
|
|
|
; CHECK: fcgt
|
|
|
|
; CHECK: bi $lr
|
|
|
|
%cmp = fcmp ogt float %a, %b
|
|
|
|
ret i1 %cmp
|
|
|
|
}
|
|
|
|
|
|
|
|
define i1 @test_ugt(float %a, float %b) {
|
|
|
|
; CHECK: fcgt
|
|
|
|
; CHECK: bi $lr
|
|
|
|
%cmp = fcmp ugt float %a, %b
|
|
|
|
ret i1 %cmp
|
|
|
|
}
|