def Int.shr1
import bend-kit-int@0.2.0.0/int.bend as Intimport Base
259# Signed shifts right are arithmetic: the sign bit fills in from the top.
260def Int.shr1(+n: Nat, s: Bool, +w: Word(n)) -> Word(n):
261 match s:
262 case True{}:
263 Int.put_msb(n, Int.msb(n, w), Word.shr(n, w))
264 case False{}:
265 Word.shr(n, w)