RFR: 8342095: Add autovectorizer support for subword vector casts [v13]

Jasmine Karthikeyan jkarthikeyan at openjdk.org
Thu Jul 31 03:37:49 UTC 2025


On Wed, 28 May 2025 15:25:19 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Jasmine Karthikeyan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Check for AVX2 for byte/long conversions
>
> src/hotspot/share/opto/superword.cpp line 2361:
> 
>> 2359: 
>> 2360:   // Subword cast: Element sizes differ, but the platform supports a cast to change the def shape to the use shape.
>> 2361:   if ((is_subword_type(def_bt) || is_subword_type(use_bt)) && VectorCastNode::implemented(-1, pack_size, def_bt, use_bt)) {
> 
> I see you use this set of conditions 2 time. Can it be separate function?  Also `-1` is strange argument for people who not familiar with code. May be add `/* comment */` to it. Or use some `#define` to have meaningful name for it.

Thanks for the suggestion! I've moved the logic to a function to reduce code duplication and added a comment explaining the `-1`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23413#discussion_r2244268512


More information about the hotspot-compiler-dev mailing list