Search in sources :

Example 1 with SubstrateTargetDescription

use of com.oracle.svm.core.graal.meta.SubstrateTargetDescription in project graal by oracle.

the class NativeImageGenerator method createTarget.

public static TargetDescription createTarget(Platform platform) {
    if (includedIn(platform, Platform.AMD64.class)) {
        Architecture architecture;
        if (NativeImageOptions.NativeArchitecture.getValue()) {
            architecture = GraalAccess.getOriginalTarget().arch;
        } else {
            EnumSet<AMD64.CPUFeature> features = EnumSet.noneOf(AMD64.CPUFeature.class);
            // SSE and SSE2 are added by defaults as they are required by Graal
            features.add(AMD64.CPUFeature.SSE);
            features.add(AMD64.CPUFeature.SSE2);
            features.addAll(parseCSVtoEnum(AMD64.CPUFeature.class, NativeImageOptions.CPUFeatures.getValue()));
            architecture = new AMD64(features, SubstrateTargetDescription.allFlags());
        }
        assert architecture instanceof AMD64 : "SVM supports only AMD64 architectures.";
        return new SubstrateTargetDescription(architecture, true, 16, 0, false);
    } else {
        throw UserError.abort("Architecture specified by platform is not supported: " + platform.getClass().getTypeName());
    }
}
Also used : AMD64(jdk.vm.ci.amd64.AMD64) Platform(org.graalvm.nativeimage.Platform) Architecture(jdk.vm.ci.code.Architecture) SubstrateTargetDescription(com.oracle.svm.core.graal.meta.SubstrateTargetDescription)

Aggregations

SubstrateTargetDescription (com.oracle.svm.core.graal.meta.SubstrateTargetDescription)1 AMD64 (jdk.vm.ci.amd64.AMD64)1 Architecture (jdk.vm.ci.code.Architecture)1 Platform (org.graalvm.nativeimage.Platform)1