Panther Search Documentation Tutorials Devlogs Downloads Source Code

Documentation > Panther Documentation > Intrinsics > @shl

@shl

Panther
Documentation


1: func @shl = <{T: Type, SHIFT_T: Type, MAY_WRAP: Bool}> (lhs: T, rhs: SHIFT_T) -> T;

  Bitwise shift left.

Template Parameters

  T: type of value to bitwise shift left - must be integral or a vector of integral

  SHIFT_T: must be unsigned integral with a width of ceil(log2(@numBits<{T, false}>()))

  MAY_WRAP: If true, operation is allowed to wrap

Parameters

  lhs: value to bitwise shift left

  rhs: amount to bitwise shift left value by

Return Value

  Returns the result of the bitwise shift left

Notes

  If T is unsigned integral and MAY_WRAP is false, it is undefined behavior if any 1 bits are shifted out.

  If T is signed integral and MAY_WRAP is false, it is undefined behavior if the result is a different sign than lhs.

Example

(TODO)

See Also

@shlSat Bitwise saturating shift left
@shr Bitwise saturating shift left