[PATCH] D106344: [PowerPC] Implement XL compatible behavior of __compare_and_swap

Kai Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 21 19:26:50 PDT 2021


lkail added a comment.

In D106344#2894755 <https://reviews.llvm.org/D106344#2894755>, @jsji wrote:

> Doesn't look good enough to me,  the assembly code sequence generated is not clean enough.

I'm assuming you mean the second `stdcx.`, that looks like a historical issue which exists for 13yrs. According to https://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html and what xlc generates for CAS, it should not exist.

  commit 166d6cb1fad159b1aedb3801ecaecb62000979d1
  Author: Dale Johannesen <dalej at apple.com>
  Date:   Mon Aug 25 18:53:26 2008 +0000
  
      It's important for the cmp-and-swap to balance
      loads and stores but it's even more important for
      it to store the right value.:(
      
      llvm-svn: 55319


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106344/new/

https://reviews.llvm.org/D106344



More information about the cfe-commits mailing list