RFR: 8345322: RISC-V: Add concurrent gtests for cmpxchg variants

Fei Yang fyang at openjdk.org
Tue Dec 10 10:11:41 UTC 2024


On Tue, 10 Dec 2024 08:39:34 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

> The truncation is well defined, it's just signess overflow that is not spec. As TESTSIZE may be 64 bits and we don't simply increase by one that check itself will overflow.

Ah, I was considering TESTSIZE int8_t or int16_t.

> Note that even if compiler do something else than wrap around, it would do the same in both cases so it should produce the same result.

That makes sense to me. Thanks.

> Also note that this cast is no worse than doing (signed char)0xff.
> 
> Anyhow I tested trying to add max and min, the code just becomes very ugly and complicated.

All right then. Could you please add some code comment about what we are doing here to help understand?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22574#discussion_r1877778325


More information about the hotspot-dev mailing list