Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6213988
Votes 0
Synopsis Change in behavior of Math.log() with intrinsified version
Category hotspot:compiler2
Reported Against b01
Release Fixed mustang(b20)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs 4898278 , 6214949
Submit Date 04-JAN-2005
Description
Rob Nugent on the javagaming.org forums has posted a small test case illustrating a change in behavior with the intrinsified version of Math.log() on x86 CPUs. Test case:

public class Test {
  public static void main(String[] args) {
    int w = 64;
    int levels = (int)(Math.log(w) / Math.log(2.0)) + 1;
    System.out.println("Width " + w + " gives " +
      levels + " mipmap levels");
  }
}

This produces an answer of 7 on JDK releases 1.5 and earlier and an answer of 6 on the current x86 builds of 1.6 with most configurations (-client -Xcomp seems to work, but -client -Xint and -server -Xint do not). It is not clear whether this change in behavior should be considered a bug due to the specification guarantees of Math.log(), but it should be investigated.

Relevant thread:
http://www.javagaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1103796449;start=30#30

  xxxxx@xxxxx   2005-1-04 22:35:29 GMT
Work Around
N/A
Evaluation
The first log call was setting the fpu stack in 80bit mode, the second log call was being done with extended range which gave incorrect results.  Added a push and pop to revert the fpu stack back to 64bit mode

  xxxxx@xxxxx   2005-1-06 18:23:04 GMT
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang