Traits§
Functions§
- bit_add
- Add two
L
bit numbers together to produce anL+1
bit number. Thus it will not overflow. Note that this uses big endian byte order! If your host CPU is little endian and your numbers are >8 bits, you will need to callfix_endianness()
on the bits. - comparator
- (a > b, a == b, a < b)
- fix_
endianness - Since bitslice logic is big endian, if you are running on a little endian CPU (such as x86 and most ARMs) you must swap the byte order before and after doing math. This function will swap byte order only on little endian machines, on big endian machines it should compile to a null op.
- full_
adder - full_
comparator - half_
adder - half_
comparator - pad
- Pads the integer with zeros on the most significant side, thus preserving the value while permitting it to be transposed and such like.
- popcnt2
- Counts the number of bits on an array of bits.
- popcnt4
- Counts the number of bits on an array of bits.
- popcnt8
- Counts the number of bits on an array of bits.
- popcnt16
- Counts the number of bits on an array of bits.
- popcnt32
- Counts the number of bits on an array of bits.
- popcnt64
- Counts the number of bits on an array of bits.
- popcnt128
- Counts the number of bits on an array of bits.
- popcnt256
- Counts the number of bits on an array of bits.
- popcnt512
- Counts the number of bits on an array of bits.
- popcnt1024
- Counts the number of bits on an array of bits.