public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Mark Colby" <markc@liferacing.com>
To: <gcc-help@gcc.gnu.org>
Subject: RE: 4.4.2 PowerPC Optimisation
Date: Mon, 04 Jan 2010 10:36:00 -0000	[thread overview]
Message-ID: <80BF44D5D0EFF249A5522B3EFE78C0C5017EF810@2000server.aerltd.com> (raw)

Apologies if this was the wrong list to ask this on. I will repost (with
a simpler and complete example) to the gcc list. Thanks, Mark

> 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;
> 
>   ..
> 
>   {
>     SPR_TCRVAL_t tcr;
>     tcr.R=0;
>     tcr.B.WRC=2;
>     tcr.B.WPEXT=10;
>     tcr.B.ARE=1;
>     <asm macro to assign tcr to SPR 340>
>   }
> 
> 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
*****************************************************************

             reply	other threads:[~2010-01-04 10:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-04 10:36 Mark Colby [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-12-22 17:36 Mark Colby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80BF44D5D0EFF249A5522B3EFE78C0C5017EF810@2000server.aerltd.com \
    --to=markc@liferacing.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).