nxt.bitop_ex

Various extensions to core.bitop and std.bitmanip.

Members

Aliases

bt
alias bt = testBit
Undocumented in source.
btm
alias btm = makeBit
Undocumented in source.
btr
alias btr = resetBit
Undocumented in source.
bts
alias bts = setBit
Undocumented in source.
getBottomBit
alias getBottomBit = getLowestBit
Undocumented in source.
getLsbit
alias getLsbit = getLowestBit
Undocumented in source.
getMsbit
alias getMsbit = getHighestBit
Undocumented in source.
getTopBit
alias getTopBit = getHighestBit
Undocumented in source.
resetBottomBit
alias resetBottomBit = resetLowestBit
Undocumented in source.
resetTopBit
alias resetTopBit = resetHighestBit
Undocumented in source.
setBottomBit
alias setBottomBit = setLowestBit
Undocumented in source.
setLsbit
alias setLsbit = setLowestBit
Undocumented in source.
setMsbit
alias setMsbit = setHighestBit
Undocumented in source.
setTopBit
alias setTopBit = setHighestBit
Undocumented in source.

Functions

getHighestBit
bool getHighestBit(T a)

Get highest bit of a.

getLowestBit
bool getLowestBit(T a)

Get lowest bit of a.

makeBit
T makeBit(I bixs)
resetBit
void resetBit(T a, I bixs)

Reset bits I of a (to zero).

resetBit
void resetBit(T* a, I bixs)

Reset bits I of *a (to zero).

resetBit
void resetBit(T a, I bixs)

Reset bits I of a (to zero).

resetHighestBit
void resetHighestBit(T a)

Reset highest bit of a (to zero).

resetLowestBit
void resetLowestBit(T a)

Reset lowest bit of a (to zero).

setBit
void setBit(T a, I bixs)

Test and sets the bix:th bit of a to one. * * Returns: A non-zero value if the bit was set, and a zero if it was clear.

setBit
void setBit(T* a, I bixs)

Sets the bix:th bit of *a to one.

setBit
void setBit(T a, I bixs)

Sets the bix:th bit of *a to one.

setHighestBit
void setHighestBit(T a)

Set highest bit of a to one.

setLowestBit
void setLowestBit(T a)

Set lowest bit of a to one.

testBit
bool testBit(T a, I bixs)
testBit
bool testBit(T a, I bixs)
testBit
bool testBit(T* a, I bixs)

Templates

UnsignedOfSameSizeAs
template UnsignedOfSameSizeAs(T)

Get an unsigned type of size as T if possible.

Meta

Authors

TODO: Add range checking of bit indexes.

TODO: Make use of TZCNT and LZCNT either as inline assembly or as builtins: https://github.com/dlang/dmd/pull/6364