summaryrefslogtreecommitdiff
path: root/llvm/lib/Support/TargetParser.cpp
AgeCommit message (Collapse)Author
2018-06-29[ARM][AArch64] Armv8.4-A EnablementSjoerd Meijer
Initial patch adding assembly support for Armv8.4-A. Besides adding v8.4 as a supported architecture to the usual places, this also adds target features for the different crypto algorithms. Armv8.4-A introduced new crypto algorithms, made them optional, and allows different combinations: - none of the v8.4 crypto functions are supported, which is independent of the implementation of the Armv8.0 SHA1 and SHA2 instructions. - the v8.4 SHA512 and SHA3 support is implemented, in this case the Armv8.0 SHA1 and SHA2 instructions must also be implemented. - the v8.4 SM3 and SM4 support is implemented, which is independent of the implementation of the Armv8.0 SHA1 and SHA2 instructions. - all of the v8.4 crypto functions are supported, in this case the Armv8.0 SHA1 and SHA2 instructions must also be implemented. The v8.4 crypto instructions are added to AArch64 only, and not AArch32, and are made optional extensions to Armv8.2-A. The user-facing Clang options will map on these new target features, their naming will be compatible with GCC and added in follow-up patches. The Armv8.4-A instruction sets can be downloaded here: https://developer.arm.com/products/architecture/a-profile/exploration-tools Differential Revision: https://reviews.llvm.org/D48625 llvm-svn: 335953
2018-04-04AArch64: Implement support for the shadowcallstack attribute.Peter Collingbourne
The implementation of shadow call stack on aarch64 is quite different to the implementation on x86_64. Instead of reserving a segment register for the shadow call stack, we reserve the platform register, x18. Any function that spills lr to sp also spills it to the shadow call stack, a pointer to which is stored in x18. Differential Revision: https://reviews.llvm.org/D45239 llvm-svn: 329236
2018-02-08[ARM] Add 'fillValidCPUArchList' to ARM targetsErich Keane
This is a support change for a CFE change (https://reviews.llvm.org/D42978) that allows march and -target-cpu to list the valid targets in a note. The changes are limited to the ARM/AArch64, since this is the only target that gets the CPU list from LLVM. llvm-svn: 324623
2018-01-17[Support] Return an enum instead of an unsigned; NFC.George Burgess IV
We seem to be (logically) returning ArchExtKinds here in all cases, so the return type should reflect that. The static_cast is necessary because `A.ID` is actually an `unsigned`, presumably since we use `decltype(A)` to represent extended attributes for both ARM and AArch64, which use distinct `ArchExtKinds`. We can't trivially make the same change for ARM, because one of the values it returns is the bitwise-or of two `ARM::ArchExtKind`s. llvm-svn: 322613
2018-01-09[TargetParser] Add missing armv8l ARMv8 variant.Florian Hahn
This change adds the missing armv8l variant as an alias of armv8 architecture. The issue was observed with several regressions in validation on armv8l hardware (for instance ExecutionEngine/frem.ll failed due to lack of neon fpu). Tested with regression testsuite passed without regression on ARM and x86_64. Patch by Yvan Roux. Reviewers: rengolin, rogfer01, olista01, fhahn Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D41859 llvm-svn: 322098
2017-12-20[TargetParser] Check size before accessing architecture version.Florian Hahn
Summary: This fixes a crash when invalid -march options like `armv` are provided. Based on a patch by Will Lovett. Reviewers: rengolin, samparker, mcrosier Reviewed By: samparker Subscribers: aemerson, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D41429 llvm-svn: 321166
2017-12-19Silence a bunch of implicit fallthrough warningsAdrian Prantl
llvm-svn: 321114
2017-12-13Remove redundant includes from lib/Support.Michael Zolotukhin
llvm-svn: 320627
2017-08-24[TargetParser][AArch64] Add support for RDM feature in the target parser.Chad Rosier
Differential Revision: https://reviews.llvm.org/D37081 llvm-svn: 311659
2017-08-21[ARM][AArch64] Cortex-A75 and Cortex-A55 supportSam Parker
This patch introduces support for Cortex-A75 and Cortex-A55, Arm's latest big.LITTLE A-class cores. They implement the ARMv8.2-A architecture, including the cryptography and RAS extensions, plus the optional dot product extension. They also implement the RCpc AArch64 extension from ARMv8.3-A. Cortex-A75: https://developer.arm.com/products/processors/cortex-a/cortex-a75 Cortex-A55: https://developer.arm.com/products/processors/cortex-a/cortex-a55 Differential Revision: https://reviews.llvm.org/D36667 llvm-svn: 311316
2017-08-10[ARM][AArch64] ARMv8.3-A enablementSam Parker
The beta ARMv8.3 ISA specifications have been released for AArch64 and AArch32, these can be found at: https://developer.arm.com/products/architecture/a-profile/exploration-tools An introduction to this architecture update can be found at: https://community.arm.com/processors/b/blog/posts/armv8-a-architecture-2016-additions This patch is the first in a series which will add ARM v8.3-A support in LLVM and Clang. It adds the necessary changes that create targets for both the ARM and AArch64 backends. Differential Revision: https://reviews.llvm.org/D36514 llvm-svn: 310561
2017-07-27[TargetParser] Use enum classes for various ARM kind enums.Florian Hahn
Summary: Using c++11 enum classes ensures that only valid enum values are used for ArchKind, ProfileKind, VersionKind and ISAKind. This removes the need for checks that the provided values map to a proper enum value, allows us to get rid of AK_LAST and prevents comparing values from different enums. It also removes a bunch of static_cast from unsigned to enum values and vice versa, at the cost of introducing static casts to access AArch64ARCHNames and ARMARCHNames by ArchKind. FPUKind and ArchExtKind are the only remaining old-style enum in TargetParser.h. I think it's beneficial to keep ArchExtKind as old-style enum, but FPUKind can be converted too, but this patch is quite big, so could do this in a follow-up patch. I could also split this patch up a bit, if people would prefer that. Reviewers: rengolin, javed.absar, chandlerc, rovka Reviewed By: rovka Subscribers: aemerson, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D35882 llvm-svn: 309287
2017-07-13[AArch64] Add an SVE target feature to the backend and TargetParser.Amara Emerson
The feature will be used properly once assembler/disassembler support begins to land. llvm-svn: 307917
2017-06-30Unified logic for computing target ABI in backend and front end by moving ↵Eric Christopher
this common code to Support/TargetParser. Modeled Triple::GNU after front end code (aapcs abi) and updated tests that expect apcs abi. Based heavily on a patch by Ana Pazos! llvm-svn: 306768
2017-05-03[AArch64] Fix variable name ambiguity in r302078.Ahmed Bougacha
ArchKind is passed to the function, but it's also a type. llvm-svn: 302081
2017-05-03[AArch64] Make the TargetParser add CPU exts provided by the arch.Ahmed Bougacha
Otherwise, each CPU has to manually specify the extensions it supports, even though they have to be a superset of the base arch extensions. And when there's redundant data there's stale data, so most of the CPUs lie about the features they support (almost none lists AEK_FP). Instead, do the saner thing: add the optional extensions on top of the base extensions provided by the architecture. The ARM TargetParser has the same behavior. Differential Revision: https://reviews.llvm.org/D32780 llvm-svn: 302078
2017-04-20[ARM] Rename HW div feature to HW div Thumb. NFCI.Diana Picus
The hardware div feature refers only to Thumb, but because of its name it is tempting to use it to check for hardware division in general, which may cause problems in ARM mode. See https://reviews.llvm.org/D32005. This patch adds "Thumb" to its name, to make its scope clear. One notable place where I haven't made the change is in the feature flag (used with -mattr), which is still hwdiv. Changing it would also require changes in a lot of tests, including clang tests, and it doesn't seem like it's worth the effort. Differential Revision: https://reviews.llvm.org/D32160 llvm-svn: 300827
2017-02-17[AArch64] Add Cavium ThunderX supportJoel Jones
This set of patches adds support for Cavium ThunderX ARM64 processors: * ThunderX * ThunderX T81 * ThunderX T83 * ThunderX T88 Patch by Stefan Teleman Differential Revision: https://reviews.llvm.org/D28891 llvm-svn: 295475
2017-02-09[ARM] Add support for armv7ve triple in llvm (PR31358).George Burgess IV
Gcc supports target armv7ve which is armv7-a with virtualization extensions. This change adds support for this in llvm for gcc compatibility. Also remove redundant FeatureHWDiv, FeatureHWDivARM for a few models as this is specified automatically by FeatureVirtualization. Patch by Manoj Gupta. Differential Revision: https://reviews.llvm.org/D29472 llvm-svn: 294661
2016-10-07[ARM]: Add Cortex-R52 target to LLVMJaved Absar
This patch adds Cortex-R52, the new ARM real-time processor, to LLVM. Cortex-R52 implements the ARMv8-R architecture. llvm-svn: 283542
2016-10-07Use StringReg in TargetParser APIs (NFC)Mehdi Amini
llvm-svn: 283527
2016-07-28Add unittests to {ARM | AArch64}TargetParser.Zijiao Ma
Add unittest to {ARM | AArch64}TargetParser,and by the way correct problems as below: 1.Correct a incorrect indexing problem in AArch64TargetParser. The architecture enumeration is shared across ARM and AArch64 in original implementation.But In the code,I just used the index which was offset by the ARM, and this would index into the array incorrectly. To make AArch64 has its own arch enum,or we will do a lot of slowly iterating. 2.Correct a spelling error. The parameter of llvm::AArch64::getArchExtName. 3.Correct a writing mistake, in llvm::ARM::parseArchISA. Differential Revision: https://reviews.llvm.org/D21785 llvm-svn: 276957
2016-06-13[AArch64] Add RAS extensions support in AArch64TargetParser.Zijiao Ma
RAS extensions are part of ARMv8.2,now supported in Clang. Add RAS extensions support in AArch64TargetParser. llvm-svn: 272533
2016-06-08Support: correct AArch64 TargetParser implementationSaleem Abdulrasool
The architecture enumeration is shared across ARM and AArch64. However, the data is not. The code incorrectly would index into the array using the architecture index which was offset by the ARMv7 architecture enumeration. We do not have a marker for indicating the architectural family to which the enumeration belongs so we cannot be clever about offsetting the index (at least it is not immediately apparent to me). Instead, fall back to the tried-and-true method of slowly iterating the array (its not a large array, so the impact of this is not too high). Because of the incorrect indexing, if we were lucky, we would crash, but usually we would return an invalid StringRef. We did not have any tests for the AArch64 target parser previously;. Extend the previous tests I had added for ARM to cover AArch64 for ensuring that we return expected StringRefs. Take the opportunity to change some iterator types to references. This work is needed to support parsing `.arch name` directives in the AArch64 target asm parser. llvm-svn: 272145
2016-05-25[AArch64] Adding a TargetParser for AArch64Renato Golin
There's already a ARMTargetParser,now adding a similar one for aarch64. so we can use it to do ARCH/CPU/FPU parsing in clang and llvm, instead of string comparison. Patch by Jojo Ma. llvm-svn: 270687
2016-03-05Support: catch invalid accessesSaleem Abdulrasool
It is possible to invoke these methods on an invalid input resulting in an invalid substring construction. It seems that we do not have unit tests for these methods. Tests to ensure that the invalid call is caught to follow in clang. Resolves PR26839. llvm-svn: 262778
2016-01-15[ARM] Add ARMv8-M Baseline/Mainline LLVM targetingBradley Smith
llvm-svn: 257878
2015-12-14Reordering fields to reduce padding in LLVM. NFCBen Craig
llvm-svn: 255554
2015-12-01[ARM] Add ARMv8.2-A to TargetParserOliver Stannard
Add ARMv8.2-A to TargetParser, so that it can be used by the clang command-line options and the .arch directive. Most testing of this will be done in clang, checking that the command-line options that this enables work. Differential Revision: http://reviews.llvm.org/D15037 llvm-svn: 254400
2015-11-20Handle ARMv6-J as an alias, instead of fake architectureArtyom Skrobov
Summary: This follows D14577 to treat ARMv6-J as an alias for ARMv6, instead of an architecture in its own right. The functional change is that the default CPU when targeting ARMv6-J changes from arm1136j-s to arm1136jf-s, which is currently used as the default CPU for ARMv6; both are, in fact, ARMv6-J CPUs. The J-bit (Jazelle support) is irrelevant to LLVM, and it doesn't affect code generation, attributes, optimizations, or anything else, apart from selecting the default CPU. Reviewers: rengolin, logan, compnerd Subscribers: aemerson, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D14755 llvm-svn: 253675
2015-11-19TargetParser.cpp: Fixup -- StringRef::startswith() is better here. NFC.NAKAMURA Takumi
llvm-svn: 253570
2015-11-19llvm/lib/Support/TargetParser.cpp: Rework llvm::ARM::getArchExtFeature() to ↵NAKAMURA Takumi
avoid abuse of Twine in r253470. llvm-svn: 253566
2015-11-18[ARM] Add +feature names to TargetParser extensions tableBradley Smith
llvm-svn: 253470
2015-11-16Handle ARMv6KZ namingArtyom Skrobov
Summary: * ARMv6KZ is the "canonical" name, given in the ARMARM * ARMv6Z is an "official abbreviation" for it, mentioned in the ARMARM * ARMv6ZK is a popular misspelling, which we should support as an alias. The patch corrects the handling of the names. Functional changes: * ARMv6Z no longer treated as an architecture in its own right * ARMv6ZK renamed to ARMv6KZ, accepting ARMv6ZK as an alias * arm1176jz-s and arm1176jzf-s recognized as ARMv6ZK, instead of ARMv6K * default ARMv6K CPU changed to arm1176j-s Reviewers: rengolin, logan, compnerd Subscribers: aemerson, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D14568 llvm-svn: 253206
2015-11-16NFC refactorings in lib/Support/TargetParser.cppArtyom Skrobov
Summary: * declare FPUNames, ARCHNames, ARCHExtNames, HWDivNames, CPUNames as static const * implement getDefaultExtensions with a StringSwitch, in the same way getDefaultFPU is implemented Reviewers: rengolin Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14648 llvm-svn: 253201
2015-11-16[ARM] Allow TargetParser to accurately target architecturesBradley Smith
Instead of defaulting to an empty string, we want to default to the CPU 'generic' in the case of no valid default CPU being found, (as long as the architecture is actually valid). In order to do this we add a default FPU for each architecture, as well as falling back to architecture defaults for extensions and FPU in the case of a generic CPU is specified. llvm-svn: 253198
2015-11-12Cull non-standard variants of ARM architectures (NFC)Artyom Skrobov
Summary: This patch changes ARMV5, ARMV5E, ARMV6SM, ARMV6HL, ARMV7, ARMV7L, ARMV7HL, ARMV7EM to be treated as aliases for the corresponding standard architectures, instead of as actual architectures. Reviewers: rengolin Subscribers: aemerson, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D14577 llvm-svn: 252903
2015-10-28ARM: support .watchos_version_min and .tvos_version_min.Tim Northover
These MachO file directives are used by linkers and other tools to provide compatibility information, much like the existing .ios_version_min and .macosx_version_min. llvm-svn: 251569
2015-10-23[ARM] Renaming +t2dsp feature into +dsp, as discussed on llvm-devArtyom Skrobov
llvm-svn: 251125
2015-09-24[ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.defArtyom Skrobov
Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in a hand-rolled tricky condition block in tools/clang/lib/Basic/Targets.cpp, with a FIXME: attached. This patch changes the handling of +t2dsp to be in line with other architecture extensions. Following a revert of r248152 and new review comments, this patch also includes renaming FeatureDSPThumb2 -> FeatureDSP, hasThumb2DSP() -> hasDSP(), etc. The spelling of "t2dsp" is preserved, pending a further investigation of its possible external usage. Differential Revision: http://reviews.llvm.org/D12937 llvm-svn: 248519
2015-09-21Revert "[ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.def"James Molloy
This was committed without the code review (http://reviews.llvm.org/D12937) being approved. This reverts commit r248152. llvm-svn: 248174
2015-09-21[ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.defArtyom Skrobov
Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in a hand-rolled tricky condition block in tools/clang/lib/Basic/Targets.cpp, with a FIXME: attached. This patch changes the handling of +t2dsp to be in line with other architecture extensions. Following review comments, also updating the description of FeatureDSPThumb2 in ARM.td. Differential Revision: http://reviews.llvm.org/D12937 llvm-svn: 248152
2015-09-05Added arch extensions and default target features in TargetParser.Alexandros Lamprineas
Differential: http://reviews.llvm.org/D11590 llvm-svn: 246930
2015-08-30Remove a linear walk to find the default FPU for a given CPU by directlyChandler Carruth
expanding the .def file within a StringSwitch. llvm-svn: 246377
2015-08-30Teach the target parsing framework to directly compute the length of allChandler Carruth
of its strings when expanding the string literals from the macros, and push all of the APIs to be StringRef instead of C-string APIs. This (remarkably) removes a very non-trivial number of strlen calls. It even deletes code and complexity from one of the primary users -- Clang. llvm-svn: 246374
2015-08-30Refactor the ARM target parsing to use a def file with macros to expandChandler Carruth
the necessary tables. This will allow me to restructure the code and structures using this to be significantly more efficient. It also removes the duplication of the list of several enumerators. It also enshrines that the order of enumerators match the order of the entries in the tables, something the implementation code actually uses. No functionality changed (yet). llvm-svn: 246370
2015-08-30[Triple] Use clang-format to normalize the formatting of the ARM targetChandler Carruth
parsing logic prior to making substantial changes to it. This parsing logic is incredibly wasteful, so I'm planning to rewrite it. Just unittesting the triple parsing logic spends well over 80% of its time in the ARM parsing logic, and others have measured significant time spent here in real production compiles. Stay tuned... llvm-svn: 246369
2015-08-30[Triple] Stop abusing a class to have only static methods and just useChandler Carruth
the namespace that we are already using for the enums that are produced by the parsing. llvm-svn: 246367
2015-08-21[ARM] Fix MachO CPU Subtype selectionVedant Kumar
Differential Revision: http://reviews.llvm.org/D12040 llvm-svn: 245744
2015-08-14Revert "[ARM] Fix MachO CPU Subtype selection"Renato Golin
This reverts commit r245081, as it breaks many builds. llvm-svn: 245086