[PATCH] D135948: [LoongArch] Add codegen support for cmpxchg on LA64

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 26 23:51:34 PDT 2022


xen0n added inline comments.


================
Comment at: llvm/test/CodeGen/LoongArch/ir-instruction/atomic-cmpxchg.ll:201
+; LA64-NEXT:  .LBB6_4:
+; LA64-NEXT:    move $a0, $a3
+; LA64-NEXT:    ret
----------------
Okay so my suspicion is confirmed, and the implementation is wrong... the [[ https://llvm.org/docs/LangRef.html#cmpxchg-instruction | result of a strong `cmpxchg` ]] should be 1 if `$a3 == $a1`, and 0 otherwise. It shouldn't be the original value.

Please check if I'm misunderstanding anything...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135948



More information about the llvm-commits mailing list