Fix misleading Vector API doc for LSHR operator

XMLWordPrintable

    • Type: CSR
    • Resolution: Approved
    • Priority: P3
    • 19
    • Component/s: 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
      

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

              Created:
              Updated:
              Resolved: