RFR: 8356159: RISC-V: Add Zabha [v2]

Robbin Ehn rehn at openjdk.org
Mon May 19 11:48:56 UTC 2025


On Mon, 19 May 2025 09:34:11 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> Hi, please consider.
>> 
>> This adds the byte and halfword atomic memory operations (Zabha) - https://github.com/riscv/riscv-zabha.
>> All amo-instructions, except load-reserve and store-conditional, can also be performed on natural aligned half-words and bytes. (i.e. the extension do not add lr.h/b or sc.h/b) This includes amocas if zacas extension is present.
>> 
>> The majority of this patch is to support amocas.h/b. We are now starting to really feel the pain of all these extensions, as CAS:ing 16/8-bits can now be done in three different ways:
>> - lr.w/sc.w 'narrow' CAS (no extension)
>> - amocas.w 'narrow' CAS (Zacas)
>> - amocas.h/b (Zacas + Zabha)
>> 
>> There is no hwprobe support yet.
>> 
>> Ran t1-3 with Zacas+Zabha and t1 without Zabha in qemu.
>> 
>> Thanks, Robbin
>
> Robbin Ehn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
> 
>  - Revert back to default relaxed
>  - Merge branch 'master' into 8356159
>  - Fixed ws
>  - Initial draft

> Ah, I see. Maybe it's better to change the caller's param passing to reflect this? But I still don't understand the performance impact here. I suppose that changing the default memory ordering won't make a difference here? Because no one uses the default value for now.

Yes I can change in caller instead. I didn't either find any uses of default memory I'll remove default as no-one uses it.

I'm going to diff assembly see if I find something for the performance issue.

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

PR Comment: https://git.openjdk.org/jdk/pull/25252#issuecomment-2890711406


More information about the hotspot-dev mailing list