Skip to content

Commit

Permalink
Add definitions for 128-bit unsafe_trunc when `llvm_arithmetic == t…
Browse files Browse the repository at this point in the history
…rue`
  • Loading branch information
christiangnrd committed Mar 7, 2025
1 parent ec873b3 commit aa90ef6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bfloat16.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ if llvm_arithmetic
Base.unsafe_trunc(::Type{$Ti}, x::BFloat16) = Base.fptoui($Ti, x)
end
end
Base.unsafe_trunc(::Type{UInt128}, x::BFloat16) = unsafe_trunc(UInt128, Float32(x))
Base.unsafe_trunc(::Type{Int128}, x::BFloat16) = unsafe_trunc(Int128, Float32(x))
else
Base.unsafe_trunc(T::Type{<:Integer}, x::BFloat16) = unsafe_trunc(T, Float32(x))
end
Expand Down

0 comments on commit aa90ef6

Please sign in to comment.