Skip to content

Commit aa90ef6

Browse files
committed
Add definitions for 128-bit unsafe_trunc when llvm_arithmetic == true
1 parent ec873b3 commit aa90ef6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/bfloat16.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ if llvm_arithmetic
290290
Base.unsafe_trunc(::Type{$Ti}, x::BFloat16) = Base.fptoui($Ti, x)
291291
end
292292
end
293+
Base.unsafe_trunc(::Type{UInt128}, x::BFloat16) = unsafe_trunc(UInt128, Float32(x))
294+
Base.unsafe_trunc(::Type{Int128}, x::BFloat16) = unsafe_trunc(Int128, Float32(x))
293295
else
294296
Base.unsafe_trunc(T::Type{<:Integer}, x::BFloat16) = unsafe_trunc(T, Float32(x))
295297
end

0 commit comments

Comments
 (0)