Basecase assembly optimisation project
tg at gmplib.org
Thu Oct 3 19:00:41 CEST 2013
nisse at lysator.liu.se (Niels Möller) writes:
Another feature, which I looked into while ago without getting very far
with the loopmixer, is to make it understand associativity. I.e, try
reordering certain instructions with the same destination register, like
xor %r8, %rax
xor %r9, %rax
add %r8, %rax
add %r9, %rax
This is possible if nothing else depends on the intermediate results
(including no dependencies on status flags).
Probably more useful for cryptographic loops than for arithmetic.
I think this couldd be very useful also for the critical multiply-
accumulate loops of GMP. The schema loops I create for the loopmixer
try many accumulation strategies. This is a lot of work, but I only in
practice try regular variants, while an automatic random-driven
re-association feature could try beneficial irregular variants too.
More information about the gmp-devel