From 27571534e89eab0a41f24953bbfcbbc17f3e0c5b Mon Sep 17 00:00:00 2001 From: Evgeny Astigeevich Date: Wed, 13 Dec 2023 15:49:13 +0000 Subject: [PATCH] 8321025: Enable Neoverse N1 optimizations for Neoverse V2 Backport of OpenJDK commit c9d15f7d5ee616bf48d85647ee504714ac5fafc2 --- 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");