RFR: 8356159: RISC-V: Add Zabha [v11]
Robbin Ehn
rehn at openjdk.org
Tue Jun 3 11:52:44 UTC 2025
On Tue, 3 Jun 2025 09:51:46 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
>> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 4151:
>>
>>> 4149: zext(prev, prev, 32);
>>> 4150: break;
>>> 4151: case int16:
>>
>> The call site of `atomic_cas` is only guaranteed by `UseZacas`. Do we need extra checking for `UseZabha` if the operand size is `int16` or `int8`?
>
> If nothing else the assembler always checks:
>
> void amo_base(Register Rd, Register Rs1, uint8_t Rs2, Aqrl memory_order = aqrl) {
> assert(width > AMO_WIDTH_HALFWORD || UseZabha, "Must be");
> assert(funct5 != AMO_CAS || UseZacas, "Must be");
>
>
> I'll have a look!
When we call amocas with unknown size (i.e. not hardcoded int64/int32) we have this assert in the caller:
`assert((UseZacas && UseZabha) || (size != int8 && size != int16), "unsupported operand size");`
So it seems like we should be fine, no?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25252#discussion_r2123563891
More information about the hotspot-dev
mailing list