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

32-bit integer log2 functions return the wrong value for negative arguments on 64-bit machines

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b15
    • CPU:
      generic
    • OS:
      generic

      Description

      log2_int() should return 32 for all negative arguments: the intention is to find the most significant set bit in x.

      This does not work on 64-bit machines because the argument is sign extended to 64 bits before being converted to uintptr_t.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aph Andrew Haley
              Reporter:
              aph Andrew Haley
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: