|
@@ -323,6 +323,8 @@ ARMTargetInfo::ARMTargetInfo(const llvm::Triple &Triple,
|
|
this->MCountName = Opts.EABIVersion == llvm::EABI::GNU
|
|
this->MCountName = Opts.EABIVersion == llvm::EABI::GNU
|
|
? "\01__gnu_mcount_nc"
|
|
? "\01__gnu_mcount_nc"
|
|
: "\01mcount";
|
|
: "\01mcount";
|
|
|
|
+
|
|
|
|
+ SoftFloatABI = llvm::is_contained(Opts.FeaturesAsWritten, "+soft-float-abi");
|
|
}
|
|
}
|
|
|
|
|
|
StringRef ARMTargetInfo::getABI() const { return ABI; }
|
|
StringRef ARMTargetInfo::getABI() const { return ABI; }
|
|
@@ -385,12 +387,21 @@ bool ARMTargetInfo::initFeatureMap(
|
|
|
|
|
|
// Convert user-provided arm and thumb GNU target attributes to
|
|
// Convert user-provided arm and thumb GNU target attributes to
|
|
// [-|+]thumb-mode target features respectively.
|
|
// [-|+]thumb-mode target features respectively.
|
|
- std::vector<std::string> UpdatedFeaturesVec(FeaturesVec);
|
|
|
|
- for (auto &Feature : UpdatedFeaturesVec) {
|
|
|
|
- if (Feature.compare("+arm") == 0)
|
|
|
|
- Feature = "-thumb-mode";
|
|
|
|
- else if (Feature.compare("+thumb") == 0)
|
|
|
|
- Feature = "+thumb-mode";
|
|
|
|
|
|
+ std::vector<std::string> UpdatedFeaturesVec;
|
|
|
|
+ for (const auto &Feature : FeaturesVec) {
|
|
|
|
+ // Skip soft-float-abi; it's something we only use to initialize a bit of
|
|
|
|
+ // class state, and is otherwise unrecognized.
|
|
|
|
+ if (Feature == "+soft-float-abi")
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
+ StringRef FixedFeature;
|
|
|
|
+ if (Feature == "+arm")
|
|
|
|
+ FixedFeature = "-thumb-mode";
|
|
|
|
+ else if (Feature == "+thumb")
|
|
|
|
+ FixedFeature = "+thumb-mode";
|
|
|
|
+ else
|
|
|
|
+ FixedFeature = Feature;
|
|
|
|
+ UpdatedFeaturesVec.push_back(FixedFeature.str());
|
|
}
|
|
}
|
|
|
|
|
|
return TargetInfo::initFeatureMap(Features, Diags, CPU, UpdatedFeaturesVec);
|
|
return TargetInfo::initFeatureMap(Features, Diags, CPU, UpdatedFeaturesVec);
|
|
@@ -405,7 +416,8 @@ bool ARMTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
|
|
Crypto = 0;
|
|
Crypto = 0;
|
|
DSP = 0;
|
|
DSP = 0;
|
|
Unaligned = 1;
|
|
Unaligned = 1;
|
|
- SoftFloat = SoftFloatABI = false;
|
|
|
|
|
|
+ SoftFloat = false;
|
|
|
|
+ // Note that SoftFloatABI is initialized in our constructor.
|
|
HWDiv = 0;
|
|
HWDiv = 0;
|
|
DotProd = 0;
|
|
DotProd = 0;
|
|
HasFloat16 = true;
|
|
HasFloat16 = true;
|
|
@@ -415,8 +427,6 @@ bool ARMTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
|
|
for (const auto &Feature : Features) {
|
|
for (const auto &Feature : Features) {
|
|
if (Feature == "+soft-float") {
|
|
if (Feature == "+soft-float") {
|
|
SoftFloat = true;
|
|
SoftFloat = true;
|
|
- } else if (Feature == "+soft-float-abi") {
|
|
|
|
- SoftFloatABI = true;
|
|
|
|
} else if (Feature == "+vfp2sp" || Feature == "+vfp2d16sp" ||
|
|
} else if (Feature == "+vfp2sp" || Feature == "+vfp2d16sp" ||
|
|
Feature == "+vfp2" || Feature == "+vfp2d16") {
|
|
Feature == "+vfp2" || Feature == "+vfp2d16") {
|
|
FPU |= VFP2FPU;
|
|
FPU |= VFP2FPU;
|
|
@@ -510,11 +520,6 @@ bool ARMTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
|
|
else if (FPMath == FP_VFP)
|
|
else if (FPMath == FP_VFP)
|
|
Features.push_back("-neonfp");
|
|
Features.push_back("-neonfp");
|
|
|
|
|
|
- // Remove front-end specific options which the backend handles differently.
|
|
|
|
- auto Feature = llvm::find(Features, "+soft-float-abi");
|
|
|
|
- if (Feature != Features.end())
|
|
|
|
- Features.erase(Feature);
|
|
|
|
-
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|