JDK-8277121 : x86_32 fails Short*Vector tests
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 18
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2021-11-15
  • Updated: 2021-12-06
  • Resolved: 2021-12-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 18
18Resolved
Related Reports
Duplicate :  
Description
$ CONF=linux-x86-server-fastdebug make clean run-test TEST=jdk/incubator/vector/

test Short256VectorTests.divShort256VectorTestsMasked(short[-i * 5], short[i + 1], mask[i % 2]): success
test Short256VectorTests.divShort256VectorTestsMasked(short[-i * 5], short[cornerCaseValue(i)], mask[i % 2]): failure
java.lang.ArithmeticException: zero vector lane in dividend [32767, -32768, -32768, 32767, 1, 32767, -32768, -32768, 32767, 0, 32767, -32768, -32768, 32767, 1, 32767]
	at jdk.incubator.vector/jdk.incubator.vector.AbstractVector.divZeroException(AbstractVector.java:494)
	at jdk.incubator.vector/jdk.incubator.vector.ShortVector.lanewiseTemplate(ShortVector.java:622)
	at jdk.incubator.vector/jdk.incubator.vector.Short256Vector.lanewise(Short256Vector.java:279)
	at jdk.incubator.vector/jdk.incubator.vector.Short256Vector.lanewise(Short256Vector.java:41)
	at jdk.incubator.vector/jdk.incubator.vector.ShortVector.lanewise(ShortVector.java:684)

The failure goes away with -XX:-Inline or -XX:DisableIntrinsics=_VectorCompare.

This also helps:

diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad
index 1ea22eee800..05930a6a171 100644
--- a/src/hotspot/cpu/x86/x86.ad
+++ b/src/hotspot/cpu/x86/x86.ad
@@ -1815,7 +1815,7 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType
       }
       break;
     case Op_VectorMaskCmp:
-      if (vlen < 2 || size_in_bits < 32) {
+      if (!is_LP64 || vlen < 2 || size_in_bits < 32) {
         return false;
       }
       break;
Comments
I believe it was fixed by JDK-8271515 integration, notably this block: https://github.com/openjdk/jdk/commit/a59c9b2ac277d6ff6be1700d91ff389f137e61ca#diff-d6a3624f0f0af65a98a47378a5c146eed5016ca09b4de1acd0a3acc823242e82R1949-R1953 The failure is not reproduced anymore.
02-12-2021

ILW = Div by Zero exception due to incorrect C2 code, only with X86_32 on with VectorCompare intrinsic, -XX:-Inline or -XX:DisableIntrinsics=_VectorCompare = HLM = P3
16-11-2021