[clang] [ARM] Using cp15 while mtp =auto and arch is arm_arch6k and support thumb2 (PR #130027)
Vladi Krapp via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 6 03:23:00 PST 2025
================
@@ -208,10 +208,17 @@ bool arm::useAAPCSForMachO(const llvm::Triple &T) {
bool arm::isHardTPSupported(const llvm::Triple &Triple) {
int Ver = getARMSubArchVersionNumber(Triple);
llvm::ARM::ArchKind AK = llvm::ARM::parseArch(Triple.getArchName());
- return Triple.isARM() || AK == llvm::ARM::ArchKind::ARMV6T2 ||
- (Ver >= 7 && AK != llvm::ARM::ArchKind::ARMV8MBaseline);
+ return Triple.isARM() || (Ver >= 7 && AK != llvm::ARM::ArchKind::ARMV8MBaseline);
}
+
+// We follow GCC mtp=auto when arch is arm_arch6k and support thumb2
+bool arm::isHardTPAndThumb2(const llvm::Triple &Triple) {
+ llvm::ARM::ArchKind AK = llvm::ARM::parseArch(Triple.getArchName());
+ return Triple.isARM() && AK >= llvm::ARM::ArchKind::ARMV6K && AK != llvm::ARM::ArchKind::ARMV8MBaseline;
----------------
VladiKrapp-Arm wrote:
I've edited my suggestion a bit to include all architectures known to support hardware thread pointer.
These are:
Any where version is 7 and above, excluding any MProfile
Version 6 for only ARMV6T2, ARMv6K and ARMv6KZ
https://github.com/llvm/llvm-project/pull/130027
More information about the cfe-commits
mailing list