diff options
Diffstat (limited to 'lib/Driver/ToolChains/Arch/AArch64.cpp')
-rw-r--r-- | lib/Driver/ToolChains/Arch/AArch64.cpp | 69 |
1 files changed, 62 insertions, 7 deletions
diff --git a/lib/Driver/ToolChains/Arch/AArch64.cpp b/lib/Driver/ToolChains/Arch/AArch64.cpp index 71e55fe79e..35d11f4e2d 100644 --- a/lib/Driver/ToolChains/Arch/AArch64.cpp +++ b/lib/Driver/ToolChains/Arch/AArch64.cpp @@ -1,9 +1,8 @@ //===--- AArch64.cpp - AArch64 (not ARM) Helpers for Tools ------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -195,6 +194,18 @@ void aarch64::getAArch64TargetFeatures(const Driver &D, Features.push_back("-neon"); } + if (Arg *A = Args.getLastArg(options::OPT_mtp_mode_EQ)) { + StringRef Mtp = A->getValue(); + if (Mtp == "el3") + Features.push_back("+tpidr-el3"); + else if (Mtp == "el2") + Features.push_back("+tpidr-el2"); + else if (Mtp == "el1") + Features.push_back("+tpidr-el1"); + else if (Mtp != "el0") + D.Diag(diag::err_drv_invalid_mtp) << A->getAsString(Args); + } + // En/disable crc if (Arg *A = Args.getLastArg(options::OPT_mcrc, options::OPT_mnocrc)) { if (A->getOption().matches(options::OPT_mcrc)) @@ -208,7 +219,7 @@ void aarch64::getAArch64TargetFeatures(const Driver &D, // TargetParser rewrite. const auto ItRNoFullFP16 = std::find(Features.rbegin(), Features.rend(), "-fullfp16"); const auto ItRFP16FML = std::find(Features.rbegin(), Features.rend(), "+fp16fml"); - if (std::find(Features.begin(), Features.end(), "+v8.4a") != Features.end()) { + if (llvm::is_contained(Features, "+v8.4a")) { const auto ItRFullFP16 = std::find(Features.rbegin(), Features.rend(), "+fullfp16"); if (ItRFullFP16 < ItRNoFullFP16 && ItRFullFP16 < ItRFP16FML) { // Only entangled feature that can be to the right of this +fullfp16 is -fp16fml. @@ -218,8 +229,7 @@ void aarch64::getAArch64TargetFeatures(const Driver &D, } else goto fp16_fml_fallthrough; - } - else { + } else { fp16_fml_fallthrough: // In both of these cases, putting the 'other' feature on the end of the vector will // result in the same effect as placing it immediately after the current feature. @@ -336,12 +346,57 @@ fp16_fml_fallthrough: if (Args.hasArg(options::OPT_ffixed_x7)) Features.push_back("+reserve-x7"); + if (Args.hasArg(options::OPT_ffixed_x9)) + Features.push_back("+reserve-x9"); + + if (Args.hasArg(options::OPT_ffixed_x10)) + Features.push_back("+reserve-x10"); + + if (Args.hasArg(options::OPT_ffixed_x11)) + Features.push_back("+reserve-x11"); + + if (Args.hasArg(options::OPT_ffixed_x12)) + Features.push_back("+reserve-x12"); + + if (Args.hasArg(options::OPT_ffixed_x13)) + Features.push_back("+reserve-x13"); + + if (Args.hasArg(options::OPT_ffixed_x14)) + Features.push_back("+reserve-x14"); + + if (Args.hasArg(options::OPT_ffixed_x15)) + Features.push_back("+reserve-x15"); + if (Args.hasArg(options::OPT_ffixed_x18)) Features.push_back("+reserve-x18"); if (Args.hasArg(options::OPT_ffixed_x20)) Features.push_back("+reserve-x20"); + if (Args.hasArg(options::OPT_ffixed_x21)) + Features.push_back("+reserve-x21"); + + if (Args.hasArg(options::OPT_ffixed_x22)) + Features.push_back("+reserve-x22"); + + if (Args.hasArg(options::OPT_ffixed_x23)) + Features.push_back("+reserve-x23"); + + if (Args.hasArg(options::OPT_ffixed_x24)) + Features.push_back("+reserve-x24"); + + if (Args.hasArg(options::OPT_ffixed_x25)) + Features.push_back("+reserve-x25"); + + if (Args.hasArg(options::OPT_ffixed_x26)) + Features.push_back("+reserve-x26"); + + if (Args.hasArg(options::OPT_ffixed_x27)) + Features.push_back("+reserve-x27"); + + if (Args.hasArg(options::OPT_ffixed_x28)) + Features.push_back("+reserve-x28"); + if (Args.hasArg(options::OPT_fcall_saved_x8)) Features.push_back("+call-saved-x8"); |