benchmark result

Andrew Haley
Tue Dec 7 11:12:00 GMT 2004

Mathieu Lacage writes:
 > On Tue, 2004-12-07 at 10:52 +0000, Andrew Haley wrote:
 > > What CPU are you using?  I would expect these calls to log to be
 > > inlined on an x86.
 > pentium4: -O2 -mtune=pentium4 -ffast-math

That shouldn't happen; there should be no calls to _ieee754_log.  I
just tried a simple test with

public class f
  public static void main (String[] s)
    System.err.println (Math.log (2.4));

/local/aph/gcc-3_4-branch/build/gcc/gcj -B/local/aph/gcc-3_4-branch/build/gcc/ -S -ffast-math -O2

and the call to log was inlined as a CPU instruction, not a call to "log":

        pushl   %ebp
        movl    %esp, %ebp
        pushl   %ebx
        subl    20, %esp
        cmpb    13, java.lang.System.class$+86
        movl    f.class$, (%esp)
        setg    %bl
        call    _Jv_InitClass
        testb   %bl, %bl
        je      .L5
        fldl    .LC0
        fxch    %st(1)
        movl    java.lang.System.err, %edx
        movl    (%edx), %eax
        movl    %edx, (%esp)
        fstpl   4(%esp)
        call    *112(%eax)
        addl    20, %esp
        popl    %ebx
        popl    %ebp
        .p2align 4,,7
        movl    java.lang.System.class$, (%esp)
        call    _Jv_InitClass
        jmp     .L3

More information about the Java mailing list