Skip to content

Commit

Permalink
Flag fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
robehn committed Nov 28, 2023
1 parent 185a225 commit 3b2aeec
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions src/hotspot/cpu/riscv/vm_version_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,34 @@ void VM_Version::initialize() {
}

if (UseZvkn) {
if (FLAG_IS_DEFAULT(UseSHA256Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA256Intrinsics, true);
if (!ext_V.enabled()) {
FLAG_SET_DEFAULT(UseZvkn, false);
warning("Cannot enable Zvkn on cpu without RVV support.");
}
if (FLAG_IS_DEFAULT(UseRVV)) {
FLAG_SET_DEFAULT(UseRVV, true);
}
if (UseRVV) {
if (FLAG_IS_DEFAULT(UseSHA256Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA256Intrinsics, true);
}
if (FLAG_IS_DEFAULT(UseSHA256Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA256Intrinsics, true);
}
} else {
FLAG_SET_DEFAULT(UseZvkn, false);
warning("Cannot enabled Zvkn when RVV is disabled.");
}
} else if (UseSHA256Intrinsics) {
warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU.");
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
}

if (UseZvkn) {
if (FLAG_IS_DEFAULT(UseSHA512Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA512Intrinsics, true);
if (!UseZvkn) {
if (UseSHA256Intrinsics) {
warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU, UseZvkn needed.");
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
}
if (UseSHA512Intrinsics) {
warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU, UseZvkn needed.");
FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
}
} else if (UseSHA512Intrinsics) {
warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU.");
FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
}

if (UseSHA3Intrinsics) {
Expand Down

0 comments on commit 3b2aeec

Please sign in to comment.