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

Robbin Ehn rehn at openjdk.org
Tue May 27 10:10:56 UTC 2025


On Tue, 27 May 2025 02:59:15 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> 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 15 additional commits since the last revision:
>> 
>>  - Reg limits fixed
>>  - Merge branch 'master' into 8356159
>>  - Fixed reg selection
>>  - More indention
>>  - Indention
>>  - Merge branch 'master' into 8356159
>>  - Review comments
>>  - Merge branch 'master' into 8356159
>>  - Review fix
>>  - Bug and review fixes
>>  - ... and 5 more: https://git.openjdk.org/jdk/compare/63281fc2...27fc528d
>
> src/hotspot/cpu/riscv/riscv.ad line 5263:
> 
>> 5261:   match(Set res (CompareAndSwapB mem (Binary oldval newval)));
>> 5262: 
>> 5263:   ins_cost(LOAD_COST + STORE_COST + ALU_COST * 10 + BRANCH_COST * 4);
> 
> You might want to align the `ins_cost` with the I & L variants as well. Same for compareAndSwapS.

I have been looking at the ins_cost. When using amocas I think a much better estimate is (for low end):
20xDEFAULT_COST / 2xVOLATILE_REF_COST (which is the same what arm uses)

Argubly more as a plain fence is VOLATILE_REF_COST and as amocases may miss cache (i.e. contended or not speculated).

We now have 38xDEFAULT_COST for lr/sc/amocas: what you reckon ?

Side note, that branches are 2xDEFAULT_COST (two alu's) - seems wrong, at least on larger OO.
We clearly see much higher cost in gem5.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25252#discussion_r2108784930


More information about the hotspot-dev mailing list