RFR: 8333343: [REDO] AArch64: optimize integer remainder [v3]

Jin Guojie duke at openjdk.org
Thu Jun 6 07:18:47 UTC 2024


On Thu, 30 May 2024 10:16:03 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Jin Guojie has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Merge branch 'dev0530' of https://github.com/jinguojie-alibaba/jdk into dev0530
>>  - MacroAssembler::msub() takes a scratch register as an argument
>
> src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp line 446:
> 
>> 444: 
>> 445:   void msub(Register Rd, Register Rn, Register Rm, Register Ra, Register tmp = rscratch2);
>> 446:   void msubw(Register Rd, Register Rn, Register Rm, Register Ra, Register tmp = rscratch2);
> 
> Please delete these two methods that use rscratch2 as a default tmp register.

I tried it and encountered a problem: msub/msubw will be called in other functions,

  inline void mnegw(Register Rd, Register Rn, Register Rm) {
    msubw(Rd, Rn, Rm, zr);
  }

  inline void mneg(Register Rd, Register Rn, Register Rm) {
    msub(Rd, Rn, Rm, zr);
  }

If we add a parameter to msub/msubw, then

1. All these functions (mnegw, mneg, ...) that call msub/msubw also need to add parameters,

2. Moreover, all the calling functions of mnegw and mneg also need to be modified.

The above two effects involve too many code changes. 

Please see if we can keep a default parameter for msub/msubw so that their calling functions do not need to be modified.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19471#discussion_r1628899052


More information about the hotspot-dev mailing list