RFR: 8345179: RISC-V: Add gtests for weak cmpxchg [v3]
Fei Yang
fyang at openjdk.org
Tue Dec 3 01:46:38 UTC 2024
On Mon, 2 Dec 2024 17:46:16 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
>> Hi, please consider.
>>
>> This adds tests of aligned weak narrow cmpxchg.
>>
>> [ RUN ] RiscV.cmpxchg_weak_int16_lr_sc_vm
>> [ OK ] RiscV.cmpxchg_weak_int16_lr_sc_vm (2 ms)
>> [ RUN ] RiscV.cmpxchg_weak_int8_lr_sc_vm
>> [ OK ] RiscV.cmpxchg_weak_int8_lr_sc_vm (0 ms)
>> [ RUN ] RiscV.cmpxchg_weak_int16_maybe_zacas_vm
>> [ OK ] RiscV.cmpxchg_weak_int16_maybe_zacas_vm (0 ms)
>> [ RUN ] RiscV.cmpxchg_weak_int8_maybe_zacas_vm
>> [ OK ] RiscV.cmpxchg_weak_int8_maybe_zacas_vm (0 ms)
>> [----------] 4 tests from RiscV (20997 ms total)
>>
>> Executed with -XX:+UnlockExperimentalVMOptions -XX:+UseZacas
>>
>> Thanks, Robbin
>
> Robbin Ehn has updated the pull request incrementally with one additional commit since the last revision:
>
> Added weak 4/8 byte cmpxchg
test/hotspot/gtest/riscv/test_assembler_riscv.cpp line 295:
> 293: address entry = _masm.pc();
> 294: {
> 295: _masm.cmpxchg_weak(/*addr*/ c_rarg0, /*expected*/ c_rarg1, /*new_value*/ c_rarg2,
Seems that we should rename macro-assembler routine `cmpxchg_weak` to `weak_cmpxchg`.
I have prepared another PR to fix this naming issue: https://github.com/openjdk/jdk/pull/22505.
test/hotspot/gtest/riscv/test_assembler_riscv.cpp line 308:
> 306:
> 307: template <typename TESTSIZE, Assembler::operand_size ASMSIZE>
> 308: void run_narrow_cmpxchg_tests() {
Consider rename to `run_weak_cmpxchg_narrow_value_tests`.
test/hotspot/gtest/riscv/test_assembler_riscv.cpp line 354:
> 352:
> 353: template <typename TESTSIZE, Assembler::operand_size ASMSIZE>
> 354: void weak_cmpxchg_test() {
Consider rename to `run_weak_cmpxchg_tests`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22476#discussion_r1866856894
PR Review Comment: https://git.openjdk.org/jdk/pull/22476#discussion_r1866808350
PR Review Comment: https://git.openjdk.org/jdk/pull/22476#discussion_r1866808552
More information about the hotspot-dev
mailing list