RFR: 8344010: RISC-V: Zacas do not work with LW locking
Fei Yang
fyang at openjdk.org
Mon Nov 18 11:33:46 UTC 2024
On Mon, 18 Nov 2024 07:20:55 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
>> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 3533:
>>
>>> 3531: cmpxchg(addr, expected, new_val, size, acquire, release, result, true);
>>> 3532: return;
>>> 3533: }
>>
>> Question: Should we move the code after the three assertions? I see same assertions are there in `MacroAssembler::cmpxchg` as well. Even though they are the same for now, I assume they are targeting different code and are submit to change in the future.
>
> The reason to move it after is readability.
> By having the zacas code before the asserts you think the implied contract the asserts states do not apply to zacas case. Meaning that, at least I, read the code as addr, expected, new_val may be t0 when UseZacas is true.
Make sense in that respect.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22149#discussion_r1846429219
More information about the hotspot-dev
mailing list