UInt12Arrays.jl is a Julia package to support the use of arrays of 12-bit
unsigned integers and their elements. This package's main purpose is to
provide a UInt12Array
type that allows for the indexing into arrays of packed
UInt12
s.
Dealing with 12-bit integers is challenging because the the underlying LLVM integer support is based on integers that are a multiple of a byte (8-bits). For integer types that are a multiple of a byte, see BitIntegers.jl.
To use unsigned 12-bit integers (UInt12
) in computations, it is easiest to
load them as unsigned 16-bit integers (UInt16
). However, to conserve memory
it may be advantageous to keep the 12-bit integers packed into a dense array.
UInt12Array
that allows for indexing of arrays of packed UInt12
s.UInt16
(default element type of UInt12Array
)UInt12
type that boxes a UInt16
and implement 12-bit arithmeticUInt16
rather than UInt12
?As mentioned in the background, there is better hardware and compiler support
for UInt16
. Additionally the supporting code for UInt12
is under
development with the main implementation being a boxed UInt16
.