Path: blob/main/contrib/llvm-project/llvm/lib/TargetParser/ARMTargetParser.cpp
35233 views
//===-- ARMTargetParser - Parser for ARM target features --------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file implements a target parser to recognise ARM hardware features9// such as FPU/CPU/ARCH/extensions and specific support such as HWDIV.10//11//===----------------------------------------------------------------------===//1213#include "llvm/TargetParser/ARMTargetParser.h"14#include "llvm/ADT/StringSwitch.h"15#include "llvm/Support/Format.h"16#include "llvm/Support/raw_ostream.h"17#include "llvm/TargetParser/ARMTargetParserCommon.h"18#include "llvm/TargetParser/Triple.h"19#include <cctype>2021using namespace llvm;2223static StringRef getHWDivSynonym(StringRef HWDiv) {24return StringSwitch<StringRef>(HWDiv)25.Case("thumb,arm", "arm,thumb")26.Default(HWDiv);27}2829// Allows partial match, ex. "v7a" matches "armv7a".30ARM::ArchKind ARM::parseArch(StringRef Arch) {31Arch = getCanonicalArchName(Arch);32StringRef Syn = getArchSynonym(Arch);33for (const auto &A : ARMArchNames) {34if (A.Name.ends_with(Syn))35return A.ID;36}37return ArchKind::INVALID;38}3940// Version number (ex. v7 = 7).41unsigned ARM::parseArchVersion(StringRef Arch) {42Arch = getCanonicalArchName(Arch);43switch (parseArch(Arch)) {44case ArchKind::ARMV4:45case ArchKind::ARMV4T:46return 4;47case ArchKind::ARMV5T:48case ArchKind::ARMV5TE:49case ArchKind::IWMMXT:50case ArchKind::IWMMXT2:51case ArchKind::XSCALE:52case ArchKind::ARMV5TEJ:53return 5;54case ArchKind::ARMV6:55case ArchKind::ARMV6K:56case ArchKind::ARMV6T2:57case ArchKind::ARMV6KZ:58case ArchKind::ARMV6M:59return 6;60case ArchKind::ARMV7A:61case ArchKind::ARMV7VE:62case ArchKind::ARMV7R:63case ArchKind::ARMV7M:64case ArchKind::ARMV7S:65case ArchKind::ARMV7EM:66case ArchKind::ARMV7K:67return 7;68case ArchKind::ARMV8A:69case ArchKind::ARMV8_1A:70case ArchKind::ARMV8_2A:71case ArchKind::ARMV8_3A:72case ArchKind::ARMV8_4A:73case ArchKind::ARMV8_5A:74case ArchKind::ARMV8_6A:75case ArchKind::ARMV8_7A:76case ArchKind::ARMV8_8A:77case ArchKind::ARMV8_9A:78case ArchKind::ARMV8R:79case ArchKind::ARMV8MBaseline:80case ArchKind::ARMV8MMainline:81case ArchKind::ARMV8_1MMainline:82return 8;83case ArchKind::ARMV9A:84case ArchKind::ARMV9_1A:85case ArchKind::ARMV9_2A:86case ArchKind::ARMV9_3A:87case ArchKind::ARMV9_4A:88case ArchKind::ARMV9_5A:89return 9;90case ArchKind::INVALID:91return 0;92}93llvm_unreachable("Unhandled architecture");94}9596static ARM::ProfileKind getProfileKind(ARM::ArchKind AK) {97switch (AK) {98case ARM::ArchKind::ARMV6M:99case ARM::ArchKind::ARMV7M:100case ARM::ArchKind::ARMV7EM:101case ARM::ArchKind::ARMV8MMainline:102case ARM::ArchKind::ARMV8MBaseline:103case ARM::ArchKind::ARMV8_1MMainline:104return ARM::ProfileKind::M;105case ARM::ArchKind::ARMV7R:106case ARM::ArchKind::ARMV8R:107return ARM::ProfileKind::R;108case ARM::ArchKind::ARMV7A:109case ARM::ArchKind::ARMV7VE:110case ARM::ArchKind::ARMV7K:111case ARM::ArchKind::ARMV8A:112case ARM::ArchKind::ARMV8_1A:113case ARM::ArchKind::ARMV8_2A:114case ARM::ArchKind::ARMV8_3A:115case ARM::ArchKind::ARMV8_4A:116case ARM::ArchKind::ARMV8_5A:117case ARM::ArchKind::ARMV8_6A:118case ARM::ArchKind::ARMV8_7A:119case ARM::ArchKind::ARMV8_8A:120case ARM::ArchKind::ARMV8_9A:121case ARM::ArchKind::ARMV9A:122case ARM::ArchKind::ARMV9_1A:123case ARM::ArchKind::ARMV9_2A:124case ARM::ArchKind::ARMV9_3A:125case ARM::ArchKind::ARMV9_4A:126case ARM::ArchKind::ARMV9_5A:127return ARM::ProfileKind::A;128case ARM::ArchKind::ARMV4:129case ARM::ArchKind::ARMV4T:130case ARM::ArchKind::ARMV5T:131case ARM::ArchKind::ARMV5TE:132case ARM::ArchKind::ARMV5TEJ:133case ARM::ArchKind::ARMV6:134case ARM::ArchKind::ARMV6K:135case ARM::ArchKind::ARMV6T2:136case ARM::ArchKind::ARMV6KZ:137case ARM::ArchKind::ARMV7S:138case ARM::ArchKind::IWMMXT:139case ARM::ArchKind::IWMMXT2:140case ARM::ArchKind::XSCALE:141case ARM::ArchKind::INVALID:142return ARM::ProfileKind::INVALID;143}144llvm_unreachable("Unhandled architecture");145}146147// Profile A/R/M148ARM::ProfileKind ARM::parseArchProfile(StringRef Arch) {149Arch = getCanonicalArchName(Arch);150return getProfileKind(parseArch(Arch));151}152153bool ARM::getFPUFeatures(ARM::FPUKind FPUKind,154std::vector<StringRef> &Features) {155156if (FPUKind >= FK_LAST || FPUKind == FK_INVALID)157return false;158159static const struct FPUFeatureNameInfo {160const char *PlusName, *MinusName;161FPUVersion MinVersion;162FPURestriction MaxRestriction;163} FPUFeatureInfoList[] = {164// We have to specify the + and - versions of the name in full so165// that we can return them as static StringRefs.166//167// Also, the SubtargetFeatures ending in just "sp" are listed here168// under FPURestriction::None, which is the only FPURestriction in169// which they would be valid (since FPURestriction::SP doesn't170// exist).171{"+vfp2", "-vfp2", FPUVersion::VFPV2, FPURestriction::D16},172{"+vfp2sp", "-vfp2sp", FPUVersion::VFPV2, FPURestriction::SP_D16},173{"+vfp3", "-vfp3", FPUVersion::VFPV3, FPURestriction::None},174{"+vfp3d16", "-vfp3d16", FPUVersion::VFPV3, FPURestriction::D16},175{"+vfp3d16sp", "-vfp3d16sp", FPUVersion::VFPV3, FPURestriction::SP_D16},176{"+vfp3sp", "-vfp3sp", FPUVersion::VFPV3, FPURestriction::None},177{"+fp16", "-fp16", FPUVersion::VFPV3_FP16, FPURestriction::SP_D16},178{"+vfp4", "-vfp4", FPUVersion::VFPV4, FPURestriction::None},179{"+vfp4d16", "-vfp4d16", FPUVersion::VFPV4, FPURestriction::D16},180{"+vfp4d16sp", "-vfp4d16sp", FPUVersion::VFPV4, FPURestriction::SP_D16},181{"+vfp4sp", "-vfp4sp", FPUVersion::VFPV4, FPURestriction::None},182{"+fp-armv8", "-fp-armv8", FPUVersion::VFPV5, FPURestriction::None},183{"+fp-armv8d16", "-fp-armv8d16", FPUVersion::VFPV5, FPURestriction::D16},184{"+fp-armv8d16sp", "-fp-armv8d16sp", FPUVersion::VFPV5, FPURestriction::SP_D16},185{"+fp-armv8sp", "-fp-armv8sp", FPUVersion::VFPV5, FPURestriction::None},186{"+fullfp16", "-fullfp16", FPUVersion::VFPV5_FULLFP16, FPURestriction::SP_D16},187{"+fp64", "-fp64", FPUVersion::VFPV2, FPURestriction::D16},188{"+d32", "-d32", FPUVersion::VFPV3, FPURestriction::None},189};190191for (const auto &Info: FPUFeatureInfoList) {192if (FPUNames[FPUKind].FPUVer >= Info.MinVersion &&193FPUNames[FPUKind].Restriction <= Info.MaxRestriction)194Features.push_back(Info.PlusName);195else196Features.push_back(Info.MinusName);197}198199static const struct NeonFeatureNameInfo {200const char *PlusName, *MinusName;201NeonSupportLevel MinSupportLevel;202} NeonFeatureInfoList[] = {203{"+neon", "-neon", NeonSupportLevel::Neon},204{"+sha2", "-sha2", NeonSupportLevel::Crypto},205{"+aes", "-aes", NeonSupportLevel::Crypto},206};207208for (const auto &Info: NeonFeatureInfoList) {209if (FPUNames[FPUKind].NeonSupport >= Info.MinSupportLevel)210Features.push_back(Info.PlusName);211else212Features.push_back(Info.MinusName);213}214215return true;216}217218ARM::FPUKind ARM::parseFPU(StringRef FPU) {219StringRef Syn = getFPUSynonym(FPU);220for (const auto &F : FPUNames) {221if (Syn == F.Name)222return F.ID;223}224return FK_INVALID;225}226227ARM::NeonSupportLevel ARM::getFPUNeonSupportLevel(ARM::FPUKind FPUKind) {228if (FPUKind >= FK_LAST)229return NeonSupportLevel::None;230return FPUNames[FPUKind].NeonSupport;231}232233StringRef ARM::getFPUSynonym(StringRef FPU) {234return StringSwitch<StringRef>(FPU)235.Cases("fpa", "fpe2", "fpe3", "maverick", "invalid") // Unsupported236.Case("vfp2", "vfpv2")237.Case("vfp3", "vfpv3")238.Case("vfp4", "vfpv4")239.Case("vfp3-d16", "vfpv3-d16")240.Case("vfp4-d16", "vfpv4-d16")241.Cases("fp4-sp-d16", "vfpv4-sp-d16", "fpv4-sp-d16")242.Cases("fp4-dp-d16", "fpv4-dp-d16", "vfpv4-d16")243.Case("fp5-sp-d16", "fpv5-sp-d16")244.Cases("fp5-dp-d16", "fpv5-dp-d16", "fpv5-d16")245// FIXME: Clang uses it, but it's bogus, since neon defaults to vfpv3.246.Case("neon-vfpv3", "neon")247.Default(FPU);248}249250StringRef ARM::getFPUName(ARM::FPUKind FPUKind) {251if (FPUKind >= FK_LAST)252return StringRef();253return FPUNames[FPUKind].Name;254}255256ARM::FPUVersion ARM::getFPUVersion(ARM::FPUKind FPUKind) {257if (FPUKind >= FK_LAST)258return FPUVersion::NONE;259return FPUNames[FPUKind].FPUVer;260}261262ARM::FPURestriction ARM::getFPURestriction(ARM::FPUKind FPUKind) {263if (FPUKind >= FK_LAST)264return FPURestriction::None;265return FPUNames[FPUKind].Restriction;266}267268ARM::FPUKind ARM::getDefaultFPU(StringRef CPU, ARM::ArchKind AK) {269if (CPU == "generic")270return ARM::ARMArchNames[static_cast<unsigned>(AK)].DefaultFPU;271272return StringSwitch<ARM::FPUKind>(CPU)273#define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \274.Case(NAME, DEFAULT_FPU)275#include "llvm/TargetParser/ARMTargetParser.def"276.Default(ARM::FK_INVALID);277}278279uint64_t ARM::getDefaultExtensions(StringRef CPU, ARM::ArchKind AK) {280if (CPU == "generic")281return ARM::ARMArchNames[static_cast<unsigned>(AK)].ArchBaseExtensions;282283return StringSwitch<uint64_t>(CPU)284#define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \285.Case(NAME, \286ARMArchNames[static_cast<unsigned>(ArchKind::ID)].ArchBaseExtensions | \287DEFAULT_EXT)288#include "llvm/TargetParser/ARMTargetParser.def"289.Default(ARM::AEK_INVALID);290}291292bool ARM::getHWDivFeatures(uint64_t HWDivKind,293std::vector<StringRef> &Features) {294295if (HWDivKind == AEK_INVALID)296return false;297298if (HWDivKind & AEK_HWDIVARM)299Features.push_back("+hwdiv-arm");300else301Features.push_back("-hwdiv-arm");302303if (HWDivKind & AEK_HWDIVTHUMB)304Features.push_back("+hwdiv");305else306Features.push_back("-hwdiv");307308return true;309}310311bool ARM::getExtensionFeatures(uint64_t Extensions,312std::vector<StringRef> &Features) {313314if (Extensions == AEK_INVALID)315return false;316317for (const auto &AE : ARCHExtNames) {318if ((Extensions & AE.ID) == AE.ID && !AE.Feature.empty())319Features.push_back(AE.Feature);320else if (!AE.NegFeature.empty())321Features.push_back(AE.NegFeature);322}323324return getHWDivFeatures(Extensions, Features);325}326327StringRef ARM::getArchName(ARM::ArchKind AK) {328return ARMArchNames[static_cast<unsigned>(AK)].Name;329}330331StringRef ARM::getCPUAttr(ARM::ArchKind AK) {332return ARMArchNames[static_cast<unsigned>(AK)].CPUAttr;333}334335StringRef ARM::getSubArch(ARM::ArchKind AK) {336return ARMArchNames[static_cast<unsigned>(AK)].getSubArch();337}338339unsigned ARM::getArchAttr(ARM::ArchKind AK) {340return ARMArchNames[static_cast<unsigned>(AK)].ArchAttr;341}342343StringRef ARM::getArchExtName(uint64_t ArchExtKind) {344for (const auto &AE : ARCHExtNames) {345if (ArchExtKind == AE.ID)346return AE.Name;347}348return StringRef();349}350351static bool stripNegationPrefix(StringRef &Name) {352return Name.consume_front("no");353}354355StringRef ARM::getArchExtFeature(StringRef ArchExt) {356bool Negated = stripNegationPrefix(ArchExt);357for (const auto &AE : ARCHExtNames) {358if (!AE.Feature.empty() && ArchExt == AE.Name)359return StringRef(Negated ? AE.NegFeature : AE.Feature);360}361362return StringRef();363}364365static ARM::FPUKind findDoublePrecisionFPU(ARM::FPUKind InputFPUKind) {366if (InputFPUKind == ARM::FK_INVALID || InputFPUKind == ARM::FK_NONE)367return ARM::FK_INVALID;368369const ARM::FPUName &InputFPU = ARM::FPUNames[InputFPUKind];370371// If the input FPU already supports double-precision, then there372// isn't any different FPU we can return here.373if (ARM::isDoublePrecision(InputFPU.Restriction))374return InputFPUKind;375376// Otherwise, look for an FPU entry with all the same fields, except377// that it supports double precision.378for (const ARM::FPUName &CandidateFPU : ARM::FPUNames) {379if (CandidateFPU.FPUVer == InputFPU.FPUVer &&380CandidateFPU.NeonSupport == InputFPU.NeonSupport &&381ARM::has32Regs(CandidateFPU.Restriction) ==382ARM::has32Regs(InputFPU.Restriction) &&383ARM::isDoublePrecision(CandidateFPU.Restriction)) {384return CandidateFPU.ID;385}386}387388// nothing found389return ARM::FK_INVALID;390}391392static ARM::FPUKind findSinglePrecisionFPU(ARM::FPUKind InputFPUKind) {393if (InputFPUKind == ARM::FK_INVALID || InputFPUKind == ARM::FK_NONE)394return ARM::FK_INVALID;395396const ARM::FPUName &InputFPU = ARM::FPUNames[InputFPUKind];397398// If the input FPU already is single-precision only, then there399// isn't any different FPU we can return here.400if (!ARM::isDoublePrecision(InputFPU.Restriction))401return InputFPUKind;402403// Otherwise, look for an FPU entry with all the same fields, except404// that it does not support double precision.405for (const ARM::FPUName &CandidateFPU : ARM::FPUNames) {406if (CandidateFPU.FPUVer == InputFPU.FPUVer &&407CandidateFPU.NeonSupport == InputFPU.NeonSupport &&408ARM::has32Regs(CandidateFPU.Restriction) ==409ARM::has32Regs(InputFPU.Restriction) &&410!ARM::isDoublePrecision(CandidateFPU.Restriction)) {411return CandidateFPU.ID;412}413}414415// nothing found416return ARM::FK_INVALID;417}418419bool ARM::appendArchExtFeatures(StringRef CPU, ARM::ArchKind AK,420StringRef ArchExt,421std::vector<StringRef> &Features,422ARM::FPUKind &ArgFPUKind) {423424size_t StartingNumFeatures = Features.size();425const bool Negated = stripNegationPrefix(ArchExt);426uint64_t ID = parseArchExt(ArchExt);427428if (ID == AEK_INVALID)429return false;430431for (const auto &AE : ARCHExtNames) {432if (Negated) {433if ((AE.ID & ID) == ID && !AE.NegFeature.empty())434Features.push_back(AE.NegFeature);435} else {436if ((AE.ID & ID) == AE.ID && !AE.Feature.empty())437Features.push_back(AE.Feature);438}439}440441if (CPU == "")442CPU = "generic";443444if (ArchExt == "fp" || ArchExt == "fp.dp") {445const ARM::FPUKind DefaultFPU = getDefaultFPU(CPU, AK);446ARM::FPUKind FPUKind;447if (ArchExt == "fp.dp") {448const bool IsDP = ArgFPUKind != ARM::FK_INVALID &&449ArgFPUKind != ARM::FK_NONE &&450isDoublePrecision(getFPURestriction(ArgFPUKind));451if (Negated) {452/* If there is no FPU selected yet, we still need to set ArgFPUKind, as453* leaving it as FK_INVALID, would cause default FPU to be selected454* later and that could be double precision one. */455if (ArgFPUKind != ARM::FK_INVALID && !IsDP)456return true;457FPUKind = findSinglePrecisionFPU(DefaultFPU);458if (FPUKind == ARM::FK_INVALID)459FPUKind = ARM::FK_NONE;460} else {461if (IsDP)462return true;463FPUKind = findDoublePrecisionFPU(DefaultFPU);464if (FPUKind == ARM::FK_INVALID)465return false;466}467} else if (Negated) {468FPUKind = ARM::FK_NONE;469} else {470FPUKind = DefaultFPU;471}472ArgFPUKind = FPUKind;473return true;474}475return StartingNumFeatures != Features.size();476}477478ARM::ArchKind ARM::convertV9toV8(ARM::ArchKind AK) {479if (getProfileKind(AK) != ProfileKind::A)480return ARM::ArchKind::INVALID;481if (AK < ARM::ArchKind::ARMV9A || AK > ARM::ArchKind::ARMV9_3A)482return ARM::ArchKind::INVALID;483unsigned AK_v8 = static_cast<unsigned>(ARM::ArchKind::ARMV8_5A);484AK_v8 += static_cast<unsigned>(AK) -485static_cast<unsigned>(ARM::ArchKind::ARMV9A);486return static_cast<ARM::ArchKind>(AK_v8);487}488489StringRef ARM::getDefaultCPU(StringRef Arch) {490ArchKind AK = parseArch(Arch);491if (AK == ArchKind::INVALID)492return StringRef();493494// Look for multiple AKs to find the default for pair AK+Name.495for (const auto &CPU : CPUNames) {496if (CPU.ArchID == AK && CPU.Default)497return CPU.Name;498}499500// If we can't find a default then target the architecture instead501return "generic";502}503504uint64_t ARM::parseHWDiv(StringRef HWDiv) {505StringRef Syn = getHWDivSynonym(HWDiv);506for (const auto &D : HWDivNames) {507if (Syn == D.Name)508return D.ID;509}510return AEK_INVALID;511}512513uint64_t ARM::parseArchExt(StringRef ArchExt) {514for (const auto &A : ARCHExtNames) {515if (ArchExt == A.Name)516return A.ID;517}518return AEK_INVALID;519}520521ARM::ArchKind ARM::parseCPUArch(StringRef CPU) {522for (const auto &C : CPUNames) {523if (CPU == C.Name)524return C.ArchID;525}526return ArchKind::INVALID;527}528529void ARM::fillValidCPUArchList(SmallVectorImpl<StringRef> &Values) {530for (const auto &Arch : CPUNames) {531if (Arch.ArchID != ArchKind::INVALID)532Values.push_back(Arch.Name);533}534}535536StringRef ARM::computeDefaultTargetABI(const Triple &TT, StringRef CPU) {537StringRef ArchName =538CPU.empty() ? TT.getArchName() : getArchName(parseCPUArch(CPU));539540if (TT.isOSBinFormatMachO()) {541if (TT.getEnvironment() == Triple::EABI ||542TT.getOS() == Triple::UnknownOS ||543parseArchProfile(ArchName) == ProfileKind::M)544return "aapcs";545if (TT.isWatchABI())546return "aapcs16";547return "apcs-gnu";548} else if (TT.isOSWindows())549// FIXME: this is invalid for WindowsCE.550return "aapcs";551552// Select the default based on the platform.553switch (TT.getEnvironment()) {554case Triple::Android:555case Triple::GNUEABI:556case Triple::GNUEABIT64:557case Triple::GNUEABIHF:558case Triple::GNUEABIHFT64:559case Triple::MuslEABI:560case Triple::MuslEABIHF:561case Triple::OpenHOS:562return "aapcs-linux";563case Triple::EABIHF:564case Triple::EABI:565return "aapcs";566default:567if (TT.isOSNetBSD())568return "apcs-gnu";569if (TT.isOSFreeBSD() || TT.isOSOpenBSD() || TT.isOSHaiku() ||570TT.isOHOSFamily())571return "aapcs-linux";572return "aapcs";573}574}575576StringRef ARM::getARMCPUForArch(const llvm::Triple &Triple, StringRef MArch) {577if (MArch.empty())578MArch = Triple.getArchName();579MArch = llvm::ARM::getCanonicalArchName(MArch);580581// Some defaults are forced.582switch (Triple.getOS()) {583case llvm::Triple::FreeBSD:584case llvm::Triple::NetBSD:585case llvm::Triple::OpenBSD:586case llvm::Triple::Haiku:587if (!MArch.empty() && MArch == "v6")588return "arm1176jzf-s";589if (!MArch.empty() && MArch == "v7")590return "cortex-a8";591break;592case llvm::Triple::Win32:593// FIXME: this is invalid for WindowsCE594if (llvm::ARM::parseArchVersion(MArch) <= 7)595return "cortex-a9";596break;597case llvm::Triple::IOS:598case llvm::Triple::MacOSX:599case llvm::Triple::TvOS:600case llvm::Triple::WatchOS:601case llvm::Triple::DriverKit:602case llvm::Triple::XROS:603if (MArch == "v7k")604return "cortex-a7";605break;606default:607break;608}609610if (MArch.empty())611return StringRef();612613StringRef CPU = llvm::ARM::getDefaultCPU(MArch);614if (!CPU.empty() && CPU != "invalid")615return CPU;616617// If no specific architecture version is requested, return the minimum CPU618// required by the OS and environment.619switch (Triple.getOS()) {620case llvm::Triple::Haiku:621return "arm1176jzf-s";622case llvm::Triple::NetBSD:623switch (Triple.getEnvironment()) {624case llvm::Triple::EABI:625case llvm::Triple::EABIHF:626case llvm::Triple::GNUEABI:627case llvm::Triple::GNUEABIHF:628return "arm926ej-s";629default:630return "strongarm";631}632case llvm::Triple::NaCl:633case llvm::Triple::OpenBSD:634return "cortex-a8";635default:636switch (Triple.getEnvironment()) {637case llvm::Triple::EABIHF:638case llvm::Triple::GNUEABIHF:639case llvm::Triple::GNUEABIHFT64:640case llvm::Triple::MuslEABIHF:641return "arm1176jzf-s";642default:643return "arm7tdmi";644}645}646647llvm_unreachable("invalid arch name");648}649650void ARM::PrintSupportedExtensions(StringMap<StringRef> DescMap) {651outs() << "All available -march extensions for ARM\n\n"652<< " " << left_justify("Name", 20)653<< (DescMap.empty() ? "\n" : "Description\n");654for (const auto &Ext : ARCHExtNames) {655// Extensions without a feature cannot be used with -march.656if (!Ext.Feature.empty()) {657std::string Description = DescMap[Ext.Name].str();658outs() << " "659<< format(Description.empty() ? "%s\n" : "%-20s%s\n",660Ext.Name.str().c_str(), Description.c_str());661}662}663}664665666