What FPU intructions JDK support

  • Thread starter Dimitri Ognibene
  • Start date
D

Dimitri Ognibene

Anyone knows if jdk does support FPU instructions?
I'm particularly interested in atan and exp functions..
I've googled around for a time but didn't found anything of specific
Thanks
Dimitri
 
O

Oliver Wong

Dimitri Ognibene said:
Anyone knows if jdk does support FPU instructions?
I'm particularly interested in atan and exp functions..
I've googled around for a time but didn't found anything of specific

Are you asking whether the JVM will actually use certain particular
CPU/FPU instructions when executing your code, or are you asking if there
exists an API which can perform the equivalent of the above mentioned
function, without regards as to what instructions the CPU/FPU will actually
execute to implement those functions?

- Oliver
 
D

Dimitri Ognibene

Are you asking whether the JVM will actually use certain particular
CPU/FPU instructions when executing your code, or are you asking if there
exists an API which can perform the equivalent of the above mentioned
function, without regards as to what instructions the CPU/FPU will actually
execute to implement those functions?
I'm a little drunk but the first that you said, Oliver,
JVM will actually use certain particular
CPU/FPU instructions
Thanks,
sorry if wasn't clear
 
E

EJP

Dimitri said:
I'm a little drunk but the first that you said, Oliver,

OK well that's not a question about what the JVM *supports*, it's a
question about what the JVM *uses*, isn't it?

The answer to that can only be another couple of questions: *which* JVM,
*which* CPU?

In general, a hint as to the answer is right there in java.lang.Math:

'By default many of the Math methods simply call the equivalent method
in StrictMath for their implementation. Code generators are encouraged
to use platform-specific native libraries or microprocessor
instructions, where available, to provide higher-performance
implementations of Math methods. Such higher-performance implementations
still must conform to the specification for Math.'
 
D

Dimitri Ognibene

ok, so?
how can i know if the jdk 1.6 or 1.5 for linux and windows uses fpu
instructions? and which one it uses? I've googled around but I'couldn't
find anything clear.. Must I use a debugger to dicover it?
Thanks
Dimitri
 
T

Timo Stamm

Dimitri said:
ok, so?
how can i know if the jdk 1.6 or 1.5 for linux and windows uses fpu
instructions? and which one it uses? I've googled around but I'couldn't
find anything clear.. Must I use a debugger to dicover it?

The JSE uses StrictMath, which calles native code. So it depends on the
JVM implementation what happens.

You can download the source of the JVM and look how it's implemented.
(Carefully read the licence first.)


Timo
 
C

Chris Uppal

Dimitri said:
how can i know if the jdk 1.6 or 1.5 for linux and windows uses fpu
instructions? and which one it uses? I've googled around but I'couldn't
find anything clear.. Must I use a debugger to dicover it?

You can probably find out exactly what code is used by using JVMTI, but I've
never done that myself, so I can't say how easy or difficult it would be (my
guess is that it's pretty tricky).

Also, you may find this link relevant:

http://blogs.sun.com/roller/page/jag?entry=transcendental_meditation

James Gosling writing about the implementation of transcendental functions in
Java.

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top