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

AArch64: Incorrect result for double to int vector conversion

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Build:
      b21
    • Introduced In Version:
      18
    • Resolved In Build:
      b23
    • CPU:
      aarch64
    • OS:
      linux

      Description

      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.)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              njian Ningsheng Jian
              Reporter:
              njian Ningsheng Jian
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: