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

Fix misleading Vector API doc for LSHR operator

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 19
    • core-libs
    • None
    • behavioral
    • minimal
    • Clarification of existing behaviour
    • Java API
    • JDK

      Summary

      Clarify the specification of logical shift right vector operator VectorOperator.LSHR.

      Problem

      The symbolic expression of VectorOperator.LSHR is not precise for sub-word operation types of byte and short.

      Solution

      For sub-word operand types the operand needs to be masked by a bit mask whose value is (1<<ESIZE*8)-1.

      Specification

      Add the following item to the class documentation after the definition of ESIZE:

      * <li>{@code EMASK} &mdash; the bit mask of the operand type, where {@code EMASK=(1<<ESIZE*8)-1}

      Change the specification of LSHR to be:

      /** Produce {@code (a&EMASK)>>>(n&(ESIZE*8-1))}.  Integral only. */
      public static final /*bitwise*/ Binary LSHR

            jiefu Jie Fu
            jiefu Jie Fu
            Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: