This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/38939] MULLW on often faster than SLWI ADD SLWI ADD..
- From: "segher at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 23 Nov 2015 01:40:11 +0000
- Subject: [Bug target/38939] MULLW on often faster than SLWI ADD SLWI ADD..
- Auto-submitted: auto-generated
- References: <bug-38939-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38939
Segher Boessenkool <segher at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-11-23
CC| |segher at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
The problem is that expand_mult (in expmed.c) calculates the cost of
the reg*0x01010101 as six cycles, namely, two to construct the constant
in a register and then four for the reg-reg multiply. The shift
sequence is just four cycles, so that is chosen. expand_mult does not
realise this is within a loop and the construction of the constant will
be hoisted out of the loop.
Confirmed.