RFR: 8372978: [VectorAPI] Fix incorrect identity values in UMIN/UMAX reductions
Quan Anh Mai
qamai at openjdk.org
Tue Dec 9 08:03:57 UTC 2025
On Tue, 9 Dec 2025 07:54:05 GMT, Eric Fang <erfang at openjdk.org> wrote:
>> @erifan I don't see why `firstNonZero` cannot do the same and start from `a[idx]` here?
>
> @merykitty I apologize for not being clear. Actually, It's `SUADDReduce` that doesn't allow starting with `a[idx]` because that would result in `a[idx]` being added twice.
>
> Specifically, this happens as follows: `gen_saturating_reduction_op` (used to generate `SUADDReduce`) and `gen_reduction_op_func` (used to generate `umin/umax, etc.`) both use the `Unit-Reduction-Scalar-op.template` template. When we modify it, `SUADDReduce` is also affected. Therefore, a new template needs to be defined.
But then the loop can start from `idx + 1` instead of `idx`, right?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28692#discussion_r2601512724
More information about the core-libs-dev
mailing list