@@ -9982,33 +9982,32 @@ extern "C" void LLVMInitializeARMAsmParser() {
9982
9982
#define GET_MATCHER_IMPLEMENTATION
9983
9983
#include " ARMGenAsmMatcher.inc"
9984
9984
9985
+ // FIXME: This structure should be moved inside ARMTargetParser
9986
+ // when we start to table-generate them, and we can use the ARM
9987
+ // flags below, that were generated by table-gen.
9985
9988
static const struct {
9986
- const char *Name ;
9989
+ const ARM::ArchExtKind Kind ;
9987
9990
const unsigned ArchCheck;
9988
9991
const FeatureBitset Features;
9989
9992
} Extensions[] = {
9990
- { " crc " , Feature_HasV8, {ARM::FeatureCRC} },
9991
- { " crypto " , Feature_HasV8,
9993
+ { ARM::AEK_CRC , Feature_HasV8, {ARM::FeatureCRC} },
9994
+ { ARM::AEK_CRYPTO , Feature_HasV8,
9992
9995
{ARM::FeatureCrypto, ARM::FeatureNEON, ARM::FeatureFPARMv8} },
9993
- { " fp " , Feature_HasV8, {ARM::FeatureFPARMv8} },
9994
- { " idiv " , Feature_HasV7 | Feature_IsNotMClass,
9996
+ { ARM::AEK_FP , Feature_HasV8, {ARM::FeatureFPARMv8} },
9997
+ { ARM::AEK_HWDIV , Feature_HasV7 | Feature_IsNotMClass,
9995
9998
{ARM::FeatureHWDiv, ARM::FeatureHWDivARM} },
9996
- // FIXME: iWMMXT not supported
9997
- { " iwmmxt" , Feature_None, {} },
9998
- // FIXME: iWMMXT2 not supported
9999
- { " iwmmxt2" , Feature_None, {} },
10000
- // FIXME: Maverick not supported
10001
- { " maverick" , Feature_None, {} },
10002
- { " mp" , Feature_HasV7 | Feature_IsNotMClass, {ARM::FeatureMP} },
10003
- // FIXME: ARMv6-m OS Extensions feature not checked
10004
- { " os" , Feature_None, {} },
9999
+ { ARM::AEK_MP, Feature_HasV7 | Feature_IsNotMClass, {ARM::FeatureMP} },
10000
+ { ARM::AEK_SIMD, Feature_HasV8, {ARM::FeatureNEON, ARM::FeatureFPARMv8} },
10005
10001
// FIXME: Also available in ARMv6-K
10006
- { " sec" , Feature_HasV7, {ARM::FeatureTrustZone} },
10007
- { " simd" , Feature_HasV8, {ARM::FeatureNEON, ARM::FeatureFPARMv8} },
10002
+ { ARM::AEK_SEC, Feature_HasV7, {ARM::FeatureTrustZone} },
10008
10003
// FIXME: Only available in A-class, isel not predicated
10009
- { " virt" , Feature_HasV7, {ARM::FeatureVirtualization} },
10010
- // FIXME: xscale not supported
10011
- { " xscale" , Feature_None, {} },
10004
+ { ARM::AEK_VIRT, Feature_HasV7, {ARM::FeatureVirtualization} },
10005
+ // FIXME: Unsupported extensions.
10006
+ { ARM::AEK_OS, Feature_None, {} },
10007
+ { ARM::AEK_IWMMXT, Feature_None, {} },
10008
+ { ARM::AEK_IWMMXT2, Feature_None, {} },
10009
+ { ARM::AEK_MAVERICK, Feature_None, {} },
10010
+ { ARM::AEK_XSCALE, Feature_None, {} },
10012
10011
};
10013
10012
10014
10013
// / parseDirectiveArchExtension
@@ -10031,9 +10030,12 @@ bool ARMAsmParser::parseDirectiveArchExtension(SMLoc L) {
10031
10030
EnableFeature = false ;
10032
10031
Name = Name.substr (2 );
10033
10032
}
10033
+ unsigned FeatureKind = ARMTargetParser::parseArchExt (Name);
10034
+ if (FeatureKind == ARM::AEK_INVALID)
10035
+ Error (ExtLoc, " unknown architectural extension: " + Name);
10034
10036
10035
10037
for (const auto &Extension : Extensions) {
10036
- if (Extension.Name != Name )
10038
+ if (Extension.Kind != FeatureKind )
10037
10039
continue ;
10038
10040
10039
10041
if (Extension.Features .none ())
0 commit comments