RFR: 8300253: Introduce AArch64 nzcv accessors

Andrew Haley aph at openjdk.org
Wed Jan 18 10:00:23 UTC 2023


On Wed, 18 Jan 2023 09:03:58 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:

>>> Could @fisk provide an example of where this might be used?
>>> 
>>> My assumption is that you are looking to execute code verification within, say, a GC memory barrier, and the code has been inserted in between where the condition codes might have been set and then used. This could avoid breaking the existing code when the verification code itself sets the condition codes.
>>> 
>>> It's not all of the pstate, but then this is just userspace, so it ought to be ok?
>>> 
>>> 
>> 
>> Your guess is spot on. We have a bunch of GC barrier nodes in C1, and C1 sprinkles oop verification all over the place - including when spilling oops between lir ops - sometimes between producing a condition code and consuming it. So I figured the verification code shouldn't really alter the state of execution such that it does something different. And I don't really want to reduce the amount of verification, because it was very useful in tracking down bugs.
>
> The specific use case we have is here: https://github.com/openjdk/zgc/blob/c23bd9e059df2759adaa5d316ec7d269ef5154a6/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp#L119

OK, I'm not wild about checking in dead code, but if it's imminently needed, OK. Please add the instructions to  `test/hotspot/gtest/aarch64/aarch64-asmtest.py` so they get tested..

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

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


More information about the hotspot-dev mailing list