mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[ARM][AArch64] Adding Neoverse N2 CPU support
Add support for the Neoverse N2 CPU to the ARM and AArch64 backends. Differential Revision: https://reviews.llvm.org/D91695
This commit is contained in:
parent
2cd01b5f9c
commit
3155b4b053
@ -150,6 +150,11 @@ AARCH64_CPU_NAME("neoverse-n1", ARMV8_2A, FK_CRYPTO_NEON_FP_ARMV8, false,
|
||||
(AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
|
||||
AArch64::AEK_PROFILE | AArch64::AEK_RAS | AArch64::AEK_RCPC |
|
||||
AArch64::AEK_SSBS))
|
||||
AARCH64_CPU_NAME("neoverse-n2", ARMV8_5A, FK_CRYPTO_NEON_FP_ARMV8, false,
|
||||
(AArch64::AEK_BF16 | AArch64::AEK_DOTPROD | AArch64::AEK_FP16 |
|
||||
AArch64::AEK_I8MM | AArch64::AEK_MTE | AArch64::AEK_RAS |
|
||||
AArch64::AEK_RCPC | AArch64::AEK_SB | AArch64::AEK_SSBS |
|
||||
AArch64::AEK_SVE | AArch64::AEK_SVE2 | AArch64::AEK_SVE2BITPERM))
|
||||
AARCH64_CPU_NAME("neoverse-v1", ARMV8_4A, FK_CRYPTO_NEON_FP_ARMV8, false,
|
||||
(AArch64::AEK_RAS | AArch64::AEK_SVE | AArch64::AEK_SSBS |
|
||||
AArch64::AEK_RCPC | AArch64::AEK_FP16 | AArch64::AEK_BF16 |
|
||||
|
@ -300,6 +300,9 @@ ARM_CPU_NAME("cortex-x1", ARMV8_2A, FK_CRYPTO_NEON_FP_ARMV8, false,
|
||||
(ARM::AEK_FP16 | ARM::AEK_DOTPROD))
|
||||
ARM_CPU_NAME("neoverse-n1", ARMV8_2A, FK_CRYPTO_NEON_FP_ARMV8, false,
|
||||
(ARM::AEK_FP16 | ARM::AEK_DOTPROD))
|
||||
ARM_CPU_NAME("neoverse-n2", ARMV8_5A, FK_CRYPTO_NEON_FP_ARMV8, false,
|
||||
(ARM::AEK_BF16 | ARM::AEK_DOTPROD | ARM::AEK_I8MM | ARM::AEK_RAS |
|
||||
ARM::AEK_SB))
|
||||
ARM_CPU_NAME("neoverse-v1", ARMV8_4A, FK_CRYPTO_NEON_FP_ARMV8, false,
|
||||
(ARM::AEK_RAS | ARM::AEK_FP16 | ARM::AEK_BF16 | ARM::AEK_DOTPROD))
|
||||
ARM_CPU_NAME("cyclone", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, ARM::AEK_CRC)
|
||||
|
@ -208,6 +208,7 @@ StringRef sys::detail::getHostCPUNameForARM(StringRef ProcCpuinfoContent) {
|
||||
.Case("0xd41", "cortex-a78")
|
||||
.Case("0xd44", "cortex-x1")
|
||||
.Case("0xd0c", "neoverse-n1")
|
||||
.Case("0xd49", "neoverse-n2")
|
||||
.Default("generic");
|
||||
}
|
||||
|
||||
|
@ -903,6 +903,18 @@ def ProcNeoverseN1 : SubtargetFeature<"neoversen1", "ARMProcFamily",
|
||||
FeatureSSBS,
|
||||
]>;
|
||||
|
||||
def ProcNeoverseN2 : SubtargetFeature<"neoversen2", "ARMProcFamily",
|
||||
"NeoverseN2",
|
||||
"Neoverse N2 ARM processors", [
|
||||
HasV8_5aOps,
|
||||
FeatureBF16,
|
||||
FeatureETE,
|
||||
FeatureMatMulInt8,
|
||||
FeatureMTE,
|
||||
FeatureSVE2,
|
||||
FeatureSVE2BitPerm,
|
||||
FeatureTRBE]>;
|
||||
|
||||
def ProcNeoverseV1 : SubtargetFeature<"neoversev1", "ARMProcFamily",
|
||||
"NeoverseV1",
|
||||
"Neoverse V1 ARM processors", [
|
||||
@ -1064,6 +1076,7 @@ def : ProcessorModel<"cortex-r82", CortexA55Model, [ProcR82]>;
|
||||
def : ProcessorModel<"cortex-x1", CortexA57Model, [ProcX1]>;
|
||||
def : ProcessorModel<"neoverse-e1", CortexA53Model, [ProcNeoverseE1]>;
|
||||
def : ProcessorModel<"neoverse-n1", CortexA57Model, [ProcNeoverseN1]>;
|
||||
def : ProcessorModel<"neoverse-n2", CortexA57Model, [ProcNeoverseN2]>;
|
||||
def : ProcessorModel<"neoverse-v1", CortexA57Model, [ProcNeoverseV1]>;
|
||||
def : ProcessorModel<"exynos-m3", ExynosM3Model, [ProcExynosM3]>;
|
||||
def : ProcessorModel<"exynos-m4", ExynosM4Model, [ProcExynosM4]>;
|
||||
|
@ -151,6 +151,7 @@ void AArch64Subtarget::initializeProperties() {
|
||||
PrefFunctionLogAlignment = 3;
|
||||
break;
|
||||
case NeoverseN1:
|
||||
case NeoverseN2:
|
||||
case NeoverseV1:
|
||||
PrefFunctionLogAlignment = 4;
|
||||
break;
|
||||
|
@ -64,6 +64,7 @@ public:
|
||||
Kryo,
|
||||
NeoverseE1,
|
||||
NeoverseN1,
|
||||
NeoverseN2,
|
||||
NeoverseV1,
|
||||
Saphira,
|
||||
ThunderX2T99,
|
||||
|
@ -1299,6 +1299,11 @@ def : ProcNoItin<"neoverse-n1", [ARMv82a,
|
||||
FeatureCRC,
|
||||
FeatureDotProd]>;
|
||||
|
||||
def : ProcNoItin<"neoverse-n2", [ARMv85a,
|
||||
FeatureBF16,
|
||||
FeatureMatMulInt8,
|
||||
FeaturePerfMon]>;
|
||||
|
||||
def : ProcessorModel<"cyclone", SwiftModel, [ARMv8a, ProcSwift,
|
||||
FeatureHasRetAddrStack,
|
||||
FeatureNEONForFP,
|
||||
|
@ -314,6 +314,7 @@ void ARMSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
|
||||
PreISelOperandLatencyAdjustment = 1;
|
||||
break;
|
||||
case NeoverseN1:
|
||||
case NeoverseN2:
|
||||
case NeoverseV1:
|
||||
break;
|
||||
case Swift:
|
||||
|
@ -76,6 +76,7 @@ protected:
|
||||
Krait,
|
||||
Kryo,
|
||||
NeoverseN1,
|
||||
NeoverseN2,
|
||||
NeoverseV1,
|
||||
Swift
|
||||
};
|
||||
|
@ -20,6 +20,7 @@
|
||||
; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=cortex-x1 2>&1 | FileCheck %s
|
||||
; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=neoverse-e1 2>&1 | FileCheck %s
|
||||
; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=neoverse-n1 2>&1 | FileCheck %s
|
||||
; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=neoverse-n2 2>&1 | FileCheck %s
|
||||
; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=neoverse-v1 2>&1 | FileCheck %s
|
||||
; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=exynos-m3 2>&1 | FileCheck %s
|
||||
; RUN: llc < %s -mtriple=arm64-unknown-unknown -mcpu=exynos-m4 2>&1 | FileCheck %s
|
||||
|
@ -3,6 +3,7 @@
|
||||
; RUN: llc -mtriple aarch64-none-linux-gnu -mcpu=cortex-a65ae < %s | FileCheck %s
|
||||
; RUN: llc -mtriple aarch64-none-linux-gnu -mcpu=neoverse-e1 < %s | FileCheck %s
|
||||
; RUN: llc -mtriple aarch64-none-linux-gnu -mcpu=neoverse-n1 < %s | FileCheck %s
|
||||
; RUN: llc -mtriple aarch64-none-linux-gnu -mcpu=neoverse-n2 < %s | FileCheck %s
|
||||
|
||||
declare <2 x i32> @llvm.aarch64.neon.udot.v2i32.v8i8(<2 x i32>, <8 x i8>, <8 x i8>)
|
||||
declare <4 x i32> @llvm.aarch64.neon.udot.v4i32.v16i8(<4 x i32>, <16 x i8>, <16 x i8>)
|
||||
|
@ -13,6 +13,7 @@
|
||||
; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=cortex-x1 -o - %s | FileCheck %s
|
||||
; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=neoverse-e1 -o - %s | FileCheck %s
|
||||
; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=neoverse-n1 -o - %s | FileCheck %s
|
||||
; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=neoverse-n2 -o - %s | FileCheck %s
|
||||
; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=exynos-m3 -o - %s | FileCheck %s
|
||||
; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=exynos-m4 -o - %s | FileCheck %s
|
||||
; RUN: llc -mtriple=aarch64-linux-gnuabi -mcpu=exynos-m5 -o - %s | FileCheck %s
|
||||
|
@ -9,6 +9,7 @@
|
||||
// RUN: llvm-mc -triple aarch64 -mcpu=cortex-x1 -show-encoding < %s | FileCheck %s --check-prefix=CHECK-DOTPROD
|
||||
// RUN: llvm-mc -triple aarch64 -mcpu=neoverse-e1 -show-encoding < %s| FileCheck %s --check-prefix=CHECK-DOTPROD
|
||||
// RUN: llvm-mc -triple aarch64 -mcpu=neoverse-n1 -show-encoding < %s| FileCheck %s --check-prefix=CHECK-DOTPROD
|
||||
// RUN: llvm-mc -triple aarch64 -mcpu=neoverse-n2 -show-encoding < %s| FileCheck %s --check-prefix=CHECK-DOTPROD
|
||||
// RUN: llvm-mc -triple aarch64 -mcpu=tsv110 -show-encoding < %s | FileCheck %s --check-prefix=CHECK-DOTPROD
|
||||
|
||||
// RUN: not llvm-mc -triple aarch64 -mattr=+v8.2a -show-encoding < %s 2> %t
|
||||
@ -27,6 +28,8 @@
|
||||
// RUN: FileCheck --check-prefix=CHECK-NO-DOTPROD < %t %s
|
||||
// RUN: not llvm-mc -triple aarch64 -mcpu=neoverse-n1 -mattr=-dotprod -show-encoding < %s 2> %t
|
||||
// RUN: FileCheck --check-prefix=CHECK-NO-DOTPROD < %t %s
|
||||
// RUN: not llvm-mc -triple aarch64 -mcpu=neoverse-n2 -mattr=-dotprod -show-encoding < %s 2> %t
|
||||
// RUN: FileCheck --check-prefix=CHECK-NO-DOTPROD < %t %s
|
||||
|
||||
udot v0.2s, v1.8b, v2.8b
|
||||
sdot v0.2s, v1.8b, v2.8b
|
||||
|
@ -5,6 +5,7 @@
|
||||
// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mcpu=cortex-a55 < %s 2>&1 | FileCheck %s
|
||||
// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mcpu=neoverse-e1 < %s 2>&1 | FileCheck %s
|
||||
// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mcpu=neoverse-n1 < %s 2>&1 | FileCheck %s
|
||||
// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mcpu=neoverse-n2 < %s 2>&1 | FileCheck %s
|
||||
// RUN: llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=+v8.2a -mattr=+rcpc < %s 2>&1 | FileCheck %s
|
||||
// RUN: not llvm-mc -triple aarch64-none-linux-gnu -mattr=+v8.2a < %s 2> %t
|
||||
// RUN: FileCheck --check-prefix=CHECK-REQ %s < %t
|
||||
|
@ -6,6 +6,7 @@
|
||||
// RUN: llvm-mc -triple aarch64 -show-encoding -mcpu=cortex-a76ae < %s | FileCheck %s
|
||||
// RUN: llvm-mc -triple aarch64 -show-encoding -mcpu=neoverse-e1 < %s | FileCheck %s
|
||||
// RUN: llvm-mc -triple aarch64 -show-encoding -mcpu=neoverse-n1 < %s | FileCheck %s
|
||||
// RUN: llvm-mc -triple aarch64 -show-encoding -mcpu=neoverse-n2 < %s | FileCheck %s
|
||||
// RUN: not llvm-mc -triple aarch64 -show-encoding -mattr=-ssbs < %s 2>&1 | FileCheck %s --check-prefix=NOSPECID
|
||||
|
||||
mrs x2, SSBS
|
||||
|
@ -3,6 +3,7 @@
|
||||
// RUN: llvm-mc -triple arm -mcpu=cortex-a75 -show-encoding < %s | FileCheck %s --check-prefix=CHECK
|
||||
// RUN: llvm-mc -triple arm -mcpu=cortex-a76 -show-encoding < %s | FileCheck %s --check-prefix=CHECK
|
||||
// RUN: llvm-mc -triple arm -mcpu=neoverse-n1 -show-encoding < %s | FileCheck %s --check-prefix=CHECK
|
||||
// RUN: llvm-mc -triple arm -mcpu=neoverse-n2 -show-encoding < %s | FileCheck %s --check-prefix=CHECK
|
||||
// RUN: llvm-mc -triple arm -mcpu=cortex-a77 -show-encoding < %s | FileCheck %s --check-prefix=CHECK
|
||||
// RUN: llvm-mc -triple arm -mcpu=cortex-a78 -show-encoding < %s | FileCheck %s --check-prefix=CHECK
|
||||
// RUN: llvm-mc -triple arm -mcpu=cortex-x1 -show-encoding < %s | FileCheck %s --check-prefix=CHECK
|
||||
|
@ -6,6 +6,7 @@
|
||||
// RUN: llvm-mc -triple thumb -mcpu=cortex-a78 -show-encoding < %s | FileCheck %s --check-prefix=CHECK
|
||||
// RUN: llvm-mc -triple thumb -mcpu=cortex-x1 -show-encoding < %s | FileCheck %s --check-prefix=CHECK
|
||||
// RUN: llvm-mc -triple thumb -mcpu=neoverse-n1 -show-encoding < %s | FileCheck %s --check-prefix=CHECK
|
||||
// RUN: llvm-mc -triple thumb -mcpu=neoverse-n2 -show-encoding < %s | FileCheck %s --check-prefix=CHECK
|
||||
|
||||
// RUN: not llvm-mc -triple thumb -mattr=-dotprod -show-encoding < %s 2> %t
|
||||
// RUN: FileCheck --check-prefix=CHECK-ERROR < %t %s
|
||||
|
@ -9,6 +9,7 @@
|
||||
# RUN: llvm-mc -triple aarch64-none-linux-gnu -mcpu=cortex-x1 --disassemble < %s | FileCheck %s
|
||||
# RUN: llvm-mc -triple aarch64-none-linux-gnu -mcpu=neoverse-e1 --disassemble < %s | FileCheck %s
|
||||
# RUN: llvm-mc -triple aarch64-none-linux-gnu -mcpu=neoverse-n1 --disassemble < %s | FileCheck %s
|
||||
# RUN: llvm-mc -triple aarch64-none-linux-gnu -mcpu=neoverse-n2 --disassemble < %s | FileCheck %s
|
||||
|
||||
# CHECK: ldaprb w0, [x0]
|
||||
# CHECK: ldaprh w0, [x0]
|
||||
|
@ -280,6 +280,12 @@ TEST(TargetParserTest, testARMCPU) {
|
||||
ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_FP16 |
|
||||
ARM::AEK_RAS | ARM::AEK_DOTPROD,
|
||||
"8.2-A"));
|
||||
EXPECT_TRUE(testARMCPU("neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
|
||||
ARM::AEK_CRC | ARM::AEK_HWDIVTHUMB | ARM::AEK_HWDIVARM |
|
||||
ARM::AEK_MP | ARM::AEK_SEC | ARM::AEK_VIRT |
|
||||
ARM::AEK_DSP | ARM::AEK_BF16 | ARM::AEK_DOTPROD |
|
||||
ARM::AEK_RAS | ARM::AEK_I8MM | ARM::AEK_SB,
|
||||
"8.5-A"));
|
||||
EXPECT_TRUE(testARMCPU("neoverse-v1", "armv8.4-a", "crypto-neon-fp-armv8",
|
||||
ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
|
||||
ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB |
|
||||
@ -328,7 +334,7 @@ TEST(TargetParserTest, testARMCPU) {
|
||||
"7-S"));
|
||||
}
|
||||
|
||||
static constexpr unsigned NumARMCPUArchs = 90;
|
||||
static constexpr unsigned NumARMCPUArchs = 91;
|
||||
|
||||
TEST(TargetParserTest, testARMCPUArchList) {
|
||||
SmallVector<StringRef, NumARMCPUArchs> List;
|
||||
@ -996,6 +1002,15 @@ TEST(TargetParserTest, testAArch64CPU) {
|
||||
AArch64::AEK_PROFILE | AArch64::AEK_RAS | AArch64::AEK_RCPC |
|
||||
AArch64::AEK_RDM | AArch64::AEK_SIMD | AArch64::AEK_SSBS,
|
||||
"8.2-A"));
|
||||
EXPECT_TRUE(testAArch64CPU(
|
||||
"neoverse-n2", "armv8.5-a", "crypto-neon-fp-armv8",
|
||||
AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP |
|
||||
AArch64::AEK_SIMD | AArch64::AEK_FP16 | AArch64::AEK_RAS |
|
||||
AArch64::AEK_LSE | AArch64::AEK_SVE | AArch64::AEK_DOTPROD |
|
||||
AArch64::AEK_RCPC | AArch64::AEK_RDM | AArch64::AEK_MTE |
|
||||
AArch64::AEK_SSBS | AArch64::AEK_SB | AArch64::AEK_SVE2 |
|
||||
AArch64::AEK_SVE2BITPERM | AArch64::AEK_BF16 | AArch64::AEK_I8MM,
|
||||
"8.5-A"));
|
||||
EXPECT_TRUE(testAArch64CPU(
|
||||
"thunderx2t99", "armv8.1-a", "crypto-neon-fp-armv8",
|
||||
AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_LSE |
|
||||
@ -1048,7 +1063,7 @@ TEST(TargetParserTest, testAArch64CPU) {
|
||||
"8.2-A"));
|
||||
}
|
||||
|
||||
static constexpr unsigned NumAArch64CPUArchs = 44;
|
||||
static constexpr unsigned NumAArch64CPUArchs = 45;
|
||||
|
||||
TEST(TargetParserTest, testAArch64CPUArchList) {
|
||||
SmallVector<StringRef, NumAArch64CPUArchs> List;
|
||||
|
Loading…
x
Reference in New Issue
Block a user