forked from OSchip/llvm-project
[AArch64] Add an SVE target feature to the backend and TargetParser.
The feature will be used properly once assembler/disassembler support begins to land. llvm-svn: 307917
This commit is contained in:
parent
c9dcaaae69
commit
9f3a245e76
|
@ -43,8 +43,9 @@ AARCH64_ARCH_EXT_NAME("crypto", AArch64::AEK_CRYPTO, "+crypto","-crypto")
|
|||
AARCH64_ARCH_EXT_NAME("fp", AArch64::AEK_FP, "+fp-armv8", "-fp-armv8")
|
||||
AARCH64_ARCH_EXT_NAME("simd", AArch64::AEK_SIMD, "+neon", "-neon")
|
||||
AARCH64_ARCH_EXT_NAME("fp16", AArch64::AEK_FP16, "+fullfp16", "-fullfp16")
|
||||
AARCH64_ARCH_EXT_NAME("profile", AArch64::AEK_PROFILE, "+spe", "-spe")
|
||||
AARCH64_ARCH_EXT_NAME("ras", AArch64::AEK_RAS, "+ras", "-ras")
|
||||
AARCH64_ARCH_EXT_NAME("profile", AArch64::AEK_PROFILE, "+spe", "-spe")
|
||||
AARCH64_ARCH_EXT_NAME("ras", AArch64::AEK_RAS, "+ras", "-ras")
|
||||
AARCH64_ARCH_EXT_NAME("sve", AArch64::AEK_SVE, "+sve", "-sve")
|
||||
#undef AARCH64_ARCH_EXT_NAME
|
||||
|
||||
#ifndef AARCH64_CPU_NAME
|
||||
|
|
|
@ -85,6 +85,7 @@ enum ArchExtKind : unsigned {
|
|||
AEK_DSP = 0x400,
|
||||
AEK_FP16 = 0x800,
|
||||
AEK_RAS = 0x1000,
|
||||
AEK_SVE = 0x2000,
|
||||
// Unsupported extensions.
|
||||
AEK_OS = 0x8000000,
|
||||
AEK_IWMMXT = 0x10000000,
|
||||
|
@ -166,7 +167,8 @@ enum ArchExtKind : unsigned {
|
|||
AEK_FP16 = 0x20,
|
||||
AEK_PROFILE = 0x40,
|
||||
AEK_RAS = 0x80,
|
||||
AEK_LSE = 0x100
|
||||
AEK_LSE = 0x100,
|
||||
AEK_SVE = 0x200
|
||||
};
|
||||
|
||||
StringRef getCanonicalArchName(StringRef Arch);
|
||||
|
|
|
@ -452,6 +452,8 @@ bool llvm::AArch64::getExtensionFeatures(unsigned Extensions,
|
|||
Features.push_back("+ras");
|
||||
if (Extensions & AArch64::AEK_LSE)
|
||||
Features.push_back("+lse");
|
||||
if (Extensions & AArch64::AEK_SVE)
|
||||
Features.push_back("+sve");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -50,6 +50,9 @@ def FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true",
|
|||
def FeatureSPE : SubtargetFeature<"spe", "HasSPE", "true",
|
||||
"Enable Statistical Profiling extension">;
|
||||
|
||||
def FeatureSVE : SubtargetFeature<"sve", "HasSVE", "true",
|
||||
"Enable Scalable Vector Extension (SVE) instructions">;
|
||||
|
||||
/// Cyclone has register move instructions which are "free".
|
||||
def FeatureZCRegMove : SubtargetFeature<"zcm", "HasZeroCycleRegMove", "true",
|
||||
"Has zero-cycle register moves">;
|
||||
|
|
|
@ -37,6 +37,8 @@ def HasFullFP16 : Predicate<"Subtarget->hasFullFP16()">,
|
|||
AssemblerPredicate<"FeatureFullFP16", "fullfp16">;
|
||||
def HasSPE : Predicate<"Subtarget->hasSPE()">,
|
||||
AssemblerPredicate<"FeatureSPE", "spe">;
|
||||
def HasSVE : Predicate<"Subtarget->hasSVE()">,
|
||||
AssemblerPredicate<"FeatureSVE", "sve">;
|
||||
|
||||
def IsLE : Predicate<"Subtarget->isLittleEndian()">;
|
||||
def IsBE : Predicate<"!Subtarget->isLittleEndian()">;
|
||||
|
|
|
@ -70,6 +70,7 @@ protected:
|
|||
bool HasFullFP16 = false;
|
||||
bool HasSPE = false;
|
||||
bool HasLSLFast = false;
|
||||
bool HasSVE = false;
|
||||
|
||||
// HasZeroCycleRegMove - Has zero-cycle register mov instructions.
|
||||
bool HasZeroCycleRegMove = false;
|
||||
|
@ -251,6 +252,7 @@ public:
|
|||
bool hasFullFP16() const { return HasFullFP16; }
|
||||
bool hasSPE() const { return HasSPE; }
|
||||
bool hasLSLFast() const { return HasLSLFast; }
|
||||
bool hasSVE() const { return HasSVE; }
|
||||
|
||||
bool isLittleEndian() const { return IsLittle; }
|
||||
|
||||
|
|
|
@ -737,7 +737,7 @@ TEST(TargetParserTest, AArch64ExtensionFeatures) {
|
|||
unsigned Extensions = AArch64::AEK_CRC | AArch64::AEK_CRYPTO |
|
||||
AArch64::AEK_FP | AArch64::AEK_SIMD |
|
||||
AArch64::AEK_FP16 | AArch64::AEK_PROFILE |
|
||||
AArch64::AEK_RAS;
|
||||
AArch64::AEK_RAS | AArch64::AEK_SVE;
|
||||
|
||||
for (unsigned i = 0; i <= Extensions; i++)
|
||||
EXPECT_TRUE(i == 0 ? !AArch64::getExtensionFeatures(i, Features)
|
||||
|
@ -762,7 +762,8 @@ TEST(TargetParserTest, AArch64ArchExtFeature) {
|
|||
{"simd", "nosimd", "+neon", "-neon"},
|
||||
{"fp16", "nofp16", "+fullfp16", "-fullfp16"},
|
||||
{"profile", "noprofile", "+spe", "-spe"},
|
||||
{"ras", "noras", "+ras", "-ras"}};
|
||||
{"ras", "noras", "+ras", "-ras"},
|
||||
{"sve", "nosve", "+sve", "-sve"}};
|
||||
|
||||
for (unsigned i = 0; i < array_lengthof(ArchExt); i++) {
|
||||
EXPECT_EQ(StringRef(ArchExt[i][2]),
|
||||
|
|
Loading…
Reference in New Issue