Skip to content

Commit f3adb60

Browse files
committed
Clean-ups.
1 parent 367fe6d commit f3adb60

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

src/bytecode/writer.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ function mask_to_width(value::UInt128, ::Type{T}) where T <: Integer
313313
end
314314
end
315315

316-
317316
"""
318317
float_to_bits(value, dtype)
319318

src/compiler/intrinsics/core.jl

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -581,22 +581,13 @@ end
581581
#=============================================================================#
582582

583583
"""
584-
operation_identity(fn, dtype, elem_type) -> IdentityVal
585584
to_uint128(value)
586585
587586
Convert an integer value to UInt128 for storage in IntegerIdentityVal.
588587
For 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

0 commit comments

Comments
 (0)