RFR: 8286847: Rotate vectors don't support byte or short
Eric Liu
eliu at openjdk.java.net
Tue May 17 08:49:54 UTC 2022
On Tue, 17 May 2022 07:11:29 GMT, Haomin <duke at openjdk.java.net> wrote:
>> test/hotspot/jtreg/compiler/vectorization/TestRotateByteVector.java line 90:
>>
>>> 88: res[i] = (byte) ((arr[i] << shift) | (arr[i] >>> -shift));
>>> 89: }
>>> 90: }
>>
>> This function is duplicated with with `testRotateLeft`. It's not enough to verify the correctness by comparing the results of these two functions.
>
> Yes, `rotateLeftRes` is duplicated with `testRotateLeft`. But compile only `testRotateLeft`, and then compare the result between the two function. Could you give me some suggestions ? How should I modify this ?
Two options off the top of my head:
a) With `-Xcomp`, hardcode the expected values which are calculated by interpreter or just by hand and compared with the results of C2.
b) With `-XX:-TieredCompilation`, generate the expected results if the method was not hot enough to compiled by C2. Then compared with C2 results, which can be got when the iteration count is more than 10K. Please refer to https://github.com/openjdk/jdk/pull/5403/files/71aa6ac439b67b27828e9aabe51845fa34602837#diff-d14ca09ba5fa806904a4db333037a14621cfeba81505ba369a375c57bd90c7a8 for more detail.
Option a) is much more simpler. Option b) can verify more random values.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8740
More information about the hotspot-compiler-dev
mailing list