Bitset.bv8: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/containers/bitset.bend as Bitset Lines 242-245 of bend-collections@1.0.0.0/src/containers/bitset.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/containers/bitset.bend&start_line=242&end_line=245 import Base # Sum of the populations of words q, q+1, ... (m of them). # Eight bits per iteration: word_count_t unrolled (the same shifts and adds). def bv8(+w: U32) -> Nat: Nat.add(bit_value(low(w)), Nat.add(bit_value(low(U32.shr(w))), Nat.add(bit_value(low(U32.shr(U32.shr(w)))), Nat.add(bit_value(low(U32.shr(U32.shr(U32.shr(w))))), Nat.add(bit_value(low(U32.shr(U32.shr(U32.shr(U32.shr(w)))))), Nat.add(bit_value(low(U32.shr(U32.shr(U32.shr(U32.shr(U32.shr(w))))))), Nat.add(bit_value(low(U32.shr(U32.shr(U32.shr(U32.shr(U32.shr(U32.shr(w)))))))), bit_value(low(U32.shr(U32.shr(U32.shr(U32.shr(U32.shr(U32.shr(U32.shr(w)))))))))))))))) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shr https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/bitset.bend&name=bit_value https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/bitset.bend&name=low