File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -313,7 +313,6 @@ function mask_to_width(value::UInt128, ::Type{T}) where T <: Integer
313313 end
314314end
315315
316-
317316"""
318317 float_to_bits(value, dtype)
319318
Original file line number Diff line number Diff line change @@ -581,22 +581,13 @@ end
581581#= ============================================================================#
582582
583583"""
584- operation_identity(fn, dtype, elem_type) -> IdentityVal
585584 to_uint128(value)
586585
587586Convert an integer value to UInt128 for storage in IntegerIdentityVal.
588587For signed types, this returns the two's complement bit representation.
589588"""
590- # Unsigned types: directly convert
591- to_uint128 (value:: UInt64 ) = UInt128 (value)
592- to_uint128 (value:: UInt32 ) = UInt128 (value)
593- to_uint128 (value:: UInt16 ) = UInt128 (value)
594- to_uint128 (value:: UInt8 ) = UInt128 (value)
595- # Signed types: reinterpret as unsigned first, then convert
596- to_uint128 (value:: Int64 ) = UInt128 (reinterpret (UInt64, value))
597- to_uint128 (value:: Int32 ) = UInt128 (reinterpret (UInt32, value))
598- to_uint128 (value:: Int16 ) = UInt128 (reinterpret (UInt16, value))
599- to_uint128 (value:: Int8 ) = UInt128 (reinterpret (UInt8, value))
589+ to_uint128 (value:: T ) where T <: Unsigned = UInt128 (value)
590+ to_uint128 (value:: T ) where T <: Signed = UInt128 (reinterpret (unsigned (T), value))
600591
601592"""
602593 operation_identity(fn, dtype, elem_type) -> IdentityVal
You can’t perform that action at this time.
0 commit comments