IntegerUtils.kl

Types

FlagAndIndex (struct)

Simple structure that stores a flag and a 31-bit index into a UInt32 value.

Members

UInt32 value  

Methods

  FlagAndIndex ( in FlagAndIndex other )
  FlagAndIndex ()
  clearFlag ! ()
FlagAndIndex clone ? ()
  get ? ( io Boolean flag, io UInt32 index )
Boolean getFlag ? ()
UInt32 getIndex ? ()
  getMaybeInvalidIndex ? ( io Boolean flag, io UInt32 index )
UInt32 getMaybeInvalidIndex ? ()
Boolean getThenClearFlag ! ()
Boolean getThenSetFlag ! ()
Boolean isInvalidIndex ? ()
UInt32 set ! ( in Boolean flag, in UInt32 index )
  setFlag ! ()
UInt32 setIndex ! ( in UInt32 index )

Functions

getFlag

Boolean getFlag ( in UInt8 val, in UInt8 flag )

returns true if a given UInt8 flag is part of the UInt8 bit mask

setFlag

setFlag ( io UInt8 val, in UInt8 flag )

sets a given UInt8 flag as part of the UInt8 bit mask

atomicGetThenSetFlag

Boolean atomicGetThenSetFlag ( io UInt8 val, in UInt8 flag )

sets a given UInt8 flag as part of the UInt8 bit mask

getThenSetFlag

Boolean getThenSetFlag ( io UInt16 val, in UInt16 flag )

sets a given UInt16 flag as part of the UInt16 bit mask and returns the previous value

clearFlag

clearFlag ( io UInt16 val, in UInt16 flag )

atomicGetThenClearFlag

Boolean atomicGetThenClearFlag ( io UInt16 val, in UInt16 flag )

removes a given UInt16 flag from an UInt16 bit mask

getThenClearFlag

Boolean getThenClearFlag ( io UInt32 val, in UInt32 flag )

removes a given UInt32 flag as part of the UInt32 bit mask and returns the previous value

getFlag

Boolean getFlag ( in UInt8 val, in UInt8 flag )

returns true if a given UInt8 flag is part of the UInt8 bit mask

setFlag

setFlag ( io UInt8 val, in UInt8 flag )

sets a given UInt8 flag as part of the UInt8 bit mask

atomicGetThenSetFlag

Boolean atomicGetThenSetFlag ( io UInt8 val, in UInt8 flag )

sets a given UInt8 flag as part of the UInt8 bit mask

getThenSetFlag

Boolean getThenSetFlag ( io UInt16 val, in UInt16 flag )

sets a given UInt16 flag as part of the UInt16 bit mask and returns the previous value

clearFlag

clearFlag ( io UInt16 val, in UInt16 flag )

atomicGetThenClearFlag

Boolean atomicGetThenClearFlag ( io UInt16 val, in UInt16 flag )

removes a given UInt16 flag from an UInt16 bit mask

getThenClearFlag

Boolean getThenClearFlag ( io UInt32 val, in UInt32 flag )

removes a given UInt32 flag as part of the UInt32 bit mask and returns the previous value

getFlag

Boolean getFlag ( in UInt8 val, in UInt8 flag )

returns true if a given UInt8 flag is part of the UInt8 bit mask

setFlag

setFlag ( io UInt8 val, in UInt8 flag )

sets a given UInt8 flag as part of the UInt8 bit mask

atomicGetThenSetFlag

Boolean atomicGetThenSetFlag ( io UInt8 val, in UInt8 flag )

sets a given UInt8 flag as part of the UInt8 bit mask

getThenSetFlag

Boolean getThenSetFlag ( io UInt16 val, in UInt16 flag )

sets a given UInt16 flag as part of the UInt16 bit mask and returns the previous value

clearFlag

clearFlag ( io UInt16 val, in UInt16 flag )

atomicGetThenClearFlag

Boolean atomicGetThenClearFlag ( io UInt16 val, in UInt16 flag )

removes a given UInt16 flag from an UInt16 bit mask

getThenClearFlag

Boolean getThenClearFlag ( io UInt32 val, in UInt32 flag )

removes a given UInt32 flag as part of the UInt32 bit mask and returns the previous value

swap

swap ( io LocalL16UInt64Array first, io LocalL16UInt64Array second )

swaps one LocalL16UInt64Array with another one

Log2RoundUp

UInt8 Log2RoundUp ( in UInt32 value )

performs a logarithmic round up for the provided value

getBit

Boolean getBit ( in UInt64 val, in UInt64 bit )

returns true if a given UInt64 flag is part of the UInt64 bit mask

setBit

setBit ( io UInt64 val, in UInt64 bit )

sets a bit of a given UInt64 value

atomicSetBit

atomicSetBit ( io UInt32 val, in UInt32 bit )

sets a certain bit of a given UInt32 value

getThenSetBit

Boolean getThenSetBit ( io UInt64 val, in UInt64 bit )

first gets and then sets a bit of a UInt64 value

clearBit

clearBit ( io UInt64 val, in UInt64 bit )

sets a bit of a UInt64 value to 0

atomicClearBit

atomicClearBit ( io UInt32 val, in UInt32 bit )

sets a bit to 0 for a given UInt32 value

getThenClearBit

Boolean getThenClearBit ( io UInt32 val, in UInt32 bit )

first gets and then clears a bit of a given UInt32 value

setBit

setBit ( io UInt64 val, in UInt64 bit )

sets a bit of a given UInt64 value

atomicSetBit

atomicSetBit ( io UInt32 val, in UInt32 bit )

sets a certain bit of a given UInt32 value

getThenSetBit

Boolean getThenSetBit ( io UInt64 val, in UInt64 bit )

first gets and then sets a bit of a UInt64 value

getSetBitsString

String getSetBitsString ( in UInt64 val )

returns a UInt64 number as a bitmask

getBit

Boolean getBit ( in UInt64 val, in UInt64 bit )

returns true if a given UInt64 flag is part of the UInt64 bit mask

setBit

setBit ( io UInt64 val, in UInt64 bit )

sets a bit of a given UInt64 value

getThenSetBit

Boolean getThenSetBit ( io UInt64 val, in UInt64 bit )

first gets and then sets a bit of a UInt64 value

clearBit

clearBit ( io UInt64 val, in UInt64 bit )

sets a bit of a UInt64 value to 0

setBit

setBit ( io UInt64 val, in UInt64 bit )

sets a bit of a given UInt64 value

getThenSetBit

Boolean getThenSetBit ( io UInt64 val, in UInt64 bit )

first gets and then sets a bit of a UInt64 value

getSetBitsString

String getSetBitsString ( in UInt64 val )

returns a UInt64 number as a bitmask