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

[Vector API] Incorrect implementation of LSHR operator for negative byte/short elements

    XMLWordPrintable

Details

    Description

      According to the Vector API doc, the LSHR operator computes a>>>(n&(ESIZE*8-1)).
      However, the current implementation is incorrect for negative bytes/shorts.

      Reproduce:

      $ java --add-modules jdk.incubator.vector ByteShift.java

      Expected output:

      Done

      Actual output:

      (...)
      i: 128
      a[i]: -128
      scalar: -16
      vector: 16

      Attachments

        Issue Links

          Activity

            People

              jiefu Jie Fu
              jiefu Jie Fu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: