def s32.bits

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

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

107# the bits p - 1 down to 0 of h, into register c
108def s32.bits(+n: Nat, +poly: U32, +topsh: Nat, +mask: U32, +h: U32, +c: U32) -> U32:
109  match n:
110    case 0n:
111      c
112    case 1n+p:
113      s32.bits(p, poly, topsh, mask, h, s32.pick(U32.is_eq(U32.and(U32.xor(U32.shrn(c, topsh), U32.shrn(h, p)), 1), 1), poly, mask, c))

Uses (7)

Used by (2)