def Crc32Spec.update.msb

bend-osdev-crc@0.1.0.0 · crc.bend:168

import bend-osdev-crc@0.1.0.0/crc.bend as Crc
import Base

168# most significant bit first: the byte engine for widths of 8 and up, the
169# bit engine below
170def Crc32Spec.update.msb(small: Bool, +width: Nat, poly: U32, c: U32, xs: List<&2, U32>) -> U32:
171  match small:
172    case True{}:
173      s32.raw(xs, poly, Nat.sub(width, 1n), U32.sub(U32.shln(1, width), 1), c)
174    case False{}:
175      +shift = Nat.sub(width, 8n)
176      n32.raw(xs, poly, shift, U32.shln(1, Nat.sub(width, 1n)), U32.sub(U32.shln(1, width), 1), c)

Uses (9)

Used by (3)