[power-gnu-discuss] On Power : GCC2 optimises better than GCC4??

Mark Colby markc at liferacing.com
Wed Dec 30 00:28:01 UTC 2009


> > Output under 2.9.5 (powerpc-eabi-gcc-2-9-5 -O3 -S gcc-test.cpp -o
> > gcc-test-295.s):
> > 
> >   lis 3,0x8034
> >   blr
> > 
> > What am I missing? Many thanks if you can shed any light on this.
> 
> I don't think you're missing anything, unless "lis" isn't available on
> all Power Architecture CPUs.  (I'm not an expert on the architecture, so
> I'm not sure.)  If using the appropriate -mcpu option for your CPU
> doesn't change the output, then you've probably found a case in which
> the compiler has indeed gotten worse.

Thanks. Given how simple an example this is, that's genuinely worrying for someone concerned about getting well optimised code (I am). LIS is pretty fundamental - it's a simpified mnemonic of addis and as such is available on all UISA PowerPCs. The code generated by 2.9.5 will run fine on newer CPUs; my only reason for moving away from 2.9.5 is that it doesn't support some of the newer instructions (isel, MMU operations, SPE instructions etc). If I can't get to the bottom of this I guess I'll need to consider going back to 2.9.5 or perhaps a 3.x build. Grrr :-(


*****************************************************************
This email has been checked by the altohiway Mailcontroller Service
*****************************************************************



More information about the power-gnu-discuss mailing list