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

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

XMLWordPrintable

    • b04
    • generic
    • generic
    • Verified

        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.

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

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: