Skip to content

Commit

Permalink
fixup! Add atomics support to asmjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Maqrkk committed Feb 5, 2024
1 parent 3732ee2 commit a4ed104
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llvm/lib/CheerpWriter/CheerpWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4810,6 +4810,8 @@ void CheerpWriter::compileStoreElem(const StoreInst& si, Type* Ty, StructType* S

void CheerpWriter::compileAtomicRMW(const AtomicRMWInst& ai, PARENT_PRIORITY parentPrio)
{
if (parentPrio > BIT_OR)
stream << "(";
switch(ai.getOperation())
{
case AtomicRMWInst::BinOp::Xchg:
Expand Down Expand Up @@ -4859,6 +4861,8 @@ void CheerpWriter::compileAtomicRMW(const AtomicRMWInst& ai, PARENT_PRIORITY par

if (ai.getType()->isIntegerTy() && parentPrio != BIT_OR)
stream << "|0";
if (parentPrio > BIT_OR)
stream << ")";
}

void CheerpWriter::compileAtomicCmpXchg(const AtomicCmpXchgInst& ai, PARENT_PRIORITY parentPrio)
Expand Down

0 comments on commit a4ed104

Please sign in to comment.