[Bug target/38939] MULLW on often faster than SLWI ADD SLWI ADD..

segher at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Nov 23 01:40:00 GMT 2015


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.


More information about the Gcc-bugs mailing list