From 6325710782b295bc09373df15b0305508f3ca89f Mon Sep 17 00:00:00 2001 From: Evgeny Astigeevich <42899633+eastig@users.noreply.github.com> Date: Wed, 13 Dec 2023 22:19:08 +0000 Subject: [PATCH] 8321025: Enable Neoverse N1 optimizations for Neoverse V2 (#33) Backport of openjdk/jdk@c9d15f7 It also backports VM_Version::model_is from openjdk/jdk@3283328 (8311130: AArch64: Sync SVE related CPU features with VM options) --- src/hotspot/cpu/aarch64/vm_version_aarch64.cpp | 7 +++---- src/hotspot/cpu/aarch64/vm_version_aarch64.hpp | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp index f33e64b3af0..9310c836785 100644 --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp @@ -205,10 +205,9 @@ void VM_Version::initialize() { } } - // Neoverse N1, N2 and V1 - if (_cpu == CPU_ARM && ((_model == 0xd0c || _model2 == 0xd0c) - || (_model == 0xd49 || _model2 == 0xd49) - || (_model == 0xd40 || _model2 == 0xd40))) { + // Neoverse N1, N2, V1, V2 + if (_cpu == CPU_ARM && (model_is(0xd0c) || model_is(0xd49) || + model_is(0xd40) || model_is(0xd4f))) { if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) { FLAG_SET_DEFAULT(UseSIMDForMemoryOps, true); } diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp index a141127387e..8b67a207cf9 100644 --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp @@ -151,6 +151,10 @@ enum Ampere_CPU_Model { static int cpu_variant() { return _variant; } static int cpu_revision() { return _revision; } + static bool model_is(int cpu_model) { + return _model == cpu_model || _model2 == cpu_model; + } + static bool is_zva_enabled() { return 0 <= _zva_length; } static int zva_length() { assert(is_zva_enabled(), "ZVA not available");