RFR: 8344306: RISC-V: Add zicond

Hamlin Li mli at openjdk.org
Tue Nov 26 11:08:41 UTC 2024


On Tue, 26 Nov 2024 10:41:14 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

>> src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp line 2047:
>> 
>>> 2045:       assert(false, "unsupported compare condition");
>>> 2046:       ShouldNotReachHere();
>>> 2047:   }
>> 
>> Seems we can use the similar way in `C2_MacroAssembler::cmp_branch` +`conditional_branches` to simplify the code.
>
> The "BoolTest" is a C2 construct, C1 uses LIR_Condition, there is no generic test enum.
> So you would need one table to translate from C2 -> masm and one from C1 -> masm, and then one table to pick the correct version.
> 
> You can turn any switch statement into a table with function pointers, but:
> `cmp_branch(cmpFlag ^ (1 << neg_cond_bits), op1, op2, L);`
> Trying to figure out which compare is selected is shoter, yes, but much more complex IMHO.

I see, thanks for clarification.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22386#discussion_r1858275911


More information about the hotspot-dev mailing list