Module bitwise::word [] [src]

Algorithms for single words (u8...u64).

Reexports

pub use morton::decode_2d as morton_decode_2d;
pub use morton::decode_3d as morton_decode_3d;
pub use morton::encode_2d as morton_encode_2d;
pub use morton::encode_3d as morton_encode_3d;

Modules

gcd

Greatest Common Divisor algorithms that use bit manipulation.

morton

Encoding/decoding of Morton Z-curve indices.

Traits

AlignDown

Method version of align_down.

AlignUp

Method version of align_up.

CeilPow2

Method version of ceil_pow2.

ClearBit

Method version of clear_bit.

ClearBitsGeq

Method version of clear_bits_geq.

ClearBitsLeq

Method version of clear_bits_leq.

ClearLeastSignificantOne

Method version of clear_least_significant_one.

ClearTrailingOnes

Method version of clear_trailing_ones.

CopyBit

Method version of copy_bit.

CountLeadingOnes

Method version of count_leading_ones.

CountLeadingZeros

Method version of count_leading_zeros.

CountOnes

Method version of count_ones.

CountTrailingOnes

Method version of count_trailing_ones.

CountTrailingZeros

Method version of count_trailing_zeros.

CountZeros

Method version of count_zeros.

ExtractBits

Method version of extract_bits.

FlipBit

Method version of flip_bit.

FlipBitsGeq

Method version of flip_bits_geq.

FlipBitsLeq

Method version of flip_bits_leq.

FloorPow2

Method version of floor_pow2.

FromWord

From-like trait for words.

HammingDistance

Method version of hamming_distance.

InnerPerfectShuffle

Method version of inner_perfect_shuffle.

InnerPerfectUnshuffle

Method version of inner_perfect_unshuffle.

IsAligned

Method version of is_aligned.

IsEven

Method version of is_even.

IsOdd

Method version of is_odd.

IsPow2

Method version of is_pow2.

IsolateLeastSignificantOne

Method version of isolate_least_significant_one.

IsolateLeastSignificantZero

Method version of isolate_least_significant_zero.

MaskTrailingOnes

Method version of mask_trailing_ones.

MaskTrailingOnesAndLeastSignificantZero

Method version of mask_trailing_zeros_and_least_significant_zero.

MaskTrailingZeros

Method version of mask_trailing_zeros.

MaskTrailingZerosAndLeastSignificantOne

Method version of mask_trailing_zeros_and_least_significant_one.

OuterPerfectShuffle

Method version of outer_perfect_shuffle.

OuterPerfectUnshuffle

Method version of outer_perfect_unshuffle.

ParallelBitsDeposit

Method version of parallel_bits_deposit.

ParallelBitsExtract

Method version of parallel_bits_extract.

Parity

Method version of parity.

ReverseBitGroups

Method version of reverse_bit_groups.

ReverseBitNibbles

Method version of reverse_bit_nibbles.

ReverseBitPairs

Method version of reverse_bit_pairs.

ReverseBits

Method version of reverse_bits.

ReverseByteGroups

Method version of reverse_byte_groups.

ReverseBytes

Method version of reverse_bytes.

RotateLeft

Method version of rotate_left.

RotateRight

Method version of rotate_right.

SAL

Method version of shift_arithmetic_left.

SAR

Method version of shift_arithmetic_right.

SLL

Method version of shift_logical_left.

SLR

Method version of shift_logical_right.

SetBit

Method version of set_bit.

SetBitsGeq

Method version of set_bits_geq.

SetBitsLeq

Method version of set_bits_leq.

SetLeastSignificantZero

Method version of set_least_significant_zero.

SetTrailingZeros

Method version of set_trailing_zeros.

SwapBytes

Method version of swap_bytes.

TestBit

Method version of test_bit.

ToWord

Into-like trait for words.

UnsignedWord

Unsigned word.

Word

Integer trait used to parametrize algorithms for all integer types.

Functions

align_down

Align x down to alignment.

align_up

Align x up to alignment.

ceil_pow2

Round x to the next power of 2.

clear_bit

Clear the bit of x.

clear_bits_geq

Clears all bits of x at position >= bit.

clear_bits_leq

Clears all bits of x at position <= bit.

clear_least_significant_one

Clear least significant set bit of x.

clear_trailing_ones

Clear the trailing bits set of x.

copy_bit

Copys the from_bit of x into y at to_bit.

count_leading_ones

Count the number of leading ones in the binary representation of x.

count_leading_zeros

Counts the number of leading zeros in the binary representation of x.

count_ones

Number of ones in the binary representation of x.

count_trailing_ones

Number of trailing ones in the binary representation of x.

count_trailing_zeros

Count the number of trailing zeros in the binary representation of x.

count_zeros

Number of zeros in the binary representation of x.

extract_bits

Extract bits [start, start + length) from x into the lower bits of the result.

flip_bit

Flip the bit of x.

flip_bits_geq

Flips all bits of x at position >= bit.

flip_bits_leq

Flips all bits of x at position <= bit.

floor_pow2

Round x to the previous power of 2.

from_be

Convert integer from big endian to the target's endianness.

from_le

Convert integer from little endian to the target's endianness.

hamming_distance

Hamming distance between the binary representation of x and y.

inner_perfect_shuffle

Inner Perfect Shuffle of x.

inner_perfect_unshuffle

Inner Perfect Unshuffle of x.

is_aligned

Is x aligned to alignment bytes.

is_even

Is x even.

is_odd

Is x odd.

is_pow2

Is x a power of 2.

isolate_least_significant_one

Returns mask with the least significant set bit of x set to 1.

isolate_least_significant_zero

Returns mask with the least significant zero bit of x set to 1.

mask_trailing_ones

Returns mask with the trailing 1's of self set.

mask_trailing_ones_and_least_significant_zero

Returns mask with all trailing 1's of x and the least significant 0 bit set.

mask_trailing_zeros

Returns mask with the trailing 0's of x set.

mask_trailing_zeros_and_least_significant_one

Returns mask with all of the trailing 0's of x and the least significant 1 bit set.

outer_perfect_shuffle

Outer Perfect Shuffle of x.

outer_perfect_unshuffle

Outer Perfect Unshuffle of x.

parallel_bits_deposit

Parallel bits deposit of mask into x.

parallel_bits_extract

Parallel bits extract of mask from x.

parity

Number of set bits in x mod 2; i.e. 1 if the number of set bits in x is odd, zero otherwise

pow

Raises x to the power of exp.

reverse_bit_groups

Reverses groups of bits within each subword of x.

reverse_bit_nibbles

Reverses the nibbles of x.

reverse_bit_pairs

Reverses the pairs of bits of x.

reverse_bits

Reverses the bits of x.

reverse_byte_groups

Reverses groups of bytes within each subword of x

reverse_bytes

Reverses the bytes of x.

rotate_left

Shifts the bits of x to the left by n wrapping the truncated bits to the end of the result.

rotate_right

Shifts the bits of x to the right by n wrapping the truncated bits to the beginning of the result.

set_bit

Sets the bit of x.

set_bits_geq

Sets all bits of x at position >= bit.

set_bits_leq

Sets all bits of x at position <= bit.

set_least_significant_zero

Set least significant 0 bit of x.

set_trailing_zeros

Set the trailing 0's of x.

shift_arithmetic_left

Shift the bits of x to the left by n.

shift_arithmetic_right

Shift the bits of x to the right by n; the high-order bits of the result are set to the value of the most significant bit of x.

shift_logical_left

Shift the bits to the left by a specified amount, n.

shift_logical_right

Shift the bits of x to the right n; the high-order bits of the result are cleared.

swap_bytes

Reverses the order of the bytes of x.

test_bit

Test the bit of x.

to_be

Convert x to big endian from the target's endianness.

to_le

Convert x to little endian from the target's endianness.