From mark at codesourcery.com Mon Dec 7 00:55:24 2009 From: mark at codesourcery.com (Mark Mitchell) Date: Sun, 06 Dec 2009 16:55:24 -0800 Subject: Want to be a Sourcerer? Message-ID: <4B1C527C.7030208@codesourcery.com> Since you're on this mailing list, we know you're interested in Sourcery G++. If you'd like to be a Sourcerer, and help develop, enhance, and optimize the GNU toolchain, the Eclipse IDE, and other aspects of Sourcery G++ -- or if you'd like to help people use these tools by working on examples, documentation, and support for new CPUs -- please visit: http://www.codesourcery.com/company/jobs and see if there's a spot for you. If you work for a CodeSourcery customer, please be aware that CodeSourcery does not hire from its customers. Therefore, we will not consider your application unless you are willing to speak with your management about your intention to seek employment elsewhere. -- Mark Mitchell CodeSourcery mark at codesourcery.com (650) 331-3385 x713 From markc at liferacing.com Wed Dec 23 15:13:57 2009 From: markc at liferacing.com (Mark Colby) Date: Wed, 23 Dec 2009 15:13:57 -0000 Subject: On Power : GCC2 optimises better than GCC4?? Message-ID: <80BF44D5D0EFF249A5522B3EFE78C0C5017EF7C8@2000server.aerltd.com> Sounds a dumb question I know. However the following code snippet results in many more machine instructions under 4.4.1 than under 2.9.5: typedef unsigned int U32; typedef union { U32 R; struct { U32 BF1:2; U32 :8; U32 BF2:2; U32 BF3:2; U32 :18; } B; } TEST_t; U32 testFunc(void) { TEST_t t; t.R=0; t.B.BF1=2; t.B.BF2=3; t.B.BF3=1; return t.R; } Output under 4.4.1 (powerpc-eabi-gcc-4-4-1 -O3 -S gcc-test.cpp -o gcc-test-441.s): li 0,2 li 3,0 rlwimi 3,0,30,0,1 li 0,3 rlwimi 3,0,20,10,11 li 0,1 rlwimi 3,0,18,12,13 blr 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. Mark ***************************************************************** This email has been checked by the altohiway Mailcontroller Service ***************************************************************** From mark at codesourcery.com Sun Dec 27 20:38:42 2009 From: mark at codesourcery.com (Mark Mitchell) Date: Sun, 27 Dec 2009 12:38:42 -0800 Subject: [power-gnu-discuss] On Power : GCC2 optimises better than GCC4?? In-Reply-To: <80BF44D5D0EFF249A5522B3EFE78C0C5017EF7C8@2000server.aerltd.com> References: <80BF44D5D0EFF249A5522B3EFE78C0C5017EF7C8@2000server.aerltd.com> Message-ID: <4B37C5D2.9060305@codesourcery.com> Mark Colby wrote: > 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. -- Mark Mitchell CodeSourcery mark at codesourcery.com (650) 331-3385 x713 From markc at liferacing.com Wed Dec 30 00:28:01 2009 From: markc at liferacing.com (Mark Colby) Date: Wed, 30 Dec 2009 00:28:01 -0000 Subject: [power-gnu-discuss] On Power : GCC2 optimises better than GCC4?? Message-ID: <80BF44D5D0EFF249A5522B3EFE78C0C50142A608@2000server.aerltd.com> > > 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 ***************************************************************** From mark at codesourcery.com Wed Dec 30 15:59:03 2009 From: mark at codesourcery.com (Mark Mitchell) Date: Wed, 30 Dec 2009 07:59:03 -0800 Subject: [power-gnu-discuss] On Power : GCC2 optimises better than GCC4?? In-Reply-To: <80BF44D5D0EFF249A5522B3EFE78C0C50142A608@2000server.aerltd.com> References: <80BF44D5D0EFF249A5522B3EFE78C0C50142A608@2000server.aerltd.com> Message-ID: <4B3B78C7.8060804@codesourcery.com> Mark Colby wrote: > Thanks. Given how simple an example this is, that's genuinely > worrying for someone concerned about getting well optimised code (I > am). Most defects in compilers have simple examples. So, your reaction is typical, but it doesn't reflect that somehow the compiler as a whole has gotten incredibly stupid. In fact, all of our benchmarking shows improvement in GCC 4.4 relative to 4.3 -- let alone 3.4 or 2.95. > 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 :-( Another option is to buy a Sourcery G++ Professional Edition subscription and ask us to fix the problem. :-) -- Mark Mitchell CodeSourcery mark at codesourcery.com (650) 331-3385 x713