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

Jie Fu jiefu at openjdk.java.net
Tue Apr 19 03:44:30 UTC 2022


On Tue, 19 Apr 2022 02:43:33 GMT, Quan Anh Mai <duke at openjdk.java.net> wrote:

> I see, however, I preserve the opinion that the API doc implies the extended unsigned right shift not the original `>>>` (or the output types would be wrong). So, I think you can create another operator that perform the scalar `>>>` if it is needed.
> 
> Thank you very much.

Thanks @merykitty for your understanding.

After the discussion, I got the point that the original implementation of `LSHR` for bytes/shorts is useful and needed.
So let's just keep it.

Yes, we think the operator for scalar `>>>` is needed for several reasons:
1. We do have scalar `>>>` upon bytes/shorts in real programs.
2. There is usually no guarantee that all the operands would be non-negative for `>>>`.
3. Make it to be programmed more easily and also reduce the possibility to make mistakes.

Java developers would be happy and appreciated with that operator I believe. 
Thanks.

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

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


More information about the core-libs-dev mailing list