Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8276151

AArch64: Incorrect result for double to int vector conversion

XMLWordPrintable

    • b21
    • 18
    • b23
    • aarch64
    • linux

      AArch64 Vector API double to int may get incorrect results for corner cases.

      Current vector double to integer conversion generates code to convert double to long first and then narrow to integer, which does not follow
      Java language spec [1], and will get incorrect results for double values larger than Integer.MAX_VALUE or less than Integer.MIN_VALUE.
      For those too large/small values, result should be the largest/smallest representable value of type int, but converting to long and
      then narrowing to int will get different results.

      (We ought to update the test cases as well.)

            njian Ningsheng Jian (Inactive)
            njian Ningsheng Jian (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: