Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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