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

Support new unsigned and saturating vector operators in VectorAPI

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • tbd
    • 24
    • hotspot
    • x86_64
    • generic

    Description

      Support following new vector operators.
           . SUADD
           . SADD
           . SUSUB
           . SSUB
           . UMAX
           . UMIN

      Proposed vector operators are applicable to only integral types since their values wraparound in over/underflowing scenarios after setting appropriate status flags. For floating point types, as per IEEE 754 specs there are multiple schemes to handler underflow, one of them is gradual underflow which transitions the value to subnormal range. Similarly, overflow implicitly saturates the floating-point value to an Infinite value.

      As the name suggests, these are saturating operations, i.e. the result of the computation is strictly capped by lower and upper bounds of the result type and is not wrapped around in underflowing or overflowing scenarios.

      Add following scalar saturating APIs corresponding to each of the above saturating vector operator in corresponding primitive box classes:-

      <primitive type> PrimitiveBox.addSaturating(<primitive type> param1, <primitive type> param2);
      <primitive type> PrimitiveBox.subSaturating(<primitive type> param1, <primitive type> param2);
      <primitive type> PrimitiveBox.addSaturatingUnsigned(<primitive type> param1, <primitive type> param2);
      <primitive type> PrimitiveBox.subSaturatingUnsigned(<primitive type> param1, <primitive type> param2);
      <primitive type> PrimitiveBox.maxUnsigned(<primitive type> param1, <primitive type> param2);
      <primitive type> PrimitiveBox.minUnsigned(<primitive type> param1, <primitive type> param2);

      Fallback implementation of vector operators should call above scalar APIs to compute the result of each vector lane.

      C2 compiler IR and inline expander changes along with optimized x86 backend implementation for new vector operators and their predicated counterparts.

      Extend existing Vector API JTreg test suite to cover new operations.

      Attachments

        Issue Links

          Activity

            People

              jbhateja Jatin Bhateja
              jbhateja Jatin Bhateja
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: