public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/45216]  New: Rotate expressions not recognized at tree level
@ 2010-08-06 22:19 bernds at gcc dot gnu dot org
  2010-08-06 22:19 ` [Bug tree-optimization/45216] " bernds at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: bernds at gcc dot gnu dot org @ 2010-08-06 22:19 UTC (permalink / raw)
  To: gcc-bugs

We have RROTATE_EXPR and LROTATE_EXPR, but the patterns are not reliably
detected at the tree level.  I'm attaching a testcase reduced from the Linux
kernel, which has at least one sequence that can be rewritten using a rolw
instruction:

        movzwl  %cx, %edx
        movzwl  %ax, %eax
        shrw    $8, %cx
        movl    %edx, -44(%ebp)
        sall    $8, %edx
        movw    %cx, -50(%ebp)
        orw     %dx, -50(%ebp)

Other opportunities exist.  At the most basic level, a function like

unsigned short rol8 (unsigned short word, unsigned int shift)
{
  return (word << 8) | (word >> 8);
}

should be transformed at the tree level by recognizing the rotate.


-- 
           Summary: Rotate expressions not recognized at tree level
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bernds at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45216


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

end of thread, other threads:[~2013-05-13 11:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45216-4@http.gcc.gnu.org/bugzilla/>
2010-10-03  8:33 ` [Bug tree-optimization/45216] Rotate expressions not recognized at tree level kai.extern at gmail dot com
2012-12-01  1:38 ` mickflemm at gmail dot com
2012-12-01  8:51 ` glisse at gcc dot gnu.org
2013-05-09 14:43 ` steven at gcc dot gnu.org
2013-05-09 14:51 ` jakub at gcc dot gnu.org
2013-05-13 11:13 ` jakub at gcc dot gnu.org
2013-05-13 11:15 ` jakub at gcc dot gnu.org
2010-08-06 22:19 [Bug tree-optimization/45216] New: " bernds at gcc dot gnu dot org
2010-08-06 22:19 ` [Bug tree-optimization/45216] " bernds at gcc dot gnu dot org
2010-08-06 23:02 ` steven at gcc dot gnu dot org
2010-08-06 23:17 ` steven at gcc dot gnu dot org
2010-08-06 23:42 ` rguenth at gcc dot gnu dot 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).