tg at gmplib.org
Thu Sep 5 08:09:25 UTC 2019
nisse at lysator.liu.se (Niels Möller) writes:
I had a quick look at the machines that completed tuning this night.
These three seem to prefer the old code (HGCD2_METHOD == 2):
The others want HGCD_METHOD == 1, i.e., replacing div1 with plain
The table generator program has now run. Also pi1 wants the old code.
The next question is how badly they want it. :-)
I checked the small quotient division speed of tinker and pi2. It is 16
and 36 cycles, respectively. With 36 cycles, I am not surprised the
division instructions should be avoided. But why does tinker prefer
div1 before a 16 cycles division instruction?
I suppose it has a lot to do with pipeline length too. Only bwl ran
tonight (of the known slow x86 dividers). It prefers its 25 cycle
division instruction. But it has a super long pipeline, and random
branches on average will cost (pipeline length)/2. The low-end ARM
chips like cortex a12 (used by tinker) have short pipelines.
Did you have a chance of playing with some code which takes care of
small quotients without branches or division?
I feel pretty confident that with 25 cycles to play (as with Intel CPUs)
some bit operations for quotients <= 7 would give great speeup. Such
code is perhaps best written in assembly, but even C code should help!
Please encrypt, key id 0xC8601622
More information about the gmp-devel