RFR: 8313779: RISC-V: use andn / orn in the MD5 instrinsic [v3]

Antonios Printezis tonyp at openjdk.org
Mon Aug 7 13:50:48 UTC 2023


> Small improvement of the MD5 intrinsic when the Zbb extension is available. Performance comparison (with thanks again to @robehn for this!):
> 
> before:
> 
> 
> MessageDigests.digest                   md5        64     DEFAULT  avgt    6    1835.246 ±  252.071  ns/op
> MessageDigests.digest                   md5     16384     DEFAULT  avgt    6  145386.522 ±  444.446  ns/op
> MessageDigests.getAndDigest             md5        64     DEFAULT  avgt    6    2555.515 ±  639.491  ns/op
> MessageDigests.getAndDigest             md5     16384     DEFAULT  avgt    6  149045.631 ± 6658.545  ns/op
> 
> 
> after:
> 
> 
> MessageDigests.digest                   md5        64     DEFAULT  avgt    6    1779.637 ±  207.869  ns/op
> MessageDigests.digest                   md5     16384     DEFAULT  avgt    6  137147.179 ±  706.396  ns/op
> MessageDigests.getAndDigest             md5        64     DEFAULT  avgt    6    2645.354 ± 1245.318  ns/op
> MessageDigests.getAndDigest             md5     16384     DEFAULT  avgt    6  141306.966 ± 7000.576  ns/op
> 
> 
> (only line 3 is not an improvement, but it has higher variation)
> 
> It seems to save around 5% of executed instructions.

Antonios Printezis has updated the pull request incrementally with one additional commit since the last revision:

  replaced li with mv

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/15156/files
  - new: https://git.openjdk.org/jdk/pull/15156/files/d7d1cfee..a7e9df67

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

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/15156.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15156/head:pull/15156

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


More information about the hotspot-dev mailing list