Mojo function
bit_reverse
bit_reverse(val: Int) -> Int
Reverses the bitpattern of an integer value.
Args:
- βval (
Int): The input value.
Returns:
Int: The input value with its bitpattern reversed.
bit_reverse[dtype: DType, width: Int, //](val: SIMD[dtype, width]) -> SIMD[dtype, width]
Element-wise reverses the bitpattern of a SIMD vector of integer values.
Constraints:
The element type of the input vector must be integral.
Parameters:
- βdtype (
DType):dtypeused for the computation. - βwidth (
Int): SIMD width used for the computation.
Args:
- βval (
SIMD): The input value.
Returns:
SIMD: A SIMD value where the element at position i has a reversed bitpattern
of an integer value of the element at position i of the input value.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!