Word64.W64.shl.pick: def of bend-osdev-word64@0.1.1.0 Import: import bend-osdev-word64@0.1.1.0/word64.bend as Word64 Lines 175-189 of bend-osdev-word64@0.1.1.0/word64.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&start_line=175&end_line=189 import Base # shifts by k bits: 0 leaves the word, 64 or more gives 0 def W64.shl.pick(z: Bool, lt32: Bool, lt64: Bool, +k: Nat, a: W64) -> W64: match z lt32 lt64: case True{} _ _: a case False{} True{} _: match a: case W64{h, +l}: W64{U32.or(U32.shln(h, k), U32.shrn(l, Nat.sub(32n, k))), U32.shln(l, k)} case False{} False{} True{}: match a: case W64{h, l}: W64{U32.shln(l, Nat.sub(k, 32n)), 0} case False{} False{} False{}: W64.zero() Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=U32.or 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.shrn https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64 https://jend.leeeet.dev/definition.txt?path=bend-osdev-word64@0.1.1.0/word64.bend&name=W64.zero