@@ -70,31 +70,30 @@ LogB(::Val{:ℯ}, ::Type{Float16}) = -0.6931472f0
7070LogB (:: Val{10} , :: Type{Float16} ) = - 0.30103f0
7171
7272# Range reduced kernels
73- @inline function expm1b_kernel (:: Val{2} , x:: Float64 )
73+ function expm1b_kernel (:: Val{2} , x:: Float64 )
7474 return x * evalpoly (x, (0.6931471805599393 , 0.24022650695910058 ,
7575 0.05550411502333161 , 0.009618129548366803 ))
7676end
77- @inline function expm1b_kernel (:: Val{:ℯ} , x:: Float64 )
77+ function expm1b_kernel (:: Val{:ℯ} , x:: Float64 )
7878 return x * evalpoly (x, (0.9999999999999912 , 0.4999999999999997 ,
7979 0.1666666857598779 , 0.04166666857598777 ))
8080end
81-
82- @inline function expm1b_kernel (:: Val{10} , x:: Float64 )
81+ function expm1b_kernel (:: Val{10} , x:: Float64 )
8382 return x * evalpoly (x, (2.3025850929940255 , 2.6509490552391974 ,
8483 2.034678825384765 , 1.1712552025835192 ))
8584end
8685
87- @inline function expb_kernel (:: Val{2} , x:: Float32 )
86+ function expb_kernel (:: Val{2} , x:: Float32 )
8887 return evalpoly (x, (1.0f0 , 0.6931472f0 , 0.2402265f0 ,
8988 0.05550411f0 , 0.009618025f0 ,
9089 0.0013333423f0 , 0.00015469732f0 , 1.5316464f-5 ))
9190end
92- @inline function expb_kernel (:: Val{:ℯ} , x:: Float32 )
91+ function expb_kernel (:: Val{:ℯ} , x:: Float32 )
9392 return evalpoly (x, (1.0f0 , 1.0f0 , 0.5f0 , 0.16666667f0 ,
9493 0.041666217f0 , 0.008333249f0 ,
9594 0.001394858f0 , 0.00019924171f0 ))
9695end
97- @inline function expb_kernel (:: Val{10} , x:: Float32 )
96+ function expb_kernel (:: Val{10} , x:: Float32 )
9897 return evalpoly (x, (1.0f0 , 2.3025851f0 , 2.650949f0 ,
9998 2.0346787f0 , 1.1712426f0 , 0.53937745f0 ,
10099 0.20788547f0 , 0.06837386f0 ))
@@ -178,7 +177,7 @@ const J_TABLE = (0x0000000000000000, 0xaac00b1afa5abcbe, 0x9b60163da9fb3335, 0xa
178177# XXX we want to mark :consistent-cy here so that this function can be concrete-folded,
179178# because the effect analysis currently can't prove it in the presence of `@inbounds` or
180179# `:boundscheck`, but still the access to `J_TABLE` is really safe here
181- Base. @assume_effects :consistent @inline function table_unpack (ind:: Int32 )
180+ @noinline Base. @assume_effects :consistent @inline function table_unpack (ind:: Int32 )
182181 ind = ind & 255 + 1 # 255 == length(J_TABLE) - 1
183182 j = @inbounds J_TABLE[ind]
184183 jU = reinterpret (Float64, JU_CONST | (j& JU_MASK))
224223 if k <= - 53
225224 # The UInt64 forces promotion. (Only matters for 32 bit systems.)
226225 twopk = (k + UInt64 (53 )) << 52
227- return reinterpret (T, twopk + reinterpret (UInt64, small_part))* ( 2.0 ^ -53 )
226+ return reinterpret (T, twopk + reinterpret (UInt64, small_part))* 0x1 p - 53
228227 end
229228 # k == 1024 && return (small_part * 2.0) * 2.0^1023
230229 end
249248 if k <= - 53
250249 # The UInt64 forces promotion. (Only matters for 32 bit systems.)
251250 twopk = (k + UInt64 (53 )) << 52
252- return reinterpret (T, twopk + reinterpret (UInt64, small_part))* ( 2.0 ^ -53 )
251+ return reinterpret (T, twopk + reinterpret (UInt64, small_part))* 0x1 p - 53
253252 end
254253 # k == 1024 && return (small_part * 2.0) * 2.0^1023
255254 end
@@ -324,8 +323,8 @@ for (func, fast_func, base) in ((:exp2, :exp2_fast, Val(2)),
324323 (:exp , :exp_fast , Val (:ℯ )),
325324 (:exp10 , :exp10_fast , Val (10 )))
326325 @eval begin
327- $ func (x:: Union{Float16,Float32,Float64} ) = exp_impl (x, $ base)
328- $ fast_func (x:: Union{Float32,Float64} ) = exp_impl_fast (x, $ base)
326+ @noinline $ func (x:: Union{Float16,Float32,Float64} ) = exp_impl (x, $ base)
327+ @noinline $ fast_func (x:: Union{Float32,Float64} ) = exp_impl_fast (x, $ base)
329328 end
330329end
331330
0 commit comments