RFR: 8317721: RISC-V: Implement CRC32 intrinsic

ArsenyBochkarev duke at openjdk.org
Fri Dec 22 15:09:41 UTC 2023


On Fri, 22 Dec 2023 10:18:16 GMT, Hamlin Li <mli at openjdk.org> wrote:

> > Performance comparison for disabling/enabling Zba on StarFive VisionFive 2 board:
> 
> `-XX:-UseZba`:
> 
> ```
> Benchmark	(count)	Mode	Cnt	Score	Error	Units
> 
> CRC32.TestCRC32.testCRC32Update	512	thrpt	12	512.550	1.718	ops/ms
> CRC32.TestCRC32.testCRC32Update	2048	thrpt	12	130.396	0.341	ops/ms
> CRC32.TestCRC32.testCRC32Update	16384	thrpt	12	16.319	0.073	ops/ms
> CRC32.TestCRC32.testCRC32Update	65536	thrpt	12	3.913	0.011	ops/ms
> ```
> 
> `-XX:+UseZba`:
> 
> ```
> Benchmark	(count)	Mode	Cnt	Score	Error	Units
> 
> CRC32.TestCRC32.testCRC32Update	512	thrpt	12	623.173	0.651	ops/ms
> CRC32.TestCRC32.testCRC32Update	2048	thrpt	12	158.965	0.376	ops/ms
> CRC32.TestCRC32.testCRC32Update	16384	thrpt	12	19.934	0.055	ops/ms
> CRC32.TestCRC32.testCRC32Update	65536	thrpt	12	4.730	0.007	ops/ms
> ```
> 
> `-XX:-UseCRC32Intrinsics`:
> 
> ```
> Benchmark	(count)	Mode	Cnt	Score	Error	Units
> 
> CRC32.TestCRC32.testCRC32Update	512	thrpt	12	520.965	5.651	ops/ms
> CRC32.TestCRC32.testCRC32Update	2048	thrpt	12	169.591	0.747	ops/ms
> CRC32.TestCRC32.testCRC32Update	16384	thrpt	12	22.624	0.139	ops/ms
> CRC32.TestCRC32.testCRC32Update	65536	thrpt	12	5.430	0.016	ops/ms
> ```
> 
> Seems there is regression when `count >= 512`, especially when `count >= 2048`. And I suppose that big message is common case for CRC32 usage?

Hmm, I don't know about common CRC32 `count` parameter sizes, maybe others know? 😓 Or maybe anyone knows if there are other ways to optimize such plain version of intrinsic more?

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

PR Comment: https://git.openjdk.org/jdk/pull/17046#issuecomment-1867791244


More information about the hotspot-compiler-dev mailing list