This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: 4.4.2 PowerPC Optimisation


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
*****************************************************************


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]