Table.t32.update.msb: def of bend-osdev-crc@0.1.0.0 Import: import bend-osdev-crc@0.1.0.0/table.bend as Table Lines 60-70 of bend-osdev-crc@0.1.0.0/table.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-crc@0.1.0.0/table.bend&start_line=60&end_line=70 import Base import bend-osdev-crc@0.1.0.0/crc.bend as C # most significant bit first: a table for widths of 8 and up; below 8 the # input goes in a bit at a time, so the bitwise engine serves def t32.update.msb(small: Bool, +width: Nat, +poly: U32, c: U32, xs: List<&2, U32>) -> U32: match small: case True{}: C.s32.raw(xs, poly, Nat.sub(width, 1n), U32.sub(U32.shln(1, width), 1), c) case False{}: +shift = Nat.sub(width, 8n) +topbit = U32.shln(1, Nat.sub(width, 1n)) +mask = U32.sub(U32.shln(1, width), 1) t32.snd(t32.n.raw(xs, shift, mask, (t32.fill.n(256n, [0 : U32*256n], poly, shift, topbit, mask, 0), c))) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.new https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shln https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=bend-osdev-crc@0.1.0.0/crc.bend&name=s32.raw https://jend.leeeet.dev/definition.txt?path=bend-osdev-crc@0.1.0.0/table.bend&name=t32.fill.n https://jend.leeeet.dev/definition.txt?path=bend-osdev-crc@0.1.0.0/table.bend&name=t32.n.raw https://jend.leeeet.dev/definition.txt?path=bend-osdev-crc@0.1.0.0/table.bend&name=t32.snd