RFR: 8284992: Fix misleading Vector API doc for LSHR operator [v2]

Jie Fu jiefu at openjdk.java.net
Wed Apr 27 09:06:14 UTC 2022


On Tue, 26 Apr 2022 21:41:37 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

> After talking with John here's what we think is a better approach than what I originally had in mind:
> 
> 1. In the class doc of `VectorOperators` add a definition for `EMASK` occurring after the definition for `ESIZE`:
> 
> ```
>  * <li>{@code EMASK} — the bit mask of the operand type, where {@code EMASK=(1<<ESIZE*8)-1} 
> ```
> 
> 2. Change `LSHR` to be:
> 
> ```
> /** Produce {@code (a&EMASK)>>>(n&(ESIZE*8-1))}.  Integral only. */
> ```
> 
> That more clearly gets across operating in the correct domain for sub-word operand types, which was the original intention (e.g. the right shift value).

Good suggestion!
This makes sense to me.

Updated.
Thanks.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8291


More information about the core-libs-dev mailing list