aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorSimon Tatham <simon.tatham@arm.com>2025-07-22 08:53:45 +0100
committerGitHub <noreply@github.com>2025-07-22 08:53:45 +0100
commit34f59d79209268eca9c63ccc7646128f2dc52fe3 (patch)
tree4a20cdbe3b7c53ed3d25bc894a5ba66ee794c820 /clang/lib/Basic
parenta7a1df8f72ac6e3a68ec53584107be6542d6666b (diff)
downloadllvm-34f59d79209268eca9c63ccc7646128f2dc52fe3.zip
llvm-34f59d79209268eca9c63ccc7646128f2dc52fe3.tar.gz
llvm-34f59d79209268eca9c63ccc7646128f2dc52fe3.tar.bz2
[Clang][ARM] Fix __ARM_FEATURE_LDREX on Armv8-M (#149538)
The Armv8-M architecture doesn't have the LDREXD and STREXD instructions, for exclusive load/store of a 64-bit quantity split across two registers. But the `__ARM_FEATURE_LDREX` macro was set to a value that claims it does, because the case for Armv8 was missing a check for M profile. The Armv7 case got it right, so I've just made the two cases the same.
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Targets/ARM.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Basic/Targets/ARM.cpp b/clang/lib/Basic/Targets/ARM.cpp
index 7ff8e51..29de34bb 100644
--- a/clang/lib/Basic/Targets/ARM.cpp
+++ b/clang/lib/Basic/Targets/ARM.cpp
@@ -623,13 +623,15 @@ bool ARMTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
LDREX = LDREX_W;
break;
case 7:
+ case 8:
if (ArchProfile == llvm::ARM::ProfileKind::M)
LDREX = LDREX_W | LDREX_H | LDREX_B;
else
LDREX = LDREX_D | LDREX_W | LDREX_H | LDREX_B;
break;
- case 8:
case 9:
+ assert(ArchProfile != llvm::ARM::ProfileKind::M &&
+ "No Armv9-M architectures defined");
LDREX = LDREX_D | LDREX_W | LDREX_H | LDREX_B;
}