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

clear high word for integer pop count on SPARC

XMLWordPrintable

    • b14
    • sparc
    • generic

        http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2012-December/009139.html


        Hi,

        I would like to submit a bugfix for C2's Integer.bitCount() intrinsic on sparcv9.

        On sparcv9, the C2 intrinsic for Integer.bitCount() is a POPC instruction. POPC operates on the whole register, including the high word, but for Integer.bitCount(), this is not correct, because the value of the high word is undefined. There could be bits set as a result of an int overflow or from a shift operation for example. Of course the bits in the high word have to be ignored for Integer.bitCount().

        I have prepared a small webrev with the suggested fix and a regression test:

          http://www.sapjvm.com/rr/webrevs/bitCount_intrinsic_sparc_01/

        Could you please review the patch and create a bug id? Thanks!

        Cheers,
        Richard.

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

                Created:
                Updated:
                Resolved: