From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32675 invoked by alias); 14 Apr 2005 01:39:25 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 32309 invoked by uid 48); 14 Apr 2005 01:39:16 -0000 Date: Thu, 14 Apr 2005 01:39:00 -0000 From: "anton at samba dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20050414013914.21017.anton@samba.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/21017] New: ppc 64bit target not using rlwinm X-Bugzilla-Reason: CC X-SW-Source: 2005-04/txt/msg01860.txt.bz2 List-Id: Using a recent 4.0 CVS: gcc version 4.0.0 20050412 (prerelease) Compiling the following as 64bit: unsigned int foo(unsigned int x) { return ((x >> 16) & 0xffff) | ((x & 0xffff) << 16); } Results in: .L.foo: slwi 0,3,16 srwi 3,3,16 or 3,3,0 rldicl 3,3,0,32 blr Compiling for 32bit results in: foo: rlwinm 3,3,16,0xffffffff blr It looks like the 64bit case could be done in 2 instructions if we masked the top 32bits of the rlwinm result. -- Summary: ppc 64bit target not using rlwinm Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: anton at samba dot org CC: gcc-bugs at gcc dot gnu dot org GCC target triplet: powerpc64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21017