Re:Faster remainders when the divisor is a constant: beating...
by saagarjha on Saturday February 09, 2019 @04:13AM
(#19121461)
This was exactly what I was about to mention; I can reproduce your results in Clang but it seems GCC doesn't want to optimize this? Here's what Godbolt gives me: https://godbolt.org/z/aFTdur
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.
clang 7
gcc 8.2 msvc 19 icc 19 The same, but when input unsigned char:clang 7
gcc 8.2 msvc 19 icc 19 clang and gcc with -O3, msvc -O2