-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Labels
floatsFloating-point supportFloating-point support
Description
I think these functions are incorrect in one corner case.
take this IR:
declare float @llvm.min.f32(float, float)
declare float @llvm.max.f32(float, float)
declare float @llvm.minnum.f32(float, float)
declare float @llvm.maxnum.f32(float, float)
declare float @llvm.minimum.f32(float, float)
declare float @llvm.maximum.f32(float, float)
declare float @llvm.minimumnum.f32(float, float)
declare float @llvm.maximumnum.f32(float, float)
define float @f() {
%2 = call float @llvm.maxnum.f32(float 0x0000000000000000, float 0x8000000000000000)
ret float %2
}
here's what alive-exec says:
~/svn/code/alive2/fp$ ~/alive2-regehr/build/alive-exec tmp.ll
----------------------------------------
define float @f() {
#0:
%#1 = fmax float 0.000000, -0.000000
ret float %#1
}
Executing %#0
%#1 = #x80000000
Returned #x80000000 / true
~/svn/code/alive2/fp$
but LangRef says that "-0.0 < +0.0 for the purposes of this intrinsic."
the analogous case for minnum
is also wrong:
~/svn/code/alive2/fp$ ~/alive2-regehr/build/alive-exec tmp.ll
----------------------------------------
define float @f() {
#0:
%#1 = fmin float -0.000000, 0.000000
ret float %#1
}
Executing %#0
%#1 = #x00000000
Returned #x00000000 / true
Metadata
Metadata
Assignees
Labels
floatsFloating-point supportFloating-point support