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

Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()

    XMLWordPrintable

Details

    • b04
    • generic
    • generic
    • Verified

    Backports

      Description

        These methods can be instrinsified by using bit scan, bit test, and population count instructions. It seems it's not worth to instrinsify lowestOneBit() too, as it already boilds down to about 2 or 3 machine instructions.

        Some of these methods can be used in BigInteger and maybe other classes in the JDK.
        I removed highestOneBit from that CR as it's not clear the benefit is worth the changes. I might open another one in the future.

        Attachments

          Issue Links

            Activity

              People

                twisti Christian Thalinger
                twisti Christian Thalinger
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: