Skip to content
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

Look for fesetround in libm rather than the executable #16291

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions base/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export
rounding, setrounding,
get_zero_subnormals, set_zero_subnormals

const libm = Base.libm_name

## rounding modes ##
immutable RoundingMode{T} end

Expand Down Expand Up @@ -41,8 +43,8 @@ function from_fenv(r::Integer)
end
end

setrounding_raw{T<:Union{Float32,Float64}}(::Type{T},i::Integer) = ccall(:fesetround, Int32, (Int32,), i)
rounding_raw{T<:Union{Float32,Float64}}(::Type{T}) = ccall(:fegetround, Int32, ())
setrounding_raw{T<:Union{Float32,Float64}}(::Type{T},i::Integer) = ccall((:fesetround, libm), Int32, (Int32,), i)
rounding_raw{T<:Union{Float32,Float64}}(::Type{T}) = ccall((:fegetround, libm), Int32, ())

setrounding{T<:Union{Float32,Float64}}(::Type{T},r::RoundingMode) = setrounding_raw(T,to_fenv(r))
rounding{T<:Union{Float32,Float64}}(::Type{T}) = from_fenv(rounding_raw(T))
Expand Down
12 changes: 6 additions & 6 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ Array{T}(::Type{T}, m::Integer) = Array{T,1}(Int(m))
Array{T}(::Type{T}, m::Integer,n::Integer) = Array{T,2}(Int(m),Int(n))
Array{T}(::Type{T}, m::Integer,n::Integer,o::Integer) = Array{T,3}(Int(m),Int(n),Int(o))

# For OS specific stuff
include(String(vcat(length(Core.ARGS)>=2?Core.ARGS[2].data:"".data, "build_h.jl".data))) # include($BUILDROOT/base/build_h.jl)
include(String(vcat(length(Core.ARGS)>=2?Core.ARGS[2].data:"".data, "version_git.jl".data))) # include($BUILDROOT/base/version_git.jl)
include("osutils.jl")
include("c.jl")

# numeric operations
include("hashing.jl")
include("rounding.jl")
Expand Down Expand Up @@ -112,12 +118,6 @@ typealias StridedVector{T,A<:Union{DenseArray,StridedReshapedArray},I<:Tuple{Var
typealias StridedMatrix{T,A<:Union{DenseArray,StridedReshapedArray},I<:Tuple{Vararg{Union{RangeIndex, NoSlice, AbstractCartesianIndex}}}} Union{DenseArray{T,2}, SubArray{T,2,A,I}, StridedReshapedArray{T,2}}
typealias StridedVecOrMat{T} Union{StridedVector{T}, StridedMatrix{T}}

# For OS specific stuff
include(String(vcat(length(Core.ARGS)>=2?Core.ARGS[2].data:"".data, "build_h.jl".data))) # include($BUILDROOT/base/build_h.jl)
include(String(vcat(length(Core.ARGS)>=2?Core.ARGS[2].data:"".data, "version_git.jl".data))) # include($BUILDROOT/base/version_git.jl)
include("osutils.jl")
include("c.jl")

# Core I/O
include("io.jl")
include("iostream.jl")
Expand Down