-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linalg/pinv
failure on 32bit
#11642
Labels
system:32-bit
Affects only 32-bit systems
Comments
A slightly better repro. julia> using Base.Test
julia> debug = true
true
julia> for eltya in (Float32, Float64)
debug && println("\n\n<<<<<", eltya, ">>>>>")
debug && println("\n--- sub-normal constant ---")
a = pinv(realmin(eltya)/100)
@test_approx_eq a 0.0
debug && println("\n\n<<<<<Complex{", eltya, "}>>>>>")
debug && println("\n--- sub-normal constant ---")
a = pinv(realmin(eltya)/100*(1+1im))
@test_approx_eq a 0.0
end
<<<<<Float32>>>>>
--- sub-normal constant ---
ERROR: mismatch of non-finite elements:
a = Inf
0.0 = 0.0
in test_approx_eq at ./test.jl:131
in anonymous at ./no file:5 |
Maybe a llvm 3.6.1 bug? julia> a = (realmin(Float32) / 100)
1.1755f-40
julia> @code_llvm pinv(a)
define float @julia_pinv_21040(float) {
top:
%1 = fdiv float 1.000000e+00, %0
%2 = fsub float %1, %1
store volatile float %2, float* bitcast (i128* @jl_float_temp to float*), align 4
%3 = load volatile float* bitcast (i128* @jl_float_temp to float*), align 4
%4 = fcmp une float %3, 0.000000e+00
%5 = select i1 %4, float 0.000000e+00, float %1
ret float %5
}
julia> inv(a)
Inf32
julia> isfinite(inv(a))
false
julia> @code_lowered pinv(a)
1-element Array{Any,1}:
:($(Expr(:lambda, Any[:x], Any[Any[Any[:x,:Any,0],Any[:xi,:Any,18]],Any[],0,Any[]], :(begin # linalg/dense.jl, line 442:
xi = inv(x) # line 443:
return ifelse(isfinite(xi),xi,zero(xi))
end))))
julia> @code_native pinv(a)
.text
Filename: dense.jl
Source line: 0
pushl %ebp
movl %esp, %ebp
fld1
Source line: 442
fdivs 8(%ebp)
Source line: 443
fld %st(0)
fsub %st(1)
fstps -835670016
flds -835670016
fldz
fxch %st(1)
fucomp %st(1)
fnstsw %ax
sahf
jne L43
jp L43
fstp %st(0)
fldz
fxch %st(1)
L43: fstp %st(1)
popl %ebp |
This was referenced Jun 10, 2015
Close because this is a known issue with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got the following error on a 32bit container which I think I haven't seen on the CI before.
Version info.
The text was updated successfully, but these errors were encountered: