[jdk18] RFR: 8278267: ARM32: several vector test failures for ASHR

Hao Sun haosun at openjdk.java.net
Fri Dec 24 01:40:14 UTC 2021


On Tue, 21 Dec 2021 09:53:07 GMT, Dean Long <dlong at openjdk.org> wrote:

> There seems to be an interesting history here.
> 
> Method 1: negate in RShiftCntV rule Method 2: negate in RShiftV* rules
> 
> For aarch64, the negate was moved into the shift instruction in JDK-8213134 (Method 1 --> Method 2). Then JDK-8262916 proposed to move it back out of the shift instruction again. In that PR, the opinion that Method 1 (arm32) generated better code than Method 2 (aarch64) was expressed. Now it looks like this PR proposes for arm32 to move to Method 2 like aarch64, so I suspect that there will be a performance impact.
> 
> I think there is a simpler fix that doesn't require moving where the negate happens. JDK-8277239 fixed a similar problem by adding a flag on vector shift nodes to indicate variable shift, then checking the flag in the predicate. Perhaps arm32 could do the same?

Thanks a lot for your explanation. I do agree with your solution.

Updated the code: 1) using is_var_shift() to determine to put "negation" in RShiftCntV or RShiftV* rules, and 2) adding `cmp` and `hash` for ShiftV node.

Could you please take a look at the latest code when you have a chance? Maybe after the new year :)
Thanks.

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

PR: https://git.openjdk.java.net/jdk18/pull/41


More information about the hotspot-compiler-dev mailing list