[PATCH] D113026: [ARM] reject -mtp=cp15 if target subarch does not support it
Ard Biesheuvel via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 2 11:32:11 PDT 2021
ardb marked 2 inline comments as done.
ardb added inline comments.
================
Comment at: clang/lib/Driver/ToolChains/Arch/ARM.cpp:160-161
+ if (ThreadPointer == ReadTPMode::Cp15 &&
+ getARMSubArchVersionNumber(Triple) < 7 &&
+ llvm::ARM::parseArch(Triple.getArchName()) != llvm::ARM::ArchKind::ARMV6T2) {
+ D.Diag(diag::err_target_unsupported_tp_hard) << Triple.getArchName();
----------------
nickdesaulniers wrote:
> The last two checks seems redundant (`getARMSubArchVersionNumber(Triple) < 7 && llvm::ARM::parseArch(Triple.getArchName()) != llvm::ARM::ArchKind::ARMV6T2`). If the `ArchKind` was `ARMV6T2` then `getARMSubArchVersionNumber` should return `6`.
>
> Or do we want to support ARMv6T2, in which case the patch description should be edited:
>
> > ensure that -mtp=cp15 is rejected for ARMv6T2 or earlier.
>
> s/ARMv6T2 or earlier/ARMv6 (except ARMv6T2) or earlier/
> The last two checks seems redundant (`getARMSubArchVersionNumber(Triple) < 7 && llvm::ARM::parseArch(Triple.getArchName()) != llvm::ARM::ArchKind::ARMV6T2`). If the `ArchKind` was `ARMV6T2` then `getARMSubArchVersionNumber` should return `6`.
>
> Or do we want to support ARMv6T2, in which case the patch description should be edited:
>
> > ensure that -mtp=cp15 is rejected for ARMv6T2 or earlier.
>
> s/ARMv6T2 or earlier/ARMv6 (except ARMv6T2) or earlier/
Yeah, the latter. ARMv6T2 is the first core that implements Thumb2,
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113026/new/
https://reviews.llvm.org/D113026
More information about the cfe-commits
mailing list