RFR: 8256973: Intrinsic creation for VectorMask query (lastTrue, firstTrue, trueCount) APIs [v2]
Vladimir Ivanov
vladimir.x.ivanov at oracle.com
Mon May 17 13:00:03 UTC 2021
>> Ok, fair enough. We can revisit that later and merge them if needed.
>> Some suggestions to consider to align it with `reductionCoerced`:
>>
>> * reflect in the name that it's effectively a reduction, but on masks (`maskReductionCoerced`?);
>> * return type can be generalized to `long`;
>
> Hi @iwanowww, Can you kindly elaborate why should the return type be long here ?
> We will need to again downcast it to integer since these APIs return an integer value.
FTR downcasts are fine here.
In the context of JVM intrinsics the main question is what carrier type
to pick.
If you don't envision any future operations on masks to return 64-bit
values, then it's fine to pick int.
Otherwise, it's better to start with long.
Because when such operation is introduced, return type (and all use
sites) will have to be adjusted anyway (instead of introducing yet
another intrinsic method).
Best regards,
Vladimir Ivanov
>> * bound on M: `<M extends VectorMask>`;
>> * no need to introduce a special interface, `Function<T,R>` just works: `VectorMaskOp<M>` -> `Function<M, Long>`;
>
> -------------
>
> PR: https://git.openjdk.java.net/jdk/pull/3916
>
More information about the hotspot-compiler-dev
mailing list