RFR: 8257483: C2: Split immediate vector rotate from RotateLeftV and RotateRightV nodes [v5]
Dong Bo
dongbo at openjdk.java.net
Wed Dec 9 06:29:50 UTC 2020
> Currently, for all CPUs, if optimizing RotateLeftV and RotateRightV with match rules in AD files, we have to implement both immediate and variable versions.
>
> On aarch64, with match rules for vector rotation, immediate vector rotatation can be optimized with shift+insert instructions (i.e. SLI/SRI, ~20% improvements with an initial implementation).
> However there woule be performance regression for variable version, due to SLI/SRI have no register version in NEON intruction set and there is no register version for right shift neither.
> The instructions for match rules of vector rotate variable should be:
> mov w9, 32
> dup v13.4s, w9
> sub v20.4s, v13.4S, v19.4s
> # For a loop, default version only has code below,
> # the code above (loop invariants) are put outside of a loop.
> sshl v17.4s, v16.4s, v19.4s
> neg v18.16b, v20.16b # on aarch64, vector right shift is implemented as left shift by negative shift count
> ushl v16.4s, v16.4s, v18.4s
> orr v16.16b, v17.16b, v16.16b
>
> With this patch, immediate vector rotation can be matched alone and optimized on CPUs like aarch64.
>
> Verified with linux-x86_64-server-fastdebug tier1-3 and passed.
> Also added immediate vector rotation tests to micro `test/micro/org/openjdk/bench/java/lang/RotateBenchmark.java`.
> Tested the micro on a x86_64/aarch64 server and witnessed no regressions.
Dong Bo has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
introduce Matcher::supports_vector_variable_rotates
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/1532/files
- new: https://git.openjdk.java.net/jdk/pull/1532/files/d8261009..d2cb793c
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1532&range=04
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1532&range=03-04
Stats: 58 lines in 8 files changed: 24 ins; 24 del; 10 mod
Patch: https://git.openjdk.java.net/jdk/pull/1532.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/1532/head:pull/1532
PR: https://git.openjdk.java.net/jdk/pull/1532
More information about the hotspot-compiler-dev
mailing list