nogc.cc & darwin

Andreas Tobler toa@pop.agri.ch
Fri Jan 25 13:11:00 GMT 2002


Bryce McKinlay wrote:
 
> Sorry, I mislead you with my previous comment. GCJ is generating a call
> to sqrtf() from the Math.sqrt() calls in these files. I am not sure why
> it is calling sqrtf(), however, instead of sqrt() - this seems wrong
> because the arguments are double!

So, the gcj produces wrong code? I checked with -S -save-temps and found
the sqrtf.
.picsymbol_stub
L_sqrtf$stub:
 .indirect_symbol _sqrtf
 mflr r0
 bcl 20,31,L0$_sqrtf
L0$_sqrtf:
 mflr r11
 addis r11,r11,ha16(L_sqrtf$lazy_ptr-L0$_sqrtf)
 mtlr r0 
 lwz r12,lo16(L_sqrtf$lazy_ptr-L0$_sqrtf)(r11)
 mtctr r12
 addi r11,r11,lo16(L_sqrtf$lazy_ptr-L0$_sqrtf)
 bctr
>> I think we should really be using the libc implementations of these
> functions since they are faster (written in assembly). We should only
> use the fdlibm math functions for targets that don't have a math library
> (and possibly also for StrictMath?)

Well, I checked my libc aka libSystem.dylib, there is no sqrtf only sqrt
and ieee754_sqrt. On my ppclinux system I didn't find them either. But
here the sqrt/f is not part of those files (Random.o). Confused :-)
What would be the next step I have to do?
Do you see this on other platforms as well or is this due to a switch in
my current config?
Thanks,
Andreas


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /