RFR: 8317721: RISC-V: Implement CRC32 intrinsic
ArsenyBochkarev
duke at openjdk.org
Tue Nov 28 13:50:50 UTC 2023
Hi all! Please review this port of `_updateBytesCRC32` intrinsic from [AArch64](https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp#L4224) (for now, plain version).
### Correctness checks
Tests `test/hotspot/jtreg/compiler/codegen/CRCTest.java` and `test/hotspot/jtreg/compiler/intrinsics/zip/TestCRC32.java` are passed, in both of the `_updateBytesCRC32` was used.
### Performance results on T-Head board
##### Intrinsic disabled
(`-XX:-UseCRC32Intrinsics` flag)
| Benchmark | (count) | Mode | Cnt | Score | Error | Units |
| ------------------------------- | --- | --- | --- | --- | --- | --- |
| CRC32.TestCRC32.testCRC32Update | 64 | thrpt | 15 | 768.458 | ± 20.070 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 128 | thrpt | 15 | 699.860 | ± 44.533 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 256 | thrpt | 15 | 558.778 | ± 5.119 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 512 | thrpt | 15 | 420.209 | ± 4.384 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 2048 | thrpt | 15 | 166.945 | ± 0.817 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 16384 | thrpt | 15 | 25.212 | ± 0.036 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 65536 | thrpt | 15 | 6.222 | ± 0.040 | ops/ms |
##### Intrinsic enabled
(`-XX:+UseCRC32Intrinsics` flag)
| Benchmark | (count) | Mode | Cnt | Score | Error | Units |
| ---- | ---- | ---- | ---- | --- | --- | --- |
| CRC32.TestCRC32.testCRC32Update | 64 | thrpt | 15 | 7164.484 | ± 17.943 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 128 | thrpt | 15 | 7065.546 | ± 178.694 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 256 | thrpt | 15 | 7153.419 | ± 26.696 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 512 | thrpt | 15 | 7008.298 | ± 235.055 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 2048 | thrpt | 15 | 6570.959 | ± 612.765 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 16384 | thrpt | 15 | 7166.674 | ± 6.639 | ops/ms |
| CRC32.TestCRC32.testCRC32Update | 65536 | thrpt | 15 | 6918.064 | ± 200.009 | ops/ms |
-------------
Commit messages:
- 8317721: RISC-V: Implement CRC32 intrinsic
Changes: https://git.openjdk.org/jdk/pull/16850/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16850&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8317721
Stats: 526 lines in 8 files changed: 522 ins; 1 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/16850.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/16850/head:pull/16850
PR: https://git.openjdk.org/jdk/pull/16850
More information about the hotspot-dev
mailing list