RFR: 8345178: RISC-V: Add gtests for narrow cmpxchg [v2]

Robbin Ehn rehn at openjdk.org
Mon Dec 2 12:44:37 UTC 2024


On Mon, 2 Dec 2024 11:43:29 GMT, Hamlin Li <mli at openjdk.org> wrote:

> Thanks for adding the tests!
> 
> The test code looks good. Just some minor comment below.
> 
> And one general question, will we consider to add some concurrent tests in the future? Although I don't have a good idea how to implement such tests in a stable way. :)

Thanks, yes I'm adding concurrent tests also.
There is several in the gtest suit.

> test/hotspot/gtest/riscv/test_assembler_riscv.cpp line 144:
> 
>> 142:     data[i] = 121;
>> 143:     ret = NarrowCmpxchgTester<TESTSIZE, ASMSIZE>::narrow_cmpxchg((intptr_t)&data[i], 121, 42, /* result */ 67,
>> 144:                                                                           -1, -1, -1, false);
> 
> Seems we don't need to put these `-1, -1, -1` as the arguments of `NarrowCmpxchgTester::narrow_cmpxchg`, they could be just local variables in `narrow_cmpxchg`.

Thanks!

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

PR Comment: https://git.openjdk.org/jdk/pull/22445#issuecomment-2511438119
PR Review Comment: https://git.openjdk.org/jdk/pull/22445#discussion_r1865781576


More information about the hotspot-dev mailing list