Mojo function
bitcast
bitcast[new_type: DType, new_width: Int, src_type: DType, src_width: Int](val: SIMD[src_type, src_width]) -> SIMD[$0, $1]
Bitcasts a SIMD value to another SIMD value.
Constraints:
The bitwidth of the two types must be the same.
Parameters:
- βnew_type (
DType
): The target type. - βnew_width (
Int
): The target width. - βsrc_type (
DType
): The source type. - βsrc_width (
Int
): The source width.
Args:
- βval (
SIMD[src_type, src_width]
): The source value.
Returns:
A new SIMD value with the specified type and width with a bitcopy of the source SIMD value.
bitcast[new_type: DType, src_type: DType](val: SIMD[src_type, 1]) -> SIMD[$0, 1]
Bitcasts a SIMD value to another SIMD value.
Constraints:
The bitwidth of the two types must be the same.
Parameters:
- βnew_type (
DType
): The target type. - βsrc_type (
DType
): The source type.
Args:
- βval (
SIMD[src_type, 1]
): The source value.
Returns:
A new SIMD value with the specified type and width with a bitcopy of the source SIMD value.
bitcast[new_type: DType, src_width: Int](val: SIMD[bool, src_width]) -> SIMD[$0, 1]
Packs a SIMD bool into an integer.
Constraints:
The bitwidth of the two types must be the same.
Parameters:
- βnew_type (
DType
): The target type. - βsrc_width (
Int
): The source width.
Args:
- βval (
SIMD[bool, src_width]
): The source value.
Returns:
A new integer scalar which has the same bitwidth as the bool vector.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!