This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/45216] New: Rotate expressions not recognized at tree level
- From: "bernds at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Aug 2010 22:18:56 -0000
- Subject: [Bug tree-optimization/45216] New: Rotate expressions not recognized at tree level
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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