RFR: 8311862: RISC-V: small improvements to slli
Ilya Gavrilin
duke at openjdk.org
Tue Jul 11 09:10:17 UTC 2023
Please review this small change for slli and slli.uw
slli change allows to replace slli Rd, Rs, 0 with addi Rd, Rs, 0 (and no operation emited if Rd == Rs)
addi with 0 has higher chances to be just a register renaming and not utilise ALU at all
We have observed small positive effect on hifive (and no change on thead).
Also this patch changes slli.uw and allows it to be used without additional check for UseZba, also providing fallback when Zba is not available
testing: tier1 and tier2 on hifive, also hotspot/jtreg/compiler/intrinsics/string tests on Qemu with UseZba
performance on hifive, before:
| Benchmark | Mode | Cnt | Score | | Error | Units |
|:-----------------------------------:|:----:|:---:|:--------:|:-:|:-------:|:-----:|
| StringIndexOf.advancedWithShortSub1 | avgt | 25 | 4035.143 | ± | 191.262 | ns/op |
| StringIndexOf.advancedWithShortSub2 | avgt | 25 | 1145.807 | ± | 14.610 | ns/op |
with patch:
| Benchmark | Mode | Cnt | Score | | Error | Units |
|:-----------------------------------:|:----:|:---:|:--------:|:-:|:-------:|:-----:|
| StringIndexOf.advancedWithShortSub1 | avgt | 25 | 3613.943 | ± | 178.153 | ns/op |
| StringIndexOf.advancedWithShortSub2 | avgt | 25 | 923.169 | ± | 47.123| ns/op |
-------------
Commit messages:
- initial commit
Changes: https://git.openjdk.org/jdk/pull/14823/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14823&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8311862
Stats: 31 lines in 4 files changed: 24 ins; 1 del; 6 mod
Patch: https://git.openjdk.org/jdk/pull/14823.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/14823/head:pull/14823
PR: https://git.openjdk.org/jdk/pull/14823
More information about the hotspot-dev
mailing list