summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff options
context:
space:
mode:
authorgkoehler <gkoehler@openbsd.org>2020-06-04 22:33:17 +0000
committergkoehler <gkoehler@openbsd.org>2020-06-04 22:33:17 +0000
commit21ddc59af3b7bf4d9a666653828d7e9ee41cba12 (patch)
tree9c09f3466c562bb44022601193dce4463be286cc /gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
parentReset wrapped flag when clearing or moving lines, GitHub issue 2215. (diff)
downloadwireguard-openbsd-21ddc59af3b7bf4d9a666653828d7e9ee41cba12.tar.xz
wireguard-openbsd-21ddc59af3b7bf4d9a666653828d7e9ee41cba12.zip
Set max atomic size for PowerPC.
32-bit PowerPC doesn't have instructions for lock-free atomic ops on 8-byte values, and needs libcalls like __atomic_fetch_add_8(). In code like "_Atomic long long a; a++;", clang doesn't emit a libcall. This was causing linker errors on symbols like __sync_fetch_and_add_8. Now that LLVM knows the max atomic size, its AtomicExpandPass changes these 8-byte ops into libcalls. ok mortimer@
Diffstat (limited to 'gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp')
-rw-r--r--gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 60fa5e4afef..8fd8548b99d 100644
--- a/gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/gnu/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -1034,7 +1034,10 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM,
setOperationAction(ISD::READCYCLECOUNTER, MVT::i64, isPPC64 ? Legal : Custom);
- if (!isPPC64) {
+ if (isPPC64)
+ setMaxAtomicSizeInBitsSupported(64);
+ else {
+ setMaxAtomicSizeInBitsSupported(32);
setOperationAction(ISD::ATOMIC_LOAD, MVT::i64, Expand);
setOperationAction(ISD::ATOMIC_STORE, MVT::i64, Expand);
}