This is the mail archive of the gcc@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: powerpc64 doloop not used in all loops?


On Fri, Sep 20, 2002 at 12:08:35PM +0930, Alan Modra wrote:
> This testcase:
> 
> #define NR_RUNS 100000
> 
> void foo (void)
> {
>   unsigned long i;
> 
>   i = NR_RUNS;
>   do { } while (--i);
> 
>   i = NR_RUNS;
>   do { } while (--i);
> }
> 
> generates this code on powerpc64:
> 
> .foo:
>         lis 0,0x1
>         ori 0,0,34464
>         mtctr 0
> .L11:
>         bdnz .L11
>         lis 0,0x1
>         ori 0,0,34464
> .L10:
>         addic. 0,0,-1
>         bne+ 0,.L10
>         blr

Am I wrong to be disappointed that these loops aren't automatically
optimized out?


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