RFR: 8256438: AArch64: Implement match rules with ROR shift register value [v2]
Eric Liu
github.com+10482586+therealeliu at openjdk.java.net
Mon Feb 1 11:14:11 UTC 2021
> This patch transforms '(x >>> rshift) + (x << lshift)' into
> 'RotateRight(x, rshift)' during GVN phase when both the shift exponents
> are constants and their sum equals to the number of bits for the type
> of shift base.
>
> This patch implements some new match rules for AArch64 instructions
> which can take ROR as the optional shift. Such instructions are 'and',
> 'or', 'eor', 'eon', 'bic' and 'orn'.
>
> ror w11, w2, #5
> eor w0, w1, w11
>
> With this patch, above code could be optimized to below:
>
> eor w0, w1, w2, ror #5
>
> Finally, the patch refactors TestRotate.java[1][2].
>
> Tested jtreg TestRotate.java, hotspot::hotspot_all_no_apps,
> jdk::jdk_core, langtools::tier1.
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8252776
> [2] https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2020-September/039911.html
Eric Liu has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
- Merge branch 'master' into 8256438
Change-Id: Ia357074efc8488a57030863b3eab7b27839cd3d0
- 8256438: AArch64: Implement match rules with ROR shift register value
This patch transforms '(x >>> rshift) + (x << lshift)' into
'RotateRight(x, rshift)' during GVN phase when both the shift exponents
are constants and their sum equals to the number of bits for the type
of shift base.
This patch implements some new match rules for AArch64 instructions
which can take ROR as the optional shift. Such instructions are 'and',
'or', 'eor', 'eon', 'bic' and 'orn'.
ror w11, w2, #5
eor w0, w1, w11
With this patch, above code could be optimized to below:
eor w0, w1, w2, ror #5
Finally, the patch refactors TestRotate.java[1][2].
Tested jtreg TestRotate.java, hotspot::hotspot_all_no_apps,
jdk::jdk_core, langtools::tier1.
[1] https://bugs.openjdk.java.net/browse/JDK-8252776
[2] https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2020-September/039911.html
Change-Id: I70842bcdb7cbc31bdf261c3223ea882076c2c66b
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/1858/files
- new: https://git.openjdk.java.net/jdk/pull/1858/files/6135975d..afc68c27
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1858&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1858&range=00-01
Stats: 116364 lines in 2912 files changed: 46136 ins; 41070 del; 29158 mod
Patch: https://git.openjdk.java.net/jdk/pull/1858.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/1858/head:pull/1858
PR: https://git.openjdk.java.net/jdk/pull/1858
More information about the hotspot-compiler-dev
mailing list