RFR: 8370481: C2 SuperWord: Long/Integer.compareUnsigned return wrong value in SLP [v4]
    Hamlin Li 
    mli at openjdk.org
       
    Thu Oct 23 15:23:20 UTC 2025
    
    
  
On Thu, 23 Oct 2025 15:17:14 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   catch unexpected Cmp ops
>
> src/hotspot/share/opto/superword.cpp line 1752:
> 
>> 1750:   case Op_CmpUL:
>> 1751:     // Carry unsigned-ness information from CmpUxx to VTransformBoolTest,
>> 1752:     // which will be passed to e.g. VectorMaskCmp.
> 
> Suggestion:
> 
>     // When we have CmpU->Bool, the mask of the Bool has no unsigned-ness information,
>     // but the mask is implicitly unsigned only because of the CmpU. Since we will replace
>     // the CmpU->Bool with a single VectorMaskCmp, we need to now make the unsigned-ness
>     // explicit.
> 
> This would give more of a reason why we need to do the "unsign...ing". What do you think?
Yes, it's better! Thanks!
> src/hotspot/share/opto/superword.cpp line 1757:
> 
>> 1755:   case Op_CmpI:
>> 1756:   case Op_CmpL:
>> 1757:     break;
> 
> We could add a comment why these are ok without any action.
> Suggestion:
> 
>     // The mask of signed int/long scalar comparisons has the same semantics
>     // as the mask for vector elementwise int/long comparison with VectorMaskCmp.
>     break;
Nice! I can commit your suggestion by simply click the button.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27942#discussion_r2455580398
PR Review Comment: https://git.openjdk.org/jdk/pull/27942#discussion_r2455570421
    
    
More information about the hotspot-compiler-dev
mailing list