This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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: Speed Impact experiment on GCJ


> 
> >>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:
> 
> Andrew> For what it's worth, I was quite suprised that gcj didn't spot the
> Andrew> same opportunity.  Maybe this is part of the value range propagation
> Andrew> optimizations that aren't yet in core gcc.
> 
> Yeah, I'm surprised too.
> Maybe file it in bugzilla for later testing?

Huh?  It does produce good code on the mainline
without a loop:
_ZN4Impl4pingEJiii:
.LFB3:
.L4:
        imull   %esi, %edx
        movl    $0, %eax
        testl   %edx, %edx
        cmovg   %edx, %eax
        ret

-----
_ZN4Impl4pingEJiii:
.LFB3:
.L4:
        pushl   %ebp
.LCFI3:
        xorl    %edx, %edx
        movl    %esp, %ebp
.LCFI4:
        movl    16(%ebp), %eax
        imull   12(%ebp), %eax
        testl   %eax, %eax
        setle   %dl
        subl    $1, %edx
        andl    %edx, %eax
        popl    %ebp
        ret


But not on the 4.1 branch (at least in 20060208):
_ZN4Impl4pingEii:
.LFB3:
        imull   %esi, %edx
        xorl    %eax, %eax
        testl   %edx, %edx
        jle     .L4
        .p2align 4,,7
.L5:
.L6:
        incl    %eax
        cmpl    %eax, %edx
        jne     .L5
.L4:
        ret


-- Pinski


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