[Bug target/68837] PowerPC switch statement performance

segher at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jun 4 20:18:20 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68837

--- Comment #4 from Segher Boessenkool <segher at gcc dot gnu.org> ---
On Power9 the lwa insn is cracked into an lwz and an extsw, just like
on older CPUs.  Cracked instructions have fewer constraints on p9 than
they did on most older CPUs though (it doesn't have to be first in a
fetch group any more).

It still saves one insn to execute if lwz would be enough.  Another
option may be to just do an ld even: this saves the number of insns
needed, but it takes more space for the table (so it won't be cached /
prefetched as well), and absolute addresses require relocations.


More information about the Gcc-bugs mailing list