https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106484
--- Comment #3 from rsaxvc at gmail dot com --- > 32-bit division by constant relies on a 32x32->64 bit multiply. I believe only the upper half of the bits are required for the product to represent the integer component of the quotient. This makes parameter passing much easier in the uint64_t/constant case. > We don't have an instruction for that on arm nor does gcc support 128-bit > integer types on a 32-bit compiler. I ran into that as well. The attached uint64_t umulh( uint64_t a, uint64_t b ) implements a 64x64->64MSBsOf128BitProduct using only 32x32->64 bit multiplication, 64-bit addition, and register-aligned shifting.