def S32.shr.if

bend-kit-int@0.2.0.0 · int.bend:681

import bend-kit-int@0.2.0.0/int.bend as Int
import Base

681# Shifts right are arithmetic: the sign bit fills in from the top.
682def S32.shr.if(neg: Bool, x: U32, k: Nat) -> U32:
683  match neg:
684    case True{}:
685      U32.not(U32.shrn(U32.not(x), k))
686    case False{}:
687      U32.shrn(x, k)

Uses (5)

Used by (1)