Skip to content

Commit 2c855e3

Browse files
committed
Use Base.tanpi in intrinsics
`tanpi` is in Julia since 1.10 so allsupported versions have it
1 parent 1b811cb commit 2c855e3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/device/intrinsics/math.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ end
267267
@device_override Base.tanh(x::Float16) = ccall("extern air.tanh.f16", llvmcall, Float16, (Float16,), x)
268268

269269
@device_function tanpi_fast(x::Float32) = ccall("extern air.fast_tanpi.f32", llvmcall, Cfloat, (Cfloat,), x)
270-
@device_function tanpi(x::Float32) = ccall("extern air.tanpi.f32", llvmcall, Cfloat, (Cfloat,), x)
271-
@device_function tanpi(x::Float16) = ccall("extern air.tanpi.f16", llvmcall, Float16, (Float16,), x)
270+
@device_override Base.tanpi(x::Float32) = ccall("extern air.tanpi.f32", llvmcall, Cfloat, (Cfloat,), x)
271+
@device_override Base.tanpi(x::Float16) = ccall("extern air.tanpi.f16", llvmcall, Float16, (Float16,), x)
272272

273273
@device_function trunc_fast(x::Float32) = ccall("extern air.fast_trunc.f32", llvmcall, Cfloat, (Cfloat,), x)
274274
@device_override Base.trunc(x::Float32) = ccall("extern air.trunc.f32", llvmcall, Cfloat, (Cfloat,), x)
@@ -418,7 +418,7 @@ end
418418
j = fma(1.442695f0, a, 12582912.0f0)
419419
j = j - 12582912.0f0
420420
i = unsafe_trunc(Int32, j)
421-
f = fma(j, -6.93145752f-1, a) # log_2_hi
421+
f = fma(j, -6.93145752f-1, a) # log_2_hi
422422
f = fma(j, -1.42860677f-6, f) # log_2_lo
423423

424424
# approximate r = exp(f)-1 on interval [-log(2)/2, +log(2)/2]

0 commit comments

Comments
 (0)