RFR: 8322179: RISC-V: Implement SHA-1 intrinsic [v4]

Hamlin Li mli at openjdk.org
Wed Jan 10 09:14:05 UTC 2024


> Hi,
> Can you review this patch to implement SHA-1 intrinsic for riscv?
> Thanks!
> 
> 
> ## Test
> 
> ### Functionality
> 
> tests under `test/hotspot/jtreg/compiler/intrinsics/sha`
> tests found via `find test/jdk -iname "*SHA1*.java"`
> 
> ### Performance
> 
> tested on `T-HEAD Light Lichee Pi 4A`
> 
> benchmark tests `MessageDigests.java GetMessageDigest.java MessageDigestBench.java MacBench.java` which are under `test/micro/org/openjdk/bench/`.
> 
> 
> **perf data summary**
> 
> tests                                                           intrinsic (ns/op)       base (ns/op)    speed up (times) 
> o.o.b.java.security.MessageDigests.digest (64)                  3454.207                12026.787       3.48    
> o.o.b.java.security.MessageDigests.digest (16384)               184063.834              1307913.534     7.11    
> o.o.b.java.security.MessageDigests.getAndDigest (64)            8260.011                17707.156       2.14    
> o.o.b.java.security.MessageDigests.getAndDigest (16384)         191325.246              1379660.864     7.21    
> o.o.b.javax.crypto.full.MacBench.mac (128)                      8220.886                34101.577       4.15    
> o.o.b.javax.crypto.full.MacBench.mac (1024)                     18006.955               107906.128      5.99    
> o.o.b.javax.crypto.small.MessageDigestBench.digest              11688843.558            82834313.280    7.09    
> 
> 
> 
> **raw perf data - when intrinsic is enabled**
> 
> o.o.b.java.security.GetMessageDigest.cloneInstance                    N/A         N/A           SHA-1       N/A         N/A  avgt   10        489.860 ?       6.277  ns/op
> o.o.b.java.security.GetMessageDigest.getInstance                      N/A         N/A           SHA-1       N/A         N/A  avgt   10       3477.197 ?     204.203  ns/op
> o.o.b.java.security.GetMessageDigest.getInstanceWithProvider          N/A         N/A           SHA-1       N/A         N/A  avgt   10       4111.164 ?     108.861  ns/op
> o.o.b.java.security.MessageDigests.digest                             N/A         N/A           SHA-1        64     DEFAULT  avgt   10       3454.207 ?      53.924  ns/op
> o.o.b.java.security.MessageDigests.digest                             N/A         N/A           SHA-1     16384     DEFAULT  avgt   10     184063.834 ?     677.635  ns/op
> o.o.b.java.security.MessageDigests.getAndDigest                       N/A         N/A           SHA-1        64     DEFAULT  avgt   10       8260.011 ?     150.045  ns/op
> o.o.b.java.security.MessageDigests.getAndDigest                 ...

Hamlin Li has updated the pull request incrementally with two additional commits since the last revision:

 - remove tp/gp
 - refine code

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/17130/files
  - new: https://git.openjdk.org/jdk/pull/17130/files/42f838a9..eb020a85

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=17130&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17130&range=02-03

  Stats: 94 lines in 1 file changed: 34 ins; 12 del; 48 mod
  Patch: https://git.openjdk.org/jdk/pull/17130.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17130/head:pull/17130

PR: https://git.openjdk.org/jdk/pull/17130


More information about the hotspot-dev mailing list