[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 01:49:11 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:
The check here is incorrect, if nothing else, the check should be '!isMProfile(Tripple)', as no M Profile chips support HardTP.
Something along the lines of
```
int Ver = getARMSubArchVersionNumber(Triple);
llvm::ARM::ArchKind AK = llvm::ARM::parseArch(Triple.getArchName());
return Triple.isARM() || AK == llvm::ARM::ArchKind::ARMV6T2 ||
(Ver >= 7 && !isARMMProfile(Triple));
```
But maybe this should be done in the original isHardTPSupported?
https://github.com/llvm/llvm-project/pull/130027
More information about the cfe-commits
mailing list