Skip to content

Commit 492d25c

Browse files
Gergö BaranyTom Rodriguez
Gergö Barany
authored and
Tom Rodriguez
committedJun 19, 2023
8309601: [JVMCI] AMD64#getLargestStorableKind returns incorrect mask kind
Reviewed-by: dnsimon, never
1 parent 959a61f commit 492d25c

File tree

1 file changed

+11
-2
lines changed
  • src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64

1 file changed

+11
-2
lines changed
 

‎src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64/AMD64.java

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -248,6 +248,8 @@ public enum Flag {
248248

249249
private final AMD64Kind largestKind;
250250

251+
private final AMD64Kind largestMaskKind;
252+
251253
public AMD64(EnumSet<CPUFeature> features, EnumSet<Flag> flags) {
252254
super("AMD64", AMD64Kind.QWORD, ByteOrder.LITTLE_ENDIAN, true, allRegisters, LOAD_LOAD | LOAD_STORE | STORE_STORE, 1, 8);
253255
this.features = features;
@@ -256,10 +258,17 @@ public AMD64(EnumSet<CPUFeature> features, EnumSet<Flag> flags) {
256258

257259
if (features.contains(CPUFeature.AVX512F)) {
258260
largestKind = AMD64Kind.V512_QWORD;
261+
if (features.contains(CPUFeature.AVX512BW)) {
262+
largestMaskKind = AMD64Kind.MASK64;
263+
} else {
264+
largestMaskKind = AMD64Kind.MASK16;
265+
}
259266
} else if (features.contains(CPUFeature.AVX)) {
260267
largestKind = AMD64Kind.V256_QWORD;
268+
largestMaskKind = null;
261269
} else {
262270
largestKind = AMD64Kind.V128_QWORD;
271+
largestMaskKind = null;
263272
}
264273
}
265274

@@ -324,7 +333,7 @@ public AMD64Kind getLargestStorableKind(RegisterCategory category) {
324333
} else if (category.equals(XMM)) {
325334
return largestKind;
326335
} else if (category.equals(MASK)) {
327-
return AMD64Kind.MASK64;
336+
return largestMaskKind;
328337
} else {
329338
return null;
330339
}

0 commit comments

Comments
 (0)
Please sign in to comment.