JDK-8358767 : [vectorapi] UMIN and UMAX reduction have incorrect identity value
  • Type: Bug
  • Component: core-libs
  • Affected Version: 24,25,26
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2025-06-06
  • Updated: 2025-12-08
  • Resolved: 2025-12-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26Resolved
Related Reports
Causes :  
Duplicate :  
Duplicate :  
Description
The code in question:

case VECTOR_OP_UMIN: return (v, m) -> toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (int) VectorMath.minUnsigned(a, b)));

Unfortunately, we are sloppy here, the identity value for UMIN should be -1 (MAX_UINT). I wonder why the tests do not catch it.
Comments
[~sherman] Ok, then let me fix it. I hope to fix it as soon as possible since it's blocking my work to intrinsify the UMin/UMax reduction operations. I'll mark this ticket as duplicate since I have assigned https://bugs.openjdk.org/browse/JDK-8372978 to me. Thanks~
08-12-2025

Hi [~erfang] , I haven't started on this one yet.
05-12-2025

Hi, [~sherman] are you working on this issue? I just found this issue when working on the intrinsic support for them. I have a patch to fix the issue, if you are not working on this, I'll submit the patch.
03-12-2025

Oops, that's an embarrassing mistake. The tests don't catch it because they have a similar mistake: gen_reduction_op_func "UMIN" "(\$type\$) VectorMath.minUnsigned" "BITWISE" "\$Wideboxtype\$.\$MaxValue\$" gen_reduction_op_func "UMAX" "(\$type\$) VectorMath.maxUnsigned" "BITWISE" "\$Wideboxtype\$.\$MinValue\$" Suggest add internal constants for integral unsigned min (0) and unsigned max (-1) values.
06-06-2025

ILW = same as JDK-8346174 = P3
06-06-2025