. 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.
- causes
-
JDK-8350840 C2: x64 Assembler::vpcmpeqq assert: failed: XMM register should be 0-15
-
- Open
-
- csr for
-
JDK-8338352 Support new unsigned and saturating vector operators in VectorAPI
-
- Closed
-
- relates to
-
JDK-8343297 Vector unsigned min/max test are failing with -Xcomp
-
- Resolved
-
-
JDK-8346174 UMAX/UMIN are missing from XXXVector::reductionOperations
-
- Resolved
-
-
JDK-8343419 Assertion failure in long vector unsigned min/max with -XX:+UseKNLSetting
-
- Resolved
-
-
JDK-8343211 Compile error: redefinition of 'Assembler::evmovdquw(XMMRegister,KRegister,XMMRegister,bool,int)'
-
- Closed
-
- links to
-
Commit(master) openjdk/jdk/52382e28
-
Review(master) openjdk/jdk/20507