mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-25 14:50:26 +00:00
[ARMTargetParser] Move IAS arch ext parser. NFC
The plan was to move the whole table into the already existing ArchExtNames but some fields depend on a table-generated file, and we don't yet have this feature in the generic lib/Support side. Once the minimum target-specific table-generated files are available in a generic fashion to these libraries, we'll have to keep it in the ASM parser. llvm-svn: 238651
This commit is contained in:
parent
11e6f8fed1
commit
230d298320
@ -92,8 +92,15 @@ namespace ARM {
|
|||||||
AEK_FP,
|
AEK_FP,
|
||||||
AEK_HWDIV,
|
AEK_HWDIV,
|
||||||
AEK_MP,
|
AEK_MP,
|
||||||
|
AEK_SIMD,
|
||||||
AEK_SEC,
|
AEK_SEC,
|
||||||
AEK_VIRT,
|
AEK_VIRT,
|
||||||
|
// Unsupported extensions.
|
||||||
|
AEK_OS,
|
||||||
|
AEK_IWMMXT,
|
||||||
|
AEK_IWMMXT2,
|
||||||
|
AEK_MAVERICK,
|
||||||
|
AEK_XSCALE,
|
||||||
AEK_LAST
|
AEK_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -106,8 +106,14 @@ struct {
|
|||||||
{ "fp", ARM::AEK_FP },
|
{ "fp", ARM::AEK_FP },
|
||||||
{ "idiv", ARM::AEK_HWDIV },
|
{ "idiv", ARM::AEK_HWDIV },
|
||||||
{ "mp", ARM::AEK_MP },
|
{ "mp", ARM::AEK_MP },
|
||||||
|
{ "simd", ARM::AEK_SIMD },
|
||||||
{ "sec", ARM::AEK_SEC },
|
{ "sec", ARM::AEK_SEC },
|
||||||
{ "virt", ARM::AEK_VIRT }
|
{ "virt", ARM::AEK_VIRT },
|
||||||
|
{ "os", ARM::AEK_OS },
|
||||||
|
{ "iwmmxt", ARM::AEK_IWMMXT },
|
||||||
|
{ "iwmmxt2", ARM::AEK_IWMMXT2 },
|
||||||
|
{ "maverick", ARM::AEK_MAVERICK },
|
||||||
|
{ "xscale", ARM::AEK_XSCALE }
|
||||||
};
|
};
|
||||||
// List of CPU names and their arches.
|
// List of CPU names and their arches.
|
||||||
// The same CPU can have multiple arches and can be default on multiple arches.
|
// The same CPU can have multiple arches and can be default on multiple arches.
|
||||||
|
@ -9982,33 +9982,32 @@ extern "C" void LLVMInitializeARMAsmParser() {
|
|||||||
#define GET_MATCHER_IMPLEMENTATION
|
#define GET_MATCHER_IMPLEMENTATION
|
||||||
#include "ARMGenAsmMatcher.inc"
|
#include "ARMGenAsmMatcher.inc"
|
||||||
|
|
||||||
|
// FIXME: This structure should be moved inside ARMTargetParser
|
||||||
|
// when we start to table-generate them, and we can use the ARM
|
||||||
|
// flags below, that were generated by table-gen.
|
||||||
static const struct {
|
static const struct {
|
||||||
const char *Name;
|
const ARM::ArchExtKind Kind;
|
||||||
const unsigned ArchCheck;
|
const unsigned ArchCheck;
|
||||||
const FeatureBitset Features;
|
const FeatureBitset Features;
|
||||||
} Extensions[] = {
|
} Extensions[] = {
|
||||||
{ "crc", Feature_HasV8, {ARM::FeatureCRC} },
|
{ ARM::AEK_CRC, Feature_HasV8, {ARM::FeatureCRC} },
|
||||||
{ "crypto", Feature_HasV8,
|
{ ARM::AEK_CRYPTO, Feature_HasV8,
|
||||||
{ARM::FeatureCrypto, ARM::FeatureNEON, ARM::FeatureFPARMv8} },
|
{ARM::FeatureCrypto, ARM::FeatureNEON, ARM::FeatureFPARMv8} },
|
||||||
{ "fp", Feature_HasV8, {ARM::FeatureFPARMv8} },
|
{ ARM::AEK_FP, Feature_HasV8, {ARM::FeatureFPARMv8} },
|
||||||
{ "idiv", Feature_HasV7 | Feature_IsNotMClass,
|
{ ARM::AEK_HWDIV, Feature_HasV7 | Feature_IsNotMClass,
|
||||||
{ARM::FeatureHWDiv, ARM::FeatureHWDivARM} },
|
{ARM::FeatureHWDiv, ARM::FeatureHWDivARM} },
|
||||||
// FIXME: iWMMXT not supported
|
{ ARM::AEK_MP, Feature_HasV7 | Feature_IsNotMClass, {ARM::FeatureMP} },
|
||||||
{ "iwmmxt", Feature_None, {} },
|
{ ARM::AEK_SIMD, Feature_HasV8, {ARM::FeatureNEON, ARM::FeatureFPARMv8} },
|
||||||
// FIXME: iWMMXT2 not supported
|
|
||||||
{ "iwmmxt2", Feature_None, {} },
|
|
||||||
// FIXME: Maverick not supported
|
|
||||||
{ "maverick", Feature_None, {} },
|
|
||||||
{ "mp", Feature_HasV7 | Feature_IsNotMClass, {ARM::FeatureMP} },
|
|
||||||
// FIXME: ARMv6-m OS Extensions feature not checked
|
|
||||||
{ "os", Feature_None, {} },
|
|
||||||
// FIXME: Also available in ARMv6-K
|
// FIXME: Also available in ARMv6-K
|
||||||
{ "sec", Feature_HasV7, {ARM::FeatureTrustZone} },
|
{ ARM::AEK_SEC, Feature_HasV7, {ARM::FeatureTrustZone} },
|
||||||
{ "simd", Feature_HasV8, {ARM::FeatureNEON, ARM::FeatureFPARMv8} },
|
|
||||||
// FIXME: Only available in A-class, isel not predicated
|
// FIXME: Only available in A-class, isel not predicated
|
||||||
{ "virt", Feature_HasV7, {ARM::FeatureVirtualization} },
|
{ ARM::AEK_VIRT, Feature_HasV7, {ARM::FeatureVirtualization} },
|
||||||
// FIXME: xscale not supported
|
// FIXME: Unsupported extensions.
|
||||||
{ "xscale", Feature_None, {} },
|
{ ARM::AEK_OS, Feature_None, {} },
|
||||||
|
{ ARM::AEK_IWMMXT, Feature_None, {} },
|
||||||
|
{ ARM::AEK_IWMMXT2, Feature_None, {} },
|
||||||
|
{ ARM::AEK_MAVERICK, Feature_None, {} },
|
||||||
|
{ ARM::AEK_XSCALE, Feature_None, {} },
|
||||||
};
|
};
|
||||||
|
|
||||||
/// parseDirectiveArchExtension
|
/// parseDirectiveArchExtension
|
||||||
@ -10031,9 +10030,12 @@ bool ARMAsmParser::parseDirectiveArchExtension(SMLoc L) {
|
|||||||
EnableFeature = false;
|
EnableFeature = false;
|
||||||
Name = Name.substr(2);
|
Name = Name.substr(2);
|
||||||
}
|
}
|
||||||
|
unsigned FeatureKind = ARMTargetParser::parseArchExt(Name);
|
||||||
|
if (FeatureKind == ARM::AEK_INVALID)
|
||||||
|
Error(ExtLoc, "unknown architectural extension: " + Name);
|
||||||
|
|
||||||
for (const auto &Extension : Extensions) {
|
for (const auto &Extension : Extensions) {
|
||||||
if (Extension.Name != Name)
|
if (Extension.Kind != FeatureKind)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (Extension.Features.none())
|
if (Extension.Features.none())
|
||||||
|
Loading…
Reference in New Issue
Block a user