Skip to content

Commit

Permalink
8309601: [JVMCI] AMD64#getLargestStorableKind returns incorrect mask …
Browse files Browse the repository at this point in the history
…kind

Reviewed-by: dnsimon, never
  • Loading branch information
Gergö Barany authored and Tom Rodriguez committed Jun 19, 2023
1 parent 959a61f commit 492d25c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/amd64/AMD64.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -248,6 +248,8 @@ public enum Flag {

private final AMD64Kind largestKind;

private final AMD64Kind largestMaskKind;

public AMD64(EnumSet<CPUFeature> features, EnumSet<Flag> flags) {
super("AMD64", AMD64Kind.QWORD, ByteOrder.LITTLE_ENDIAN, true, allRegisters, LOAD_LOAD | LOAD_STORE | STORE_STORE, 1, 8);
this.features = features;
Expand All @@ -256,10 +258,17 @@ public AMD64(EnumSet<CPUFeature> features, EnumSet<Flag> flags) {

if (features.contains(CPUFeature.AVX512F)) {
largestKind = AMD64Kind.V512_QWORD;
if (features.contains(CPUFeature.AVX512BW)) {
largestMaskKind = AMD64Kind.MASK64;
} else {
largestMaskKind = AMD64Kind.MASK16;
}
} else if (features.contains(CPUFeature.AVX)) {
largestKind = AMD64Kind.V256_QWORD;
largestMaskKind = null;
} else {
largestKind = AMD64Kind.V128_QWORD;
largestMaskKind = null;
}
}

Expand Down Expand Up @@ -324,7 +333,7 @@ public AMD64Kind getLargestStorableKind(RegisterCategory category) {
} else if (category.equals(XMM)) {
return largestKind;
} else if (category.equals(MASK)) {
return AMD64Kind.MASK64;
return largestMaskKind;
} else {
return null;
}
Expand Down

1 comment on commit 492d25c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.