RFR: 8297753: AArch64: Add optimized rules for vector compare with zero on NEON [v6]

Chang Peng duke at openjdk.org
Mon Feb 27 06:16:11 UTC 2023


On Fri, 24 Feb 2023 09:48:46 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Chang Peng has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Remove some switch-case stmts in c2_MacroAssembler_aarch64.cpp and avoid
>>    unsigned comparison.
>>  - Revert "Remove switch-case stmts in c2_MacroAssembler_aarch64.cpp"
>>    
>>    This reverts commit d899238d0cb98fdf375b3011670495c3bfe8bbaf.
>
> src/hotspot/cpu/aarch64/aarch64.ad line 2538:
> 
>> 2536: Assembler::Condition booltest_cond_to_assembler_cond(BoolTest::mask cond) {
>> 2537:   switch(cond) {
>> 2538:     case BoolTest::eq:
> 
> I'd `assert(cmpOpOper(BoolTest::overflow).ccode() == result)` here.

Thanks, I think this assert will guarantee the correctness of this function.

I found that cmpOpUOper convert signed BoolTest conditions (gt, ge, lt, le) to unsigned Assembler conditions, but unsigned vector comparison in vector API will produce unsigned BoolTest conditions(uge, ugt, ult, ule), and these conditons cannot be passed like following:


assert(cmpOpUOper(unsigned_cond).ccode() == result, "Invalid conversion");
``` 
Maybe we will meet some issues when taking unsigned vector comparison.

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

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


More information about the hotspot-compiler-dev mailing list