RFR: 8322816: RISC-V: Incorrect guarantee in patch_vtype

Fei Yang fyang at openjdk.org
Tue Jan 2 09:01:47 UTC 2024


On Tue, 2 Jan 2024 07:23:56 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> Please review this change that fixes a test for a guarantee.  This also
> removes a -Wparentheses warning when those are enabled (which is how the
> problem was discovered).
> 
> The problem is that operator precedence groups the sub-expressions differently
> than intended. The fix is to override the operator precedence by adding
> parentheses to achieve the intended grouping.
> 
> Testing: Local (linux-x64) cross-build for linux-riscv with this change plus
> -Wparentheses enabled and other changes to allow that to work.
> 
> Requesting someone from the riscv porters to properly test this.

src/hotspot/cpu/riscv/assembler_riscv.hpp line 1160:

> 1158: #define patch_vtype(hsb, lsb, vlmul, vsew, vta, vma, vill)   \
> 1159:     if (vill == 1) {                                         \
> 1160:       guarantee((vlmul | vsew | vta | vma) == 0,             \

I see the `vill` parameter is always false in current code, which means this guarantee never gets excecuted. And I don't think we would make use of the `vill` field of vtype in future. So I personally perfer to remove this guarantee and its enclosing if block for now.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17215#discussion_r1439251060


More information about the hotspot-compiler-dev mailing list