Skip to content

Commit 227ffa1

Browse files
authored
dont @inline large constants (#114)
* move large constants to noinline function * just dont inline _scale
1 parent 79fbfe6 commit 227ffa1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/floats.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ pow10(::Type{Float32}, e) = (@inbounds v = F32_SHORT_POWERS[e+1]; return v)
385385
pow10(::Type{Float64}, e) = (@inbounds v = F64_SHORT_POWERS[e+1]; return v)
386386
pow10(::Type{BigFloat}, e) = (@inbounds v = F64_SHORT_POWERS[e+1]; return v)
387387

388-
@inline function scale(::Type{T}, v, exp, neg) where {T}
388+
function scale(::Type{T}, v, exp, neg) where {T}
389389
ms = maxsig(T)
390390
cl = ceillog5(T)
391391
if v < ms
@@ -408,7 +408,7 @@ pow10(::Type{BigFloat}, e) = (@inbounds v = F64_SHORT_POWERS[e+1]; return v)
408408
return _scale(T, v, exp, neg)
409409
end
410410

411-
@inline function _scale(::Type{T}, v::UInt64, exp, neg) where {T}
411+
function _scale(::Type{T}, v::UInt64, exp, neg) where {T}
412412
mant, pow = pow10spl(exp + 326)
413413
lz = leading_zeros(v)
414414
newv = v << lz
@@ -471,7 +471,7 @@ function convert_and_apply_neg(::Type{BigFloat}, x::BigFloat, neg)
471471
return y
472472
end
473473

474-
@inline function _scale(::Type{T}, v::V, exp, neg) where {T, V <: UInt128}
474+
function _scale(::Type{T}, v::V, exp, neg) where {T, V <: UInt128}
475475
if exp == 23
476476
# special-case concluded from https://github.com/JuliaLang/julia/issues/38509
477477
x = v * V(1e23)
@@ -497,7 +497,7 @@ else
497497
const BIGFLOATEXP10 = [exp10(BigFloat(i)) for i = 1:308]
498498
end
499499

500-
@inline function _scale(::Type{T}, v::V, exp, neg) where {T, V <: BigInt}
500+
function _scale(::Type{T}, v::V, exp, neg) where {T, V <: BigInt}
501501
x = access_threaded(BigFloat, BIGFLOAT)
502502

503503
ccall((:mpfr_set_z, :libmpfr), Int32,

0 commit comments

Comments
 (0)