On Mon, 8 Apr 2024 19:11:19 GMT, Scott Gibbons <sgibb...@openjdk.org> wrote:

>> This code makes an intrinsic stub for `Unsafe::setMemory` for x86_64.  See 
>> [this PR](https://github.com/openjdk/jdk/pull/16760) for discussion around 
>> this change.
>> 
>> Overall, making this an intrinsic improves overall performance of 
>> `Unsafe::setMemory` by up to 4x for all buffer sizes.
>> 
>> Tested with tier-1 (and full CI).  I've added a table of the before and 
>> after numbers for the JMH I ran (`MemorySegmentZeroUnsafe`).
>> 
>> [setMemoryBM.txt](https://github.com/openjdk/jdk/files/14808974/setMemoryBM.txt)
>
> Scott Gibbons has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Add movq to locate_operand

To me doing the compiler intrinsic for Unsafe setMemory looked to be the right 
first step as in this PR. There is precedence with Unsafe copyMemory intrinsic 
so we are in sync with what is done before. We could request Fei Yang/Hamlin Li 
for RISC-V intrinsic and Bhavana Kilambi/Nick Gasson for AARCH64 intrinsic as 
follow up PRs.

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

PR Comment: https://git.openjdk.org/jdk/pull/18555#issuecomment-2048164233

Reply via email to