From 7cfbd6d75fe99cc504c0d6d737c60e05273b7adb Mon Sep 17 00:00:00 2001 From: Evandro Menezes Date: Fri, 11 Jan 2019 18:54:25 +0000 Subject: [PATCH] [AArch64] Create feature set for Exynos M4 Complete the feature set for Exynos M4 and update test cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350953 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/AArch64TargetParser.def | 4 ++-- include/llvm/Support/ARMTargetParser.def | 3 ++- lib/Target/AArch64/AArch64.td | 21 +++++++++++++++- lib/Target/ARM/ARM.td | 3 +++ test/CodeGen/ARM/build-attributes.ll | 2 +- unittests/Support/TargetParserTest.cpp | 25 ++++++++++++++------ 6 files changed, 46 insertions(+), 12 deletions(-) diff --git a/include/llvm/Support/AArch64TargetParser.def b/include/llvm/Support/AArch64TargetParser.def index f1fcb83d379..e03297b7c3c 100644 --- a/include/llvm/Support/AArch64TargetParser.def +++ b/include/llvm/Support/AArch64TargetParser.def @@ -102,8 +102,8 @@ AARCH64_CPU_NAME("exynos-m2", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, (AArch64::AEK_CRC)) AARCH64_CPU_NAME("exynos-m3", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, (AArch64::AEK_CRC)) -AARCH64_CPU_NAME("exynos-m4", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, - (AArch64::AEK_CRC)) +AARCH64_CPU_NAME("exynos-m4", ARMV8_2A, FK_CRYPTO_NEON_FP_ARMV8, false, + (AArch64::AEK_FP16 | AArch64::AEK_DOTPROD)) AARCH64_CPU_NAME("falkor", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, (AArch64::AEK_CRC | AArch64::AEK_RDM)) AARCH64_CPU_NAME("saphira", ARMV8_3A, FK_CRYPTO_NEON_FP_ARMV8, false, diff --git a/include/llvm/Support/ARMTargetParser.def b/include/llvm/Support/ARMTargetParser.def index e954ac4e2eb..9e844e2b464 100644 --- a/include/llvm/Support/ARMTargetParser.def +++ b/include/llvm/Support/ARMTargetParser.def @@ -266,7 +266,8 @@ ARM_CPU_NAME("cyclone", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, ARM::AEK_CRC) ARM_CPU_NAME("exynos-m1", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, ARM::AEK_CRC) ARM_CPU_NAME("exynos-m2", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, ARM::AEK_CRC) ARM_CPU_NAME("exynos-m3", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, ARM::AEK_CRC) -ARM_CPU_NAME("exynos-m4", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, ARM::AEK_CRC) +ARM_CPU_NAME("exynos-m4", ARMV8_2A, FK_CRYPTO_NEON_FP_ARMV8, false, + (ARM::AEK_FP16 | ARM::AEK_DOTPROD)) ARM_CPU_NAME("kryo", ARMV8A, FK_CRYPTO_NEON_FP_ARMV8, false, ARM::AEK_CRC) // Non-standard Arch names. ARM_CPU_NAME("iwmmxt", IWMMXT, FK_NONE, true, ARM::AEK_NONE) diff --git a/lib/Target/AArch64/AArch64.td b/lib/Target/AArch64/AArch64.td index 03d28303a2f..c0c710c6d0c 100644 --- a/lib/Target/AArch64/AArch64.td +++ b/lib/Target/AArch64/AArch64.td @@ -540,6 +540,25 @@ def ProcExynosM3 : SubtargetFeature<"exynosm3", "ARMProcFamily", "ExynosM3", FeaturePredictableSelectIsExpensive, FeatureZCZeroingFP]>; +def ProcExynosM4 : SubtargetFeature<"exynosm4", "ARMProcFamily", "ExynosM3", + "Samsung Exynos-M4 processors", + [HasV8_2aOps, + FeatureArithmeticBccFusion, + FeatureArithmeticCbzFusion, + FeatureCrypto, + FeatureDotProd, + FeatureExynosCheapAsMoveHandling, + FeatureForce32BitJumpTables, + FeatureFP16FML, + FeatureFuseAddress, + FeatureFuseAES, + FeatureFuseCCSelect, + FeatureFuseLiterals, + FeatureLSLFast, + FeaturePerfMon, + FeaturePostRAScheduler, + FeatureZCZeroing]>; + def ProcKryo : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo", "Qualcomm Kryo processors", [ FeatureCRC, @@ -677,7 +696,7 @@ def : ProcessorModel<"cyclone", CycloneModel, [ProcCyclone]>; def : ProcessorModel<"exynos-m1", ExynosM1Model, [ProcExynosM1]>; def : ProcessorModel<"exynos-m2", ExynosM1Model, [ProcExynosM2]>; def : ProcessorModel<"exynos-m3", ExynosM3Model, [ProcExynosM3]>; -def : ProcessorModel<"exynos-m4", ExynosM3Model, [ProcExynosM3]>; +def : ProcessorModel<"exynos-m4", ExynosM3Model, [ProcExynosM4]>; def : ProcessorModel<"falkor", FalkorModel, [ProcFalkor]>; def : ProcessorModel<"saphira", FalkorModel, [ProcSaphira]>; def : ProcessorModel<"kryo", KryoModel, [ProcKryo]>; diff --git a/lib/Target/ARM/ARM.td b/lib/Target/ARM/ARM.td index 781d613d041..5d5b4c85c7c 100644 --- a/lib/Target/ARM/ARM.td +++ b/lib/Target/ARM/ARM.td @@ -1079,6 +1079,9 @@ def : ProcNoItin<"exynos-m1", [ARMv8a, ProcExynos]>; def : ProcNoItin<"exynos-m2", [ARMv8a, ProcExynos]>; def : ProcNoItin<"exynos-m3", [ARMv8a, ProcExynos]>; def : ProcNoItin<"exynos-m4", [ARMv8a, ProcExynos]>; +def : ProcNoItin<"exynos-m4", [ARMv82a, ProcExynos, + FeatureFullFP16, + FeatureDotProd]>; def : ProcNoItin<"kryo", [ARMv8a, ProcKryo, FeatureHWDivThumb, diff --git a/test/CodeGen/ARM/build-attributes.ll b/test/CodeGen/ARM/build-attributes.ll index 3d0c9419e8f..c7301d21108 100644 --- a/test/CodeGen/ARM/build-attributes.ll +++ b/test/CodeGen/ARM/build-attributes.ll @@ -1623,7 +1623,7 @@ ; EXYNOS-M4: .eabi_attribute 8, 1 ; EXYNOS-M4: .eabi_attribute 9, 2 ; EXYNOS-M4: .fpu crypto-neon-fp-armv8 -; EXYNOS-M4: .eabi_attribute 12, 3 +; EXYNOS-M4: .eabi_attribute 12, 4 ; EXYNOS-M4-NOT: .eabi_attribute 27 ; EXYNOS-M4: .eabi_attribute 36, 1 ; EXYNOS-M4: .eabi_attribute 42, 1 diff --git a/unittests/Support/TargetParserTest.cpp b/unittests/Support/TargetParserTest.cpp index 28e995eae6b..18bbb6a2103 100644 --- a/unittests/Support/TargetParserTest.cpp +++ b/unittests/Support/TargetParserTest.cpp @@ -265,11 +265,12 @@ TEST(TargetParserTest, testARMCPU) { ARM::AEK_VIRT | ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, "8-A")); - EXPECT_TRUE(testARMCPU("exynos-m4", "armv8-a", "crypto-neon-fp-armv8", + EXPECT_TRUE(testARMCPU("exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8", ARM::AEK_CRC | ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT | ARM::AEK_HWDIVARM | - ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP, - "8-A")); + ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP | ARM::AEK_DOTPROD | + ARM::AEK_FP16 | ARM::AEK_RAS, + "8.2-A")); EXPECT_TRUE(testARMCPU("cortex-m23", "armv8-m.base", "none", ARM::AEK_HWDIVTHUMB, "8-M.Baseline")); EXPECT_TRUE(testARMCPU("cortex-m33", "armv8-m.main", "fpv5-sp-d16", @@ -759,9 +760,11 @@ TEST(TargetParserTest, testAArch64CPU) { AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | AArch64::AEK_SIMD, "8-A")); EXPECT_TRUE(testAArch64CPU( - "exynos-m4", "armv8-a", "crypto-neon-fp-armv8", - AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | - AArch64::AEK_SIMD, "8-A")); + "exynos-m4", "armv8.2-a", "crypto-neon-fp-armv8", + AArch64::AEK_CRC | AArch64::AEK_CRYPTO | + AArch64::AEK_DOTPROD | AArch64::AEK_FP | AArch64::AEK_FP16 | + AArch64::AEK_LSE | AArch64::AEK_RAS | AArch64::AEK_RDM | + AArch64::AEK_SIMD, "8.2-A")); EXPECT_TRUE(testAArch64CPU( "falkor", "armv8-a", "crypto-neon-fp-armv8", AArch64::AEK_CRC | AArch64::AEK_CRYPTO | AArch64::AEK_FP | @@ -870,8 +873,16 @@ TEST(TargetParserTest, testAArch64Extension) { AArch64::ArchKind::INVALID, "ras")); EXPECT_FALSE(testAArch64Extension("exynos-m3", AArch64::ArchKind::INVALID, "ras")); + EXPECT_TRUE(testAArch64Extension("exynos-m4", + AArch64::ArchKind::INVALID, "lse")); + EXPECT_TRUE(testAArch64Extension("exynos-m4", + AArch64::ArchKind::INVALID, "rdm")); + EXPECT_TRUE(testAArch64Extension("exynos-m4", + AArch64::ArchKind::INVALID, "ras")); EXPECT_FALSE(testAArch64Extension("exynos-m4", - AArch64::ArchKind::INVALID, "ras")); + AArch64::ArchKind::INVALID, "fullfp16")); + EXPECT_TRUE(testAArch64Extension("exynos-m4", + AArch64::ArchKind::INVALID, "dotprod")); EXPECT_TRUE(testAArch64Extension("falkor", AArch64::ArchKind::INVALID, "rdm")); EXPECT_FALSE(testAArch64Extension("kryo", -- 2.40.0