RFR: 8293566: RISC-V: Clean up push and pop registers [v3]

Feilong Jiang fjiang at openjdk.org
Sun Sep 11 02:24:05 UTC 2022


On Sun, 11 Sep 2022 01:03:14 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Feilong Jiang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fix return size of push_v/pop_v
>
> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 955:
> 
>> 953: 
>> 954:   unsigned char regs[32];
>> 955:   int count = bitset_to_regs(regset.bits(), regs);
> 
> I think it's better to have a zero-check for regs.bits() before we run into the loop in MacroAssembler::bitset_to_regs. So I would suggest make the old API "int MacroAssembler::push_reg(unsigned int bitset, Register stack)" a private member function and implement the new API as:
> 
> void MacroAssembler::push_reg(RegSet regset, Register stack) { if (regs.bits()) push_reg(regs.bits(), stack); }
> 
> Similar for pop_reg and other APIs here.

Done, keep the old bitset verison and make them private.

> src/hotspot/cpu/riscv/macroAssembler_riscv.hpp line 484:
> 
>> 482: #ifdef COMPILER2
>> 483:   void push_vp(VectorRegSet regset, Register stack);
>> 484:   void pop_vp(VectorRegSet regset, Register stack);
> 
> The function name push_vp / pop_vp look a bit strange to me. I think we should rename them to push_v / pop_v.

Done, renamed to `push_v/pop_v`.

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

PR: https://git.openjdk.org/jdk/pull/10227


More information about the hotspot-dev mailing list