News for hackers. Stuff that matters.
Re:Faster remainders when the divisor is a constant: beating... by acqq on Saturday February 09, 2019 @10:24AM (#19122696)
Just write a function “mydiv10” which returns if x < 99 { x /10 and 0 otherwise and try again.
Re:Faster remainders when the divisor is a constant: beating... by acqq on Sunday February 10, 2019 @04:39PM (#19130218)
Like this:

https://godbolt.org/z/bS2yzB

But also note that when the input is unsigned short we get:

https://godbolt.org/z/sbDbMU

        movzx   eax, di
        imul    eax, eax, 52429
        shr     eax, 19