]> git.sesse.net Git - stockfish/commitdiff
Enable popcount and prefetch for ppc-64
authorDaniel Axtens <dja@axtens.net>
Wed, 10 Jul 2019 23:12:54 +0000 (09:12 +1000)
committerStéphane Nicolet <cassio@free.fr>
Thu, 11 Jul 2019 09:30:09 +0000 (11:30 +0200)
PowerPC has had popcount instructions for a long time, at least as far
back as POWER5 (released 2004). Enable them via a gcc builtin.

Using a gcc builtin has the added bonus that if compiled for a processor
that lacks a hardware instruction, gcc will include a software popcount
implementation that does not use the instruction. It might be slower
than the table lookups (or it might be faster) but it will certainly work.
So this isn't going to break anything.

On my POWER8 VM, this leads to a ~4.27% speedup.

Fir prefetch, the gcc builtin generates a 'dcbt' instruction, which is
supported at least as far back as the G5 (2002) and POWER4 (2001).

This leads to a ~5% speedup on my POWER8 VM.

No functional change


No differences found