RFR: 8186670: Implement _onSpinWait() intrinsic for AArch64

Andrew Haley aph at openjdk.java.net
Sat Sep 18 09:40:45 UTC 2021


On Sat, 18 Sep 2021 09:33:33 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> This PR is a follow-up on the discussion [“RFC: AArch64: Implementing spin pauses with ISB”](https://mail.openjdk.java.net/pipermail/hotspot-dev/2021-August/054033.html).
>> 
>> It adds the option `UsePauseImpl=value`, where `value` can be:
>> 
>> - `none`: no implementation for spin pauses. This is the default value.
>> - `Nnop`: use `nop` instruction for spin pauses. Optional `N` can be `2..9` to specify a number of `nop` instructions.
>> - `Nisb`: use `isb` instruction for spin pauses. Optional `N` can be `2..9` to specify a number of `isb` instructions.
>> - `Nyield`: use `yield` instruction for spin pauses. Optional `N` can be `2..9` to specify a number of `yield` instructions.
>> 
>> The code for the `Thread.onSpinWait` intrinsic is generated based on the value of `UsePauseImpl`.
>> 
>> Testing:
>> 
>> - `make test TEST="gtest"`: Passed
>> - `make run-test TEST="tier1"`: Passed
>> - `make run-test TEST="tier2"`: Passed
>> - `make run-test TEST=hotspot/jtreg/compiler/onSpinWait`: Passed
>
> src/hotspot/cpu/aarch64/aarch64.ad line 14368:
> 
>> 14366:         for (unsigned int i = 1; i < VM_Version::pause_impl_desc().inst_count(); ++i) {
>> 14367:           $$emit$$"\tisb\n"
>> 14368:         }
> 
> The code to generate n copies of a pause_impl instruction would be much happier in the MacroAssembler.

So, lose all the code here in C2 and push it down into a single macro.

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

PR: https://git.openjdk.java.net/jdk/pull/5562


More information about the hotspot-dev mailing list