def W64.mulhi.go
import bend-osdev-word64@0.1.1.0/word64.bend as Word64import Base
135# the high 32 bits of the 64-bit product of two 32-bit words, from their
136# 16-bit halves (every partial product fits in 32 bits)
137def W64.mulhi.go(+p00: U32, +p01: U32, +p10: U32, p11: U32) -> U32:
138 +mid = U32.add(U32.add(U32.shrn(p00, 16n), U32.and(p01, 65535)), U32.and(p10, 65535))
139 U32.add(U32.add(U32.add(p11, U32.shrn(p01, 16n)), U32.shrn(p10, 16n)), U32.shrn(mid, 16n))