2

If you read the top of the incredibly-hard-to-find native sqrt method for Java, which is located at jdk1.6\src\jdk\src\share\native\java\lang\fdlibm\src\e_sqrt.c you will find this:

/* __ieee754_sqrt(x)
 * Return correctly rounded sqrt.
 *           ------------------------------------------
 *           |  Use the hardware sqrt if you have one |
 *           ------------------------------------------
.... etc algorithm continues

How can I tell if the JVM, for example, recent Oracle 7/8 jdks, is using a hardware sqrt or the software sqrt in fdlibm?

Tyler Durden
  • 11,156
  • 9
  • 64
  • 126
  • 2
    `-XX:+PrintAssembly` could probably help here, see also https://wikis.oracle.com/display/HotSpotInternals/PrintAssembly – Ingo Apr 04 '14 at 10:01
  • 1
    Run it using gdb, set a breakpoint at the relevant place and single step it. – Stephen C Apr 04 '14 at 10:41
  • Possible duplicate of [Does Java strictfp modifier have any effect on modern CPUs?](https://stackoverflow.com/questions/22562510/does-java-strictfp-modifier-have-any-effect-on-modern-cpus) – Paul Sweatte Jul 18 '17 at 14:42

0 Answers0