RFR: 8319111: Mismatched MemorySegment heap access is not consistently intrinsified [v2]
Jatin Bhateja
jbhateja at openjdk.org
Fri Dec 1 08:39:23 UTC 2023
On Thu, 30 Nov 2023 22:57:29 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:
>> src/hotspot/share/opto/vectorIntrinsics.cpp line 1244:
>>
>>> 1242:
>>> 1243: int mem_num_elem = mismatched_ms ? num_elem * type2aelembytes(elem_bt) : num_elem;
>>> 1244: BasicType mem_elem_bt = mismatched_ms ? T_BYTE : elem_bt;
>>
>> Shouldn't the mem_elem_bt come from arr_type->elem()->array_element_basic_type()?
>> Also the mem_num_elem be calculated accordingly?
>
> The non masked load/store is doing that but the masked load/store is using T_BYTE.
Yes, that's what the intent is, for masked versions we operate at byte granularity to support widening and narrowing case e.g. loading masked float vector from a double memory segment, mask bit is in accordance with float type, but cannot be directly reflected over double lanes.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16888#discussion_r1411776496
More information about the hotspot-compiler-dev
mailing list