summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/ARMTargetParser.cpp
diff options
context:
space:
mode:
authorAlexandros Lamprineas <alexandros.lamprineas@arm.com>2019-07-14 18:32:42 +0000
committerAlexandros Lamprineas <alexandros.lamprineas@arm.com>2019-07-14 18:32:42 +0000
commit24cacf9c56f0b55534e98941cc8675a9a7489c37 (patch)
tree8f1feaa6b438ca77f30acf6b91697b63b566f776 /llvm/lib/Support/ARMTargetParser.cpp
parentaae0cb67ed79bb7dddcda3438afd1263104cc689 (diff)
downloadbcm5719-llvm-24cacf9c56f0b55534e98941cc8675a9a7489c37.tar.gz
bcm5719-llvm-24cacf9c56f0b55534e98941cc8675a9a7489c37.zip
[clang][Driver][ARM] Favor -mfpu over default CPU features
When processing the command line options march, mcpu and mfpu, we store the implied target features on a vector. The change D62998 introduced a temporary vector, where the processed features get accumulated. When calling DecodeARMFeaturesFromCPU, which sets the default features for the specified CPU, we certainly don't want to override the features that have been explicitly specified on the command line. Therefore, the default features should appear first in the final vector. This problem became evident once I added the missing (unhandled) target features in ARM::getExtensionFeatures. Differential Revision: https://reviews.llvm.org/D63936 llvm-svn: 366027
Diffstat (limited to 'llvm/lib/Support/ARMTargetParser.cpp')
-rw-r--r--llvm/lib/Support/ARMTargetParser.cpp30
1 files changed, 6 insertions, 24 deletions
diff --git a/llvm/lib/Support/ARMTargetParser.cpp b/llvm/lib/Support/ARMTargetParser.cpp
index e91b508eefd..27d1e5527be 100644
--- a/llvm/lib/Support/ARMTargetParser.cpp
+++ b/llvm/lib/Support/ARMTargetParser.cpp
@@ -409,30 +409,12 @@ bool ARM::getExtensionFeatures(unsigned Extensions,
if (Extensions == AEK_INVALID)
return false;
- if (Extensions & AEK_CRC)
- Features.push_back("+crc");
- else
- Features.push_back("-crc");
-
- if (Extensions & AEK_DSP)
- Features.push_back("+dsp");
- else
- Features.push_back("-dsp");
-
- if (Extensions & AEK_FP16FML)
- Features.push_back("+fp16fml");
- else
- Features.push_back("-fp16fml");
-
- if (Extensions & AEK_RAS)
- Features.push_back("+ras");
- else
- Features.push_back("-ras");
-
- if (Extensions & AEK_DOTPROD)
- Features.push_back("+dotprod");
- else
- Features.push_back("-dotprod");
+ for (const auto AE : ARCHExtNames) {
+ if ((Extensions & AE.ID) == AE.ID && AE.Feature)
+ Features.push_back(AE.Feature);
+ else if (AE.NegFeature)
+ Features.push_back(AE.NegFeature);
+ }
return getHWDivFeatures(Extensions, Features);
}
OpenPOWER on IntegriCloud