public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/66217] New: PowerPC rotate/shift/mask instructions not optimal
@ 2015-05-20 12:57 segher at gcc dot gnu.org
  2015-05-20 15:06 ` [Bug ada/66217] " dje at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: segher at gcc dot gnu.org @ 2015-05-20 12:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66217
           Summary: PowerPC rotate/shift/mask instructions not optimal
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: segher at gcc dot gnu.org
          Reporter: segher at gcc dot gnu.org
  Target Milestone: ---
            Target: powerpc*-*-*

GCC does not generate optimal instruction sequences for rotate/shift/mask
sequences; it pretty often makes quite bad code, even, esp. when it
involves 64-bit instructions.

One part of the problem is that the masks we allow are less general
than what the hardware allows.  Not a huge problem for the rlwinm
instructions, but we shouldn't need "mask_operand_wrap" there either.

Another big part of the problem is our rtx_cost function does not
handle rotate-and-mask correctly; it recurses to get the cost of
the mask, but then it looks at the mode of it, which is VOIDmode
(it is a const_int), and things go south.

It would be nice to not need that rtx_cost at all, certainly not
for combine  (which has access to full insns always), but that is
a bigger project.

Another problem is with the insert insns.  They are not as general
as they should be, as before.  Also, we should be able to handle
things like (a << 16) | (b >> 16), which is an insert insn followed
by a "normal" rotate (or the other way around).  This should also
make the bswap patterns a little bit simpler.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-07-30  2:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-20 12:57 [Bug ada/66217] New: PowerPC rotate/shift/mask instructions not optimal segher at gcc dot gnu.org
2015-05-20 15:06 ` [Bug ada/66217] " dje at gcc dot gnu.org
2015-07-20 16:31 ` [Bug target/66217] " segher at gcc dot gnu.org
2015-07-22  1:45 ` dje at gcc dot gnu.org
2015-07-23 14:38 ` segher at gcc dot gnu.org
2015-07-30  2:34 ` segher at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).