Skip to content

Commit

Permalink
Fix llvm powi intrinsic calls in fastmath.jl (#44580)
Browse files Browse the repository at this point in the history
  • Loading branch information
pchintalapudi authored Mar 12, 2022
1 parent 24d5268 commit b49a1b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/fastmath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ exp10_fast(x::Union{Float32,Float64}) = Base.Math.exp10_fast(x)

# builtins

pow_fast(x::Float32, y::Integer) = ccall("llvm.powi.f32", llvmcall, Float32, (Float32, Int32), x, y)
pow_fast(x::Float64, y::Integer) = ccall("llvm.powi.f64", llvmcall, Float64, (Float64, Int32), x, y)
pow_fast(x::Float32, y::Integer) = ccall("llvm.powi.f32.i32", llvmcall, Float32, (Float32, Int32), x, y)
pow_fast(x::Float64, y::Integer) = ccall("llvm.powi.f64.i32", llvmcall, Float64, (Float64, Int32), x, y)
pow_fast(x::FloatTypes, ::Val{p}) where {p} = pow_fast(x, p) # inlines already via llvm.powi
@inline pow_fast(x, v::Val) = Base.literal_pow(^, x, v)

Expand Down

0 comments on commit b49a1b4

Please sign in to comment.