mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
-Added API for retrieving the default FPU of a CPU from TargetParser.
-Implemented as a table lookup. Change-Id: Iaad0eaf4b29b06827e6700269496dc1ba20e9018 Phabricator: http://reviews.llvm.org/D11100 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242284 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7d51923226
commit
4aa2f4514c
@ -178,6 +178,7 @@ public:
|
||||
static unsigned getFPUVersion(unsigned FPUKind);
|
||||
static unsigned getFPUNeonSupportLevel(unsigned FPUKind);
|
||||
static unsigned getFPURestriction(unsigned FPUKind);
|
||||
static unsigned getDefaultFPU(StringRef CPU);
|
||||
// FIXME: This should be moved to TargetTuple once it exists
|
||||
static bool getFPUFeatures(unsigned FPUKind,
|
||||
std::vector<const char*> &Features);
|
||||
|
@ -138,93 +138,96 @@ struct {
|
||||
struct {
|
||||
const char *Name;
|
||||
ARM::ArchKind ArchID;
|
||||
bool Default;
|
||||
ARM::FPUKind DefaultFPU;
|
||||
bool Default; // is $Name the default CPU for $ArchID ?
|
||||
} CPUNames[] = {
|
||||
{ "arm2", ARM::AK_ARMV2, true },
|
||||
{ "arm3", ARM::AK_ARMV2A, true },
|
||||
{ "arm6", ARM::AK_ARMV3, true },
|
||||
{ "arm7m", ARM::AK_ARMV3M, true },
|
||||
{ "arm8", ARM::AK_ARMV4, false },
|
||||
{ "arm810", ARM::AK_ARMV4, false },
|
||||
{ "strongarm", ARM::AK_ARMV4, true },
|
||||
{ "strongarm110", ARM::AK_ARMV4, false },
|
||||
{ "strongarm1100", ARM::AK_ARMV4, false },
|
||||
{ "strongarm1110", ARM::AK_ARMV4, false },
|
||||
{ "arm7tdmi", ARM::AK_ARMV4T, true },
|
||||
{ "arm7tdmi-s", ARM::AK_ARMV4T, false },
|
||||
{ "arm710t", ARM::AK_ARMV4T, false },
|
||||
{ "arm720t", ARM::AK_ARMV4T, false },
|
||||
{ "arm9", ARM::AK_ARMV4T, false },
|
||||
{ "arm9tdmi", ARM::AK_ARMV4T, false },
|
||||
{ "arm920", ARM::AK_ARMV4T, false },
|
||||
{ "arm920t", ARM::AK_ARMV4T, false },
|
||||
{ "arm922t", ARM::AK_ARMV4T, false },
|
||||
{ "arm9312", ARM::AK_ARMV4T, false },
|
||||
{ "arm940t", ARM::AK_ARMV4T, false },
|
||||
{ "ep9312", ARM::AK_ARMV4T, false },
|
||||
{ "arm10tdmi", ARM::AK_ARMV5T, true },
|
||||
{ "arm1020t", ARM::AK_ARMV5T, false },
|
||||
{ "arm9e", ARM::AK_ARMV5TE, false },
|
||||
{ "arm946e-s", ARM::AK_ARMV5TE, false },
|
||||
{ "arm966e-s", ARM::AK_ARMV5TE, false },
|
||||
{ "arm968e-s", ARM::AK_ARMV5TE, false },
|
||||
{ "arm10e", ARM::AK_ARMV5TE, false },
|
||||
{ "arm1020e", ARM::AK_ARMV5TE, false },
|
||||
{ "arm1022e", ARM::AK_ARMV5TE, true },
|
||||
{ "iwmmxt", ARM::AK_ARMV5TE, false },
|
||||
{ "xscale", ARM::AK_ARMV5TE, false },
|
||||
{ "arm926ej-s", ARM::AK_ARMV5TEJ, true },
|
||||
{ "arm1136jf-s", ARM::AK_ARMV6, true },
|
||||
{ "arm1176j-s", ARM::AK_ARMV6K, false },
|
||||
{ "arm1176jz-s", ARM::AK_ARMV6K, false },
|
||||
{ "mpcore", ARM::AK_ARMV6K, false },
|
||||
{ "mpcorenovfp", ARM::AK_ARMV6K, false },
|
||||
{ "arm1176jzf-s", ARM::AK_ARMV6K, true },
|
||||
{ "arm1176jzf-s", ARM::AK_ARMV6Z, true },
|
||||
{ "arm1176jzf-s", ARM::AK_ARMV6ZK, true },
|
||||
{ "arm1156t2-s", ARM::AK_ARMV6T2, true },
|
||||
{ "arm1156t2f-s", ARM::AK_ARMV6T2, false },
|
||||
{ "cortex-m0", ARM::AK_ARMV6M, true },
|
||||
{ "cortex-m0plus", ARM::AK_ARMV6M, false },
|
||||
{ "cortex-m1", ARM::AK_ARMV6M, false },
|
||||
{ "sc000", ARM::AK_ARMV6M, false },
|
||||
{ "cortex-a5", ARM::AK_ARMV7A, false },
|
||||
{ "cortex-a7", ARM::AK_ARMV7A, false },
|
||||
{ "cortex-a8", ARM::AK_ARMV7A, true },
|
||||
{ "cortex-a9", ARM::AK_ARMV7A, false },
|
||||
{ "cortex-a12", ARM::AK_ARMV7A, false },
|
||||
{ "cortex-a15", ARM::AK_ARMV7A, false },
|
||||
{ "cortex-a17", ARM::AK_ARMV7A, false },
|
||||
{ "krait", ARM::AK_ARMV7A, false },
|
||||
{ "cortex-r4", ARM::AK_ARMV7R, true },
|
||||
{ "cortex-r4f", ARM::AK_ARMV7R, false },
|
||||
{ "cortex-r5", ARM::AK_ARMV7R, false },
|
||||
{ "cortex-r7", ARM::AK_ARMV7R, false },
|
||||
{ "sc300", ARM::AK_ARMV7M, false },
|
||||
{ "cortex-m3", ARM::AK_ARMV7M, true },
|
||||
{ "cortex-m4", ARM::AK_ARMV7EM, true },
|
||||
{ "cortex-m7", ARM::AK_ARMV7EM, false },
|
||||
{ "cortex-a53", ARM::AK_ARMV8A, true },
|
||||
{ "cortex-a57", ARM::AK_ARMV8A, false },
|
||||
{ "cortex-a72", ARM::AK_ARMV8A, false },
|
||||
{ "cyclone", ARM::AK_ARMV8A, false },
|
||||
{ "generic", ARM::AK_ARMV8_1A, true },
|
||||
{ "arm2", ARM::AK_ARMV2, ARM::FK_NONE, true },
|
||||
{ "arm3", ARM::AK_ARMV2A, ARM::FK_NONE, true },
|
||||
{ "arm6", ARM::AK_ARMV3, ARM::FK_NONE, true },
|
||||
{ "arm7m", ARM::AK_ARMV3M, ARM::FK_NONE, true },
|
||||
{ "arm8", ARM::AK_ARMV4, ARM::FK_NONE, false },
|
||||
{ "arm810", ARM::AK_ARMV4, ARM::FK_NONE, false },
|
||||
{ "strongarm", ARM::AK_ARMV4, ARM::FK_NONE, true },
|
||||
{ "strongarm110", ARM::AK_ARMV4, ARM::FK_NONE, false },
|
||||
{ "strongarm1100", ARM::AK_ARMV4, ARM::FK_NONE, false },
|
||||
{ "strongarm1110", ARM::AK_ARMV4, ARM::FK_NONE, false },
|
||||
{ "arm7tdmi", ARM::AK_ARMV4T, ARM::FK_NONE, true },
|
||||
{ "arm7tdmi-s", ARM::AK_ARMV4T, ARM::FK_NONE, false },
|
||||
{ "arm710t", ARM::AK_ARMV4T, ARM::FK_NONE, false },
|
||||
{ "arm720t", ARM::AK_ARMV4T, ARM::FK_NONE, false },
|
||||
{ "arm9", ARM::AK_ARMV4T, ARM::FK_NONE, false },
|
||||
{ "arm9tdmi", ARM::AK_ARMV4T, ARM::FK_NONE, false },
|
||||
{ "arm920", ARM::AK_ARMV4T, ARM::FK_NONE, false },
|
||||
{ "arm920t", ARM::AK_ARMV4T, ARM::FK_NONE, false },
|
||||
{ "arm922t", ARM::AK_ARMV4T, ARM::FK_NONE, false },
|
||||
{ "arm9312", ARM::AK_ARMV4T, ARM::FK_NONE, false },
|
||||
{ "arm940t", ARM::AK_ARMV4T, ARM::FK_NONE, false },
|
||||
{ "ep9312", ARM::AK_ARMV4T, ARM::FK_NONE, false },
|
||||
{ "arm10tdmi", ARM::AK_ARMV5T, ARM::FK_NONE, true },
|
||||
{ "arm1020t", ARM::AK_ARMV5T, ARM::FK_NONE, false },
|
||||
{ "arm9e", ARM::AK_ARMV5TE, ARM::FK_NONE, false },
|
||||
{ "arm946e-s", ARM::AK_ARMV5TE, ARM::FK_NONE, false },
|
||||
{ "arm966e-s", ARM::AK_ARMV5TE, ARM::FK_NONE, false },
|
||||
{ "arm968e-s", ARM::AK_ARMV5TE, ARM::FK_NONE, false },
|
||||
{ "arm10e", ARM::AK_ARMV5TE, ARM::FK_NONE, false },
|
||||
{ "arm1020e", ARM::AK_ARMV5TE, ARM::FK_NONE, false },
|
||||
{ "arm1022e", ARM::AK_ARMV5TE, ARM::FK_NONE, true },
|
||||
{ "iwmmxt", ARM::AK_ARMV5TE, ARM::FK_NONE, false },
|
||||
{ "xscale", ARM::AK_ARMV5TE, ARM::FK_NONE, false },
|
||||
{ "arm926ej-s", ARM::AK_ARMV5TEJ, ARM::FK_NONE, true },
|
||||
{ "arm1136jf-s", ARM::AK_ARMV6, ARM::FK_VFPV2, true },
|
||||
{ "arm1176j-s", ARM::AK_ARMV6K, ARM::FK_NONE, false },
|
||||
{ "arm1176jz-s", ARM::AK_ARMV6K, ARM::FK_NONE, false },
|
||||
{ "mpcore", ARM::AK_ARMV6K, ARM::FK_VFPV2, false },
|
||||
{ "mpcorenovfp", ARM::AK_ARMV6K, ARM::FK_NONE, false },
|
||||
{ "arm1176jzf-s", ARM::AK_ARMV6K, ARM::FK_VFPV2, true },
|
||||
{ "arm1176jzf-s", ARM::AK_ARMV6Z, ARM::FK_VFPV2, true },
|
||||
{ "arm1176jzf-s", ARM::AK_ARMV6ZK, ARM::FK_VFPV2, true },
|
||||
{ "arm1156t2-s", ARM::AK_ARMV6T2, ARM::FK_NONE, true },
|
||||
{ "arm1156t2f-s", ARM::AK_ARMV6T2, ARM::FK_VFPV2, false },
|
||||
{ "cortex-m0", ARM::AK_ARMV6M, ARM::FK_NONE, true },
|
||||
{ "cortex-m0plus", ARM::AK_ARMV6M, ARM::FK_NONE, false },
|
||||
{ "cortex-m1", ARM::AK_ARMV6M, ARM::FK_NONE, false },
|
||||
{ "sc000", ARM::AK_ARMV6M, ARM::FK_NONE, false },
|
||||
{ "cortex-a5", ARM::AK_ARMV7A, ARM::FK_NEON_VFPV4, false },
|
||||
{ "cortex-a7", ARM::AK_ARMV7A, ARM::FK_NEON_VFPV4, false },
|
||||
{ "cortex-a8", ARM::AK_ARMV7A, ARM::FK_NEON, true },
|
||||
{ "cortex-a9", ARM::AK_ARMV7A, ARM::FK_NEON_FP16, false },
|
||||
{ "cortex-a12", ARM::AK_ARMV7A, ARM::FK_NEON_VFPV4, false },
|
||||
{ "cortex-a15", ARM::AK_ARMV7A, ARM::FK_NEON_VFPV4, false },
|
||||
{ "cortex-a17", ARM::AK_ARMV7A, ARM::FK_NEON_VFPV4, false },
|
||||
{ "krait", ARM::AK_ARMV7A, ARM::FK_NEON_VFPV4, false },
|
||||
{ "cortex-r4", ARM::AK_ARMV7R, ARM::FK_NONE, true },
|
||||
{ "cortex-r4f", ARM::AK_ARMV7R, ARM::FK_VFPV3_D16, false },
|
||||
{ "cortex-r5", ARM::AK_ARMV7R, ARM::FK_VFPV3_D16, false },
|
||||
{ "cortex-r7", ARM::AK_ARMV7R, ARM::FK_VFPV3_D16_FP16, false },
|
||||
{ "sc300", ARM::AK_ARMV7M, ARM::FK_NONE, false },
|
||||
{ "cortex-m3", ARM::AK_ARMV7M, ARM::FK_NONE, true },
|
||||
{ "cortex-m4", ARM::AK_ARMV7EM, ARM::FK_NONE, true },
|
||||
// FIXME cortex-m4f missing from ARM.td
|
||||
{ "cortex-m4f", ARM::AK_ARMV7EM, ARM::FK_FPV4_SP_D16, false },
|
||||
{ "cortex-m7", ARM::AK_ARMV7EM, ARM::FK_FPV5_D16, false },
|
||||
{ "cortex-a53", ARM::AK_ARMV8A, ARM::FK_CRYPTO_NEON_FP_ARMV8, true },
|
||||
{ "cortex-a57", ARM::AK_ARMV8A, ARM::FK_CRYPTO_NEON_FP_ARMV8, false },
|
||||
{ "cortex-a72", ARM::AK_ARMV8A, ARM::FK_CRYPTO_NEON_FP_ARMV8, false },
|
||||
{ "cyclone", ARM::AK_ARMV8A, ARM::FK_CRYPTO_NEON_FP_ARMV8, false },
|
||||
{ "generic", ARM::AK_ARMV8_1A, ARM::FK_NEON_FP_ARMV8, true },
|
||||
// Non-standard Arch names.
|
||||
{ "iwmmxt", ARM::AK_IWMMXT, true },
|
||||
{ "xscale", ARM::AK_XSCALE, true },
|
||||
{ "arm10tdmi", ARM::AK_ARMV5, true },
|
||||
{ "arm1022e", ARM::AK_ARMV5E, true },
|
||||
{ "arm1136j-s", ARM::AK_ARMV6J, true },
|
||||
{ "arm1136jz-s", ARM::AK_ARMV6J, false },
|
||||
{ "cortex-m0", ARM::AK_ARMV6SM, true },
|
||||
{ "arm1176jzf-s", ARM::AK_ARMV6HL, true },
|
||||
{ "cortex-a8", ARM::AK_ARMV7, true },
|
||||
{ "cortex-a8", ARM::AK_ARMV7L, true },
|
||||
{ "cortex-a8", ARM::AK_ARMV7HL, true },
|
||||
{ "cortex-m4", ARM::AK_ARMV7EM, true },
|
||||
{ "swift", ARM::AK_ARMV7S, true },
|
||||
{ "iwmmxt", ARM::AK_IWMMXT, ARM::FK_NONE, true },
|
||||
{ "xscale", ARM::AK_XSCALE, ARM::FK_NONE, true },
|
||||
{ "arm10tdmi", ARM::AK_ARMV5, ARM::FK_NONE, true },
|
||||
{ "arm1022e", ARM::AK_ARMV5E, ARM::FK_NONE, true },
|
||||
{ "arm1136j-s", ARM::AK_ARMV6J, ARM::FK_NONE, true },
|
||||
{ "arm1136jz-s", ARM::AK_ARMV6J, ARM::FK_NONE, false },
|
||||
{ "cortex-m0", ARM::AK_ARMV6SM, ARM::FK_NONE, true },
|
||||
{ "arm1176jzf-s", ARM::AK_ARMV6HL, ARM::FK_VFPV2, true },
|
||||
{ "cortex-a8", ARM::AK_ARMV7, ARM::FK_NEON, true },
|
||||
{ "cortex-a8", ARM::AK_ARMV7L, ARM::FK_NEON, true },
|
||||
{ "cortex-a8", ARM::AK_ARMV7HL, ARM::FK_NEON, true },
|
||||
{ "cortex-m4", ARM::AK_ARMV7EM, ARM::FK_NONE, true },
|
||||
{ "swift", ARM::AK_ARMV7S, ARM::FK_NEON_VFPV4, true },
|
||||
// Invalid CPU
|
||||
{ "invalid", ARM::AK_INVALID, true }
|
||||
{ "invalid", ARM::AK_INVALID, ARM::FK_INVALID, true }
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@ -257,6 +260,14 @@ unsigned ARMTargetParser::getFPURestriction(unsigned FPUKind) {
|
||||
return FPUNames[FPUKind].Restriction;
|
||||
}
|
||||
|
||||
unsigned ARMTargetParser::getDefaultFPU(StringRef CPU) {
|
||||
for (const auto C : CPUNames) {
|
||||
if (CPU == C.Name)
|
||||
return C.DefaultFPU;
|
||||
}
|
||||
return ARM::FK_INVALID;
|
||||
}
|
||||
|
||||
bool ARMTargetParser::getFPUFeatures(unsigned FPUKind,
|
||||
std::vector<const char *> &Features) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user