Integrated: 8286847: Rotate vectors don't support byte or short

Haomin duke at openjdk.java.net
Thu Jun 9 04:04:30 UTC 2022


On Tue, 17 May 2022 03:09:12 GMT, Haomin <duke at openjdk.java.net> wrote:

> static void test_fun(byte[] a0, int[] b0, byte[] c0) {
>     for (int i=0; i<ARRLEN; i++) {
>       c0[i] = (byte)(a0[i] << (7) | a0[i] >>> (-7));
>     }   
>   }
> 
> 
> when I implement RotateLeftV in loongarch.ad, I found this executed by c2 vector and executed by interpreter are not equal.
> 
> It's executed on x86 would create an assert error.
> 
> 
>  # Internal Error (/home/wanghaomin/jdk/src/hotspot/share/opto/vectornode.cpp:347), pid=26469, tid=26485
>  # assert(false) failed: not supported: byte
> 
> 
> RotateLeftV for byte, short values produces incorrect Java result. Because java code should convert a byte, short value into int value, and then do RotateI.

This pull request has now been integrated.

Changeset: 3419beec
Author:    wanghaomin <wanghaomin at loongson.cn>
Committer: Jie Fu <jiefu at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/3419beec7fa646ab30f55ac27fdb47c4c1e1e764
Stats:     157 lines in 2 files changed: 156 ins; 1 del; 0 mod

8286847: Rotate vectors don't support byte or short

Reviewed-by: eliu, xgong, jiefu, jbhateja

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

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


More information about the hotspot-compiler-dev mailing list