Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6213988

Change in behavior of Math.log() with intrinsified version

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • hotspot
    • None
    • b20
    • x86
    • generic

      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

      ###@###.### 2005-1-04 22:35:29 GMT

            azeemj Azeem Jiva
            kbr Kenneth Russell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: