RFR: JDK-8331732 : [PPC64] Unify and optimize code which converts != 0 to 1 [v3]

Martin Doerr mdoerr at openjdk.org
Thu Jun 27 16:19:15 UTC 2024


On Thu, 27 Jun 2024 15:59:41 GMT, Suchismith Roy <sroy at openjdk.org> wrote:

>> src/hotspot/cpu/ppc/macroAssembler_ppc.cpp line 348:
>> 
>>> 346: // Branch-free implementation to convert !0 to false
>>> 347: // Set register dst to true if dst is non zero using temp for calculations on Power Version<10.
>>> 348: // Set register dst to true if dst is non zero for Power 10 and above machines.
>> 
>> Please don't use the term "true". It's not defined in assembler.
>> In addition: We do the same for older processors. Just by other instructions.
>> I think these 2 lines could be removed.
>
> Can i instead just write 1? I feel the comments can explain the logic in short ?

Maybe: "Set register dst to 1 if dst is non-zero. Use setbcr instruction on Power10."

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19886#discussion_r1657431435


More information about the hotspot-dev mailing list