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

Martin Doerr mdoerr at openjdk.org
Thu Jun 27 17:39:55 UTC 2024


On Thu, 27 Jun 2024 17:34:11 GMT, Suchismith Roy <sroy at openjdk.org> wrote:

>> [JDK-8331732](https://bugs.openjdk.org/browse/JDK-8331732)
>> The template interpreter contains branch-free conversion code for T_BOOLEAN (TemplateInterpreterGenerator::generate_result_handler_for).
>> 
>> SharedRuntime::generate_native_wrapper uses unoptimized code to "Unpack the native result" for T_BOOLEAN.
>> Power10 has the "setbc" / "setbcr" instruction.
>> 
>> A new function has been created for the conversion and use "setbcr" on Power10 (determined by VM_Version::has_brw()) and otherwise the branch-free implementation. We should have a function for 32 and one for 64 bit operations (or one with supports both).
>> 
>> The new code for MacroAssembler::verify_secondary_supers_table  also uses the new function.
>
> Suchismith Roy has updated the pull request incrementally with two additional commits since the last revision:
> 
>  -  remove assembler header
>  -  remove assembler header

I had forgotten one minor thing. Otherwise, LGTM. I can test it over the weekend.

src/hotspot/cpu/ppc/macroAssembler_ppc.hpp line 298:

> 296: 
> 297:   // Branch-free implementation to convert !=0 to 1.
> 298:   void normalize_bool(Register dst, Register src, bool use_64bit);

Better use "temp" instead of "src" which make be confusing.

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

PR Review: https://git.openjdk.org/jdk/pull/19886#pullrequestreview-2146082835
PR Review Comment: https://git.openjdk.org/jdk/pull/19886#discussion_r1657543879


More information about the hotspot-dev mailing list