Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions substratevm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ At runtime, premain runtime options are set along with main class' arguments in
* (GR-58383) The length of the printed stack trace when using `-XX:MissingRegistrationReportingMode=Warn` can now be set with `-XX:MissingRegistrationWarnContextLines=` and its default length is now 8.
* (GR-58914) `ActiveProcessorCount` must be set at isolate or VM creation time.
* (GR-59326) Ensure builder ForkJoin commonPool parallelism always respects NativeImageOptions.NumberOfThreads.
* (GR-60081) Native Image now targets `armv8.1-a` by default on AArch64. Use `-march=compatibility` for best compatibility or `-march=native` for best performance if the native executable is deployed on the same machine or on a machine with the same CPU features. To list all available machine types, use `-march=list`.

## GraalVM for JDK 23 (Internal Version 24.1.0)
* (GR-51520) The old class initialization strategy, which was deprecated in GraalVM for JDK 22, is removed. The option `StrictImageHeap` no longer has any effect.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class NativeImageOptions {
public static final String MICRO_ARCHITECTURE_LIST = "list";

@APIOption(name = "-march")//
@Option(help = "Generate instructions for a specific machine type. Defaults to 'x86-64-v3' on AMD64 and 'armv8-a' on AArch64. " +
@Option(help = "Generate instructions for a specific machine type. Defaults to 'x86-64-v3' on AMD64 and 'armv8.1-a' on AArch64. " +
"Use -march=" + MICRO_ARCHITECTURE_COMPATIBILITY + " for best compatibility, or -march=" + MICRO_ARCHITECTURE_NATIVE +
" for best performance if the native executable is deployed on the same machine or on a machine with the same CPU features. " +
"To list all available machine types, use -march=" + MICRO_ARCHITECTURE_LIST + ".", type = User)//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static String getSelectedOrDefaultMArch() {
} else if (Platform.includedIn(Platform.AMD64.class)) {
return CPUTypeAMD64.getDefaultName(false);
} else if (Platform.includedIn(Platform.AARCH64.class)) {
return CPUTypeAArch64.getDefaultName();
return CPUTypeAArch64.getDefaultName(false);
} else if (Platform.includedIn(Platform.RISCV64.class)) {
return CPUTypeRISCV64.getDefaultName();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import com.oracle.svm.core.option.SubstrateOptionsParser;
import com.oracle.svm.core.util.UserError;
import com.oracle.svm.hosted.NativeImageOptions;
import com.oracle.svm.util.LogUtils;
import com.oracle.svm.util.StringUtil;

import jdk.vm.ci.aarch64.AArch64;
Expand Down Expand Up @@ -113,15 +114,23 @@ public EnumSet<CPUFeature> getFeatures() {
}
}

public static String getDefaultName() {
return ARMV8_A.getName();
public static String getDefaultName(boolean printFallbackWarning) {
if (NATIVE.getFeatures().containsAll(ARMV8_1_A.getFeatures())) {
return ARMV8_1_A.getName();
} else {
if (printFallbackWarning) {
LogUtils.warning("The host machine does not support all features of '%s'. Falling back to '%s' for best compatibility.",
ARMV8_1_A.getName(), SubstrateOptionsParser.commandArgument(NativeImageOptions.MicroArchitecture, COMPATIBILITY.getName()));
}
return COMPATIBILITY.getName();
}
}

@Platforms(Platform.HOSTED_ONLY.class)
public static EnumSet<CPUFeature> getSelectedFeatures() {
String value = NativeImageOptions.MicroArchitecture.getValue();
if (value == null) {
value = getDefaultName();
value = getDefaultName(true);
}
return getCPUFeaturesForArch(value);
}
Expand Down