[aarch64-port-dev ] Aarch64: CPU_Model support for Neoverse N1/N2/V1/V2
Jin Guojie
jinguojie.jgj at alibaba-inc.com
Thu Apr 18 02:29:40 UTC 2024
Hi Andrew,
We wrote a patch to improve the definition of CPU models for Arm Neoverse.
Evgeny thinks it’s better to continue the review process.
I submitted my OCA application 10 days ago, but it is still under review.
Could you please create an issue in the JDK Bug System (JBS),
so that I can submit this PR after the OCA is signed?
Jin Guojie (Alibaba,hotspot developer)
2024/4/18 02:32. Astigeevich, Evgeny <eastig at amazon.co.uk> wrote:
> I agree using enums will improve readability.
> It's not been done to simplify backporting.
> Could you please create a JBS issue and submit a PR?
> Evgeny
> On 12/04/2024, 09:22, "Jin Guojie" <jinguojie.jgj at alibaba-inc.com <mailto:jinguojie.jgj at alibaba-inc.com>> wrote:
> Hi Evgeny,
> Thanks for your great work in "8321025: Enable Neoverse N1 optimizations for Neoverse V2”.
> I am currently optimizing the Aarch64 branch of hotspot. I found that there are also some constant numbers in this file vm_version_aarch64.cpp.
> In order to make the programming style better, wouldn't it be better if we define these constants as macros?
> Below is the code patch I wrote. Thank you for your opinion.
>
> Jin Guojie
>
>
> From 2dd99c9851b0efbb3c9a8bdc95973f4646ad77c2 Mon Sep 17 00:00:00 2001From: Jin Guojie <jinguojie.jgj at alibaba-inc.com <mailto:jinguojie.jgj at alibaba-inc.com>>
> Date: Tue, 2 Apr 2024 09:06:04 +0800
> Subject: CPU_Model support for Neoverse N1/N2/V1/V2
> ---
> src/hotspot/cpu/aarch64/vm_version_aarch64.cpp | 12 +++---------
> src/hotspot/cpu/aarch64/vm_version_aarch64.hpp | 7 +++++++
> 2 files changed, 10 insertions(+), 9 deletions(-)
> diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
> index 18f310c746c..732020a420f 100644
> --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
> +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
> @@ -213,12 +213,8 @@ void VM_Version::initialize() {
> }
>
>
> // Neoverse
> - // N1: 0xd0c
> - // N2: 0xd49
> - // V1: 0xd40
> - // V2: 0xd4f
> - if (_cpu == CPU_ARM && (model_is(0xd0c) || model_is(0xd49) ||
> - model_is(0xd40) || model_is(0xd4f))) {
> + if (_cpu == CPU_ARM && (model_is(CPU_MODEL_NEOVERSE_N1) || model_is(CPU_MODEL_NEOVERSE_N2) ||
> + model_is(CPU_MODEL_NEOVERSE_V1) || model_is(CPU_MODEL_NEOVERSE_V2))) {
> if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) {
> FLAG_SET_DEFAULT(UseSIMDForMemoryOps, true);
> }
> @@ -248,9 +244,7 @@ void VM_Version::initialize() {
> }
>
> // Neoverse
> - // V1: 0xd40
> - // V2: 0xd4f
> - if (_cpu == CPU_ARM && (model_is(0xd40) || model_is(0xd4f))) {
> + if (_cpu == CPU_ARM && (model_is(CPU_MODEL_NEOVERSE_V1) || model_is(CPU_MODEL_NEOVERSE_V2))) {
> if (FLAG_IS_DEFAULT(UseCryptoPmullForCRC32)) {
> FLAG_SET_DEFAULT(UseCryptoPmullForCRC32, true);
> }
> diff --git a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
> index 6883dc0d93e..a9821ea50c4 100644
> --- a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
> +++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
> @@ -114,6 +114,13 @@ enum Ampere_CPU_Model {
> CPU_MODEL_AMPERE_1B = 0xac5 /* AMPERE_1B core Implements ARMv8.7 with CSSC, MTE, SM3/SM4 extensions */
> };
>
> +enum Neoverse_CPU_Model {
> + CPU_MODEL_NEOVERSE_N1 = 0xd0c,
> + CPU_MODEL_NEOVERSE_N2 = 0xd49,
> + CPU_MODEL_NEOVERSE_V1 = 0xd40,
> + CPU_MODEL_NEOVERSE_V2 = 0xd4f,
> +};
> +
> #define CPU_FEATURE_FLAGS(decl) \
> decl(FP, fp, 0) \
> decl(ASIMD, asimd, 1) \
> --
> 2.39.3
Amazon Development Centre (London) Ltd. Registered in England and Wales with registration number 04543232 with its registered office at 1 Principal Place, Worship Street, London EC2A 2FA, United Kingdom.
More information about the aarch64-port-dev
mailing list