From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10206 invoked by alias); 22 Dec 2009 16:29:39 -0000 Received: (qmail 10194 invoked by uid 22791); 22 Dec 2009 16:29:37 -0000 X-SWARE-Spam-Status: No, hits=0.4 required=5.0 tests=AWL,BAYES_20,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from clustera.mailcontroller.co.uk (HELO cluster-a.mailcontroller.altohiway.com) (213.83.66.193) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Dec 2009 16:29:33 +0000 Received: from 2000SERVER.aerltd.com (nis001-34257-rtr-adsl-200.altohiway.com [213.83.80.212] (may be forged)) by rlya2a.mailcontroller.altohiway.com (MailController) with ESMTP id nBMGTVM6032519 for ; Tue, 22 Dec 2009 16:29:31 GMT Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: 4.4.2 PowerPC Optimisation Date: Tue, 22 Dec 2009 17:36:00 -0000 Message-ID: <80BF44D5D0EFF249A5522B3EFE78C0C5017EF788@2000server.aerltd.com> From: "Mark Colby" To: Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-12/txt/msg00304.txt.bz2 Hi, I am trying to migrate my C/C++ cross-compiling (cygwin->powerpc) from 2.9.5 to 4.4.2. Specifically I have been successfully using 2.9.5 for years and have just built 4.4.2 (no libraries) as I want to compile for newer cores with isel, sse etc. I appear to have a fully working compiler (produces a few hundred lines of code that runs correctly in my target hardware) but the code produced is oddly inefficient despite -O3. Under 2.9.5 this: typedef union { U32 R; struct { U32 WP:2; U32 WRC:2; U32 WIE:1; U32 DIE:1; U32 FP:2; U32 FIE:1; U32 ARE:1; U32 :1; U32 WPEXT:4; U32 FPEXT:4; U32 :13; } B; } SPR_TCRVAL_t; .. =20=20 { SPR_TCRVAL_t tcr; tcr.R=3D0; tcr.B.WRC=3D2; tcr.B.WPEXT=3D10; tcr.B.ARE=3D1; } produces a nice simple: lis 0,0x2054 mtspr 340,0 Yet under 4.4.2 with all optimisations apparently enabled (constant optimisation, function inlining etc all visible in the assembly output) I get: li 9,2 li 0,0 rlwimi 0,9,28,2,3 li 9,10 rlwimi 0,9,17,11,14 li 9,1 rlwimi 0,9,22,9,9 mtspr 340,0 !! Has anyone seen this sort of thing before? Is there anything obviously dumb in what I am trying to do? Any pointers gratefully received! Thanks, Mark ***************************************************************** This email has been checked by the altohiway Mailcontroller Service *****************************************************************