mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-03 00:47:07 +00:00
[Driver][ARM] Disable unsupported features when nofp arch extension is used
A list of target features is disabled when there is no hardware floating-point support. This is the case when one of the following options is passed to clang: - -mfloat-abi=soft - -mfpu=none This option list is missing, however, the extension "+nofp" that can be specified in -march flags, such as "-march=armv8-a+nofp". This patch also disables unsupported target features when nofp is passed to -march. Differential Revision: https://reviews.llvm.org/D82948
This commit is contained in:
parent
44836ba0cf
commit
9c2a0c2f38
@ -250,7 +250,8 @@ StringRef getSubArch(ArchKind AK);
|
||||
StringRef getArchExtName(uint64_t ArchExtKind);
|
||||
StringRef getArchExtFeature(StringRef ArchExt);
|
||||
bool appendArchExtFeatures(StringRef CPU, ARM::ArchKind AK, StringRef ArchExt,
|
||||
std::vector<StringRef> &Features);
|
||||
std::vector<StringRef> &Features,
|
||||
unsigned &ArgFPUKind);
|
||||
StringRef getHWDivName(uint64_t HWDivKind);
|
||||
|
||||
// Information by Name
|
||||
|
@ -490,9 +490,10 @@ static unsigned findDoublePrecisionFPU(unsigned InputFPUKind) {
|
||||
return ARM::FK_INVALID;
|
||||
}
|
||||
|
||||
bool ARM::appendArchExtFeatures(
|
||||
StringRef CPU, ARM::ArchKind AK, StringRef ArchExt,
|
||||
std::vector<StringRef> &Features) {
|
||||
bool ARM::appendArchExtFeatures(StringRef CPU, ARM::ArchKind AK,
|
||||
StringRef ArchExt,
|
||||
std::vector<StringRef> &Features,
|
||||
unsigned &ArgFPUID) {
|
||||
|
||||
size_t StartingNumFeatures = Features.size();
|
||||
const bool Negated = stripNegationPrefix(ArchExt);
|
||||
@ -527,6 +528,7 @@ bool ARM::appendArchExtFeatures(
|
||||
} else {
|
||||
FPUKind = getDefaultFPU(CPU, AK);
|
||||
}
|
||||
ArgFPUID = FPUKind;
|
||||
return ARM::getFPUFeatures(FPUKind, Features);
|
||||
}
|
||||
return StartingNumFeatures != Features.size();
|
||||
|
@ -668,9 +668,10 @@ static bool
|
||||
testArchExtDependency(const char *ArchExt,
|
||||
const std::initializer_list<const char *> &Expected) {
|
||||
std::vector<StringRef> Features;
|
||||
unsigned FPUID;
|
||||
|
||||
if (!ARM::appendArchExtFeatures("", ARM::ArchKind::ARMV8_1MMainline, ArchExt,
|
||||
Features))
|
||||
Features, FPUID))
|
||||
return false;
|
||||
|
||||
return llvm::all_of(Expected, [&](StringRef Ext) {
|
||||
|
Loading…
Reference in New Issue
Block a user