RFR: 8313779: RISC-V: use andn / orn in the MD5 instrinsic [v3]
Antonios Printezis
tonyp at openjdk.org
Mon Aug 7 14:17:31 UTC 2023
On Mon, 7 Aug 2023 13:50:48 GMT, Antonios Printezis <tonyp at openjdk.org> wrote:
>> 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
Tests pass (with both `-UseZbb` and `+UseZbb`) with the `li` -> `mv` change. I also confirmed that the generated code is the same.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15156#issuecomment-1667943172
More information about the hotspot-dev
mailing list