[VectorAPI] Fix incorrect identity values in UMIN/UMAX reductions

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P3
    • None
    • Affects Version/s: None
    • Component/s: core-libs
    • None
    • generic
    • generic

      The original implementation of UMIN/UMAX reductions in JDK-8346174
      used incorrect identity values in the Java fallback implementation
      and test code.

      Problem:
      --------
      UMIN was using MAX_OR_INF (signed maximum value) as the identity:
        - Byte.MAX_VALUE (127) instead of max unsigned byte (255)
        - Short.MAX_VALUE (32767) instead of max unsigned short (65535)
        - Integer.MAX_VALUE instead of max unsigned int (-1)
        - Long.MAX_VALUE instead of max unsigned long (-1)

      UMAX was using MIN_OR_INF (signed minimum value) as the identity:
        - Byte.MIN_VALUE (-128) instead of 0
        - Short.MIN_VALUE (-32768) instead of 0
        - Integer.MIN_VALUE instead of 0
        - Long.MIN_VALUE instead of 0

      This caused incorrect result. For example:
        UMAX([42,42,...,42]) returned 128 instead of 42

            Assignee:
            Eric Fang
            Reporter:
            Eric Fang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: