[llvm] r340012 - [ARM/AArch64] TargetParserTest fixes
Bernard Ogden via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 17 04:26:57 PDT 2018
Author: bogden
Date: Fri Aug 17 04:26:57 2018
New Revision: 340012
URL: http://llvm.org/viewvc/llvm-project?rev=340012&view=rev
Log:
[ARM/AArch64] TargetParserTest fixes
Adds some missing tests for the FP16 extension,
fixes an existing test that misnames it.
Differential Revision: https://reviews.llvm.org/D50227
Modified:
llvm/trunk/unittests/Support/TargetParserTest.cpp
Modified: llvm/trunk/unittests/Support/TargetParserTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/TargetParserTest.cpp?rev=340012&r1=340011&r2=340012&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/TargetParserTest.cpp (original)
+++ llvm/trunk/unittests/Support/TargetParserTest.cpp Fri Aug 17 04:26:57 2018
@@ -444,6 +444,12 @@ TEST(TargetParserTest, testARMExtension)
ARM::ArchKind::INVALID, "crypto"));
EXPECT_FALSE(testARMExtension("cortex-a53",
ARM::ArchKind::INVALID, "ras"));
+ EXPECT_FALSE(testARMExtension("cortex-a53",
+ ARM::ArchKind::INVALID, "fp16"));
+ EXPECT_TRUE(testARMExtension("cortex-a55",
+ ARM::ArchKind::INVALID, "fp16"));
+ EXPECT_TRUE(testARMExtension("cortex-a75",
+ ARM::ArchKind::INVALID, "fp16"));
EXPECT_FALSE(testARMExtension("cortex-r52",
ARM::ArchKind::INVALID, "ras"));
EXPECT_FALSE(testARMExtension("iwmmxt", ARM::ArchKind::INVALID, "crc"));
@@ -474,6 +480,9 @@ TEST(TargetParserTest, testARMExtension)
EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8A, "ras"));
EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_1A, "ras"));
EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_2A, "spe"));
+ EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_2A, "fp16"));
+ EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_3A, "fp16"));
+ EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8_4A, "fp16"));
EXPECT_FALSE(testARMExtension("generic", ARM::ArchKind::ARMV8R, "ras"));
EXPECT_FALSE(testARMExtension("generic",
ARM::ArchKind::ARMV8MBaseline, "crc"));
@@ -527,7 +536,7 @@ TEST(TargetParserTest, ARMExtensionFeatu
std::vector<StringRef> Features;
unsigned Extensions = ARM::AEK_CRC | ARM::AEK_CRYPTO | ARM::AEK_DSP |
ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_MP |
- ARM::AEK_SEC | ARM::AEK_VIRT | ARM::AEK_RAS;
+ ARM::AEK_SEC | ARM::AEK_VIRT | ARM::AEK_RAS | ARM::AEK_FP16;
for (unsigned i = 0; i <= Extensions; i++)
EXPECT_TRUE(i == 0 ? !ARM::getExtensionFeatures(i, Features)
@@ -852,7 +861,11 @@ TEST(TargetParserTest, testAArch64Extens
EXPECT_TRUE(testAArch64Extension("saphira",
AArch64::ArchKind::INVALID, "profile"));
EXPECT_FALSE(testAArch64Extension("saphira",
- AArch64::ArchKind::INVALID, "fullfp16"));
+ AArch64::ArchKind::INVALID, "fp16"));
+ EXPECT_TRUE(testAArch64Extension("cortex-a55",
+ AArch64::ArchKind::INVALID, "fp16"));
+ EXPECT_TRUE(testAArch64Extension("cortex-a75",
+ AArch64::ArchKind::INVALID, "fp16"));
EXPECT_FALSE(testAArch64Extension("thunderx2t99",
AArch64::ArchKind::INVALID, "ras"));
EXPECT_FALSE(testAArch64Extension("thunderx",
@@ -870,6 +883,12 @@ TEST(TargetParserTest, testAArch64Extens
"generic", AArch64::ArchKind::ARMV8_1A, "ras"));
EXPECT_FALSE(testAArch64Extension(
"generic", AArch64::ArchKind::ARMV8_2A, "spe"));
+ EXPECT_FALSE(testAArch64Extension(
+ "generic", AArch64::ArchKind::ARMV8_2A, "fp16"));
+ EXPECT_FALSE(testAArch64Extension(
+ "generic", AArch64::ArchKind::ARMV8_3A, "fp16"));
+ EXPECT_FALSE(testAArch64Extension(
+ "generic", AArch64::ArchKind::ARMV8_4A, "fp16"));
}
TEST(TargetParserTest, AArch64ExtensionFeatures) {
More information about the llvm-commits
mailing list