diff options
| author | Amara Emerson <amara.emerson@arm.com> | 2017-07-13 15:36:01 +0000 |
|---|---|---|
| committer | Amara Emerson <amara.emerson@arm.com> | 2017-07-13 15:36:01 +0000 |
| commit | ebe02904d4b91f3445b8e358588bc3237e28ec46 (patch) | |
| tree | 91f89e002d83ae7a51ba64663ad75c8b975663d6 /clang/lib/Basic | |
| parent | fe3ff69fafc1c252f3ec390133206f11e7433b21 (diff) | |
| download | bcm5719-llvm-ebe02904d4b91f3445b8e358588bc3237e28ec46.tar.gz bcm5719-llvm-ebe02904d4b91f3445b8e358588bc3237e28ec46.zip | |
[AArch64] Add support for handling the +sve target feature.
This also adds the appropriate predefine for SVE if enabled.
Differential Revision: https://reviews.llvm.org/D35118
llvm-svn: 307919
Diffstat (limited to 'clang/lib/Basic')
| -rw-r--r-- | clang/lib/Basic/Targets.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 50b4fc34ad3..54188121788 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -6251,7 +6251,8 @@ class AArch64TargetInfo : public TargetInfo { enum FPUModeEnum { FPUMode, - NeonMode + NeonMode = (1 << 0), + SveMode = (1 << 1) }; unsigned FPU; @@ -6385,12 +6386,15 @@ public: Builder.defineMacro("__ARM_SIZEOF_MINIMAL_ENUM", Opts.ShortEnums ? "1" : "4"); - if (FPU == NeonMode) { + if (FPU & NeonMode) { Builder.defineMacro("__ARM_NEON", "1"); // 64-bit NEON supports half, single and double precision operations. Builder.defineMacro("__ARM_NEON_FP", "0xE"); } + if (FPU & SveMode) + Builder.defineMacro("__ARM_FEATURE_SVE", "1"); + if (CRC) Builder.defineMacro("__ARM_FEATURE_CRC32", "1"); @@ -6426,7 +6430,8 @@ public: return Feature == "aarch64" || Feature == "arm64" || Feature == "arm" || - (Feature == "neon" && FPU == NeonMode); + (Feature == "neon" && (FPU & NeonMode)) || + (Feature == "sve" && (FPU & SveMode)); } bool handleTargetFeatures(std::vector<std::string> &Features, @@ -6440,7 +6445,9 @@ public: for (const auto &Feature : Features) { if (Feature == "+neon") - FPU = NeonMode; + FPU |= NeonMode; + if (Feature == "+sve") + FPU |= SveMode; if (Feature == "+crc") CRC = 1; if (Feature == "+crypto") |

