RFR: 8284992: Fix misleading Vector API doc for LSHR operator

Jie Fu jiefu at openjdk.java.net
Tue Apr 19 23:51:30 UTC 2022


On Tue, 19 Apr 2022 16:11:37 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

> I need to think a little more about this. The specification is not accurate and likely requires a CSR.
> 
> My initial thoughts are I would prefer the operation to retain reference to the succinct definition using the logical right shift operator but we add additional specification explaining the cases for `byte` and `short`, namely that the result is widened to an `int` as if by `(a & ((1 << ESIZE) - 1))` and the result narrowed. That's commonly (at least for the widening part) how `>>>` is used with `byte` and `short`, and i think would be clearer to be explicit in that regard.

OK.
To avoid confusing I would prefer using the description of `>>>` in the new vector operator, which would perform the same behavior as the scalar `>>>`.

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

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


More information about the core-libs-dev mailing list