Bits Module
Provides several useful functions to access a 32-bit bit data represented as either a uint32 or a uint64.
Functions and values
| Function or value |
Description
|
Full Usage:
Bits.concat n1 n2 shiftAmount
Parameters:
uint32
n2 : uint32
shiftAmount : int32
Returns: uint32
|
Concatenate n1 and n2 by shifting n1 to the left by the given shift
|
Full Usage:
Bits.extract binary ofs1 ofs2
Parameters:
uint32
ofs1 : uint32
ofs2 : uint32
Returns: uint32
|
Extract bit values located in between the given two offsets. The order of the offsets does not matter.
|
Full Usage:
Bits.getBitMask64 size
Parameters:
int
Returns: uint64
|
Get a bit mask (in uint64) of the given size.
|
Full Usage:
Bits.pick binary pos
Parameters:
uint32
pos : uint32
Returns: uint32
|
Pick a bit value at the given offset.
|
Full Usage:
Bits.signExtend originalSize targetSize v
Parameters:
int
targetSize : int
v : uint64
Returns: uint64
|
Sign-extend the given bit vector `v` of the size `originalSize` to the target size `targetSize`.
|
B2R2