type uint128 … // mask6 returns a uint128 bitmask with the topmost n bits of a // 128-bit number. func mask6(n int) uint128 { … } // isZero reports whether u == 0. // // It's faster than u == (uint128{}) because the compiler (as of Go // 1.15/1.16b1) doesn't do this trick and instead inserts a branch in // its eq alg's generated code. func (u uint128) isZero() bool { … } // and returns the bitwise AND of u and m (u&m). func (u uint128) and(m uint128) uint128 { … } // xor returns the bitwise XOR of u and m (u^m). func (u uint128) xor(m uint128) uint128 { … } // or returns the bitwise OR of u and m (u|m). func (u uint128) or(m uint128) uint128 { … } // not returns the bitwise NOT of u. func (u uint128) not() uint128 { … } // subOne returns u - 1. func (u uint128) subOne() uint128 { … } // addOne returns u + 1. func (u uint128) addOne() uint128 { … } // halves returns the two uint64 halves of the uint128. // // Logically, think of it as returning two uint64s. // It only returns pointers for inlining reasons on 32-bit platforms. func (u *uint128) halves() [2]*uint64 { … } // bitsSetFrom returns a copy of u with the given bit // and all subsequent ones set. func (u uint128) bitsSetFrom(bit uint8) uint128 { … } // bitsClearedFrom returns a copy of u with the given bit // and all subsequent ones cleared. func (u uint128) bitsClearedFrom(bit uint8) uint128 { … }