Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / May 2006

Tip: Looking for answers? Try searching our database.

What FPU intructions JDK support

Thread view: 
Dimitri Ognibene - 02 May 2006 14:55 GMT
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
Oliver Wong - 02 May 2006 20:23 GMT
> 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
Dimitri Ognibene - 03 May 2006 00:01 GMT
> 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
EJP - 03 May 2006 12:10 GMT
> 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.'
Dimitri Ognibene - 03 May 2006 12:20 GMT
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
Timo Stamm - 03 May 2006 12:47 GMT
Dimitri Ognibene schrieb:
> 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
Dimitri Ognibene - 03 May 2006 12:54 GMT
ok i'll try this,
Thanks
Dimitri
Chris Uppal - 03 May 2006 13:37 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.