RFR: 8318650: Optimized subword gather for x86 targets. [v11]

Paul Sandoz psandoz at openjdk.org
Thu Feb 1 00:31:04 UTC 2024


On Wed, 31 Jan 2024 23:53:16 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 1613:
>> 
>>> 1611:   vpand(xtmp, idx_vec, xtmp, vlen_enc);
>>> 1612:   // Load double words from normalized indices.
>>> 1613:   evpgatherdd(dst, gmask, Address(base, xtmp, scale), vlen_enc);
>> 
>> Another question, looks to me that we could read beyond the allocated memory for the array here. e.g. consider the following case:
>> * It is a byte gather
>> * The byte source array is of size 41, i.e. only indices 0-40 are valid
>> * The gather index is 40
>> 
>> Then as part of evpgatherdd we would be reading bytes at 40-43 offset from source array.
>
> I guess the fact that the Java objects are 8 byte alignment padded and the alignment being done at lines 1609-1611 and 1616-1621 somehow takes care of this.

Drive by comment, that can change with Project Lilliput.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16354#discussion_r1473650392


More information about the core-libs-dev mailing list