File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -192,8 +192,10 @@ void RISCVTargetInfo::getTargetDefines(const LangOptions &Opts,
192192 Builder.defineMacro (" __riscv_muldiv" );
193193 }
194194
195- if (ISAInfo->hasExtension (" a" )) {
195+ if (ISAInfo->hasExtension (" a" ))
196196 Builder.defineMacro (" __riscv_atomic" );
197+
198+ if (ISAInfo->hasExtension (" a" ) || ISAInfo->hasExtension (" zalrsc" )) {
197199 Builder.defineMacro (" __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1" );
198200 Builder.defineMacro (" __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2" );
199201 Builder.defineMacro (" __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4" );
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ class LLVM_LIBRARY_VISIBILITY RISCV32TargetInfo : public RISCVTargetInfo {
195195 void setMaxAtomicWidth () override {
196196 MaxAtomicPromoteWidth = 128 ;
197197
198- if (ISAInfo->hasExtension (" a" ))
198+ if (ISAInfo->hasExtension (" a" ) || ISAInfo-> hasExtension ( " zalrsc " ) )
199199 MaxAtomicInlineWidth = 32 ;
200200 }
201201};
@@ -225,7 +225,7 @@ class LLVM_LIBRARY_VISIBILITY RISCV64TargetInfo : public RISCVTargetInfo {
225225 void setMaxAtomicWidth () override {
226226 MaxAtomicPromoteWidth = 128 ;
227227
228- if (ISAInfo->hasExtension (" a" ))
228+ if (ISAInfo->hasExtension (" a" ) || ISAInfo-> hasExtension ( " zalrsc " ) )
229229 MaxAtomicInlineWidth = 64 ;
230230 }
231231};
You can’t perform that action at this time.
0 commit comments