Skip to main content

function

bit_reverse

bit_reverse[type: DType, simd_width: Int](val: SIMD[type, simd_width]) -> SIMD[$0, $1]

Element-wise reverses the bitpattern of a SIMD vector of integer values.

Constraints:

The element type of the input vector must be integral.

Parameters:

  • type (DType): dtype used for the computation.
  • simd_width (Int): SIMD width used for the computation.

Args:

  • val (SIMD[type, simd_width]): The input value.

Returns:

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.