Implementing llvm.atomic.cmp.swap.i32 on PowerPC

Hello, Gary

I'm trying to figure out how to add the instructions required for
llvm.atomic.cmp.swap.i32 on PowerPC. I figured out LWARX (patch

Applied, thanks!

but the other two (CMP_UNRESw and STWCX) require multiple

  let Defs = [CR0] in {
  def STWCX : Pseudo<(outs), (ins GPRC:$rS, memrr:$dst, i32imm:$label),
                    "stwcx. $rS, $dst\n\tbne- La${label}_entry\nLa${label}_exit:",
                     [(PPCstcx GPRC:$rS, xoaddr:$dst, imm:$label)]>;
  def CMP_UNRESw : Pseudo<(outs), (ins GPRC:$rA, GPRC:$rB, i32imm:$label),
                           "cmpw $rA, $rB\n\tbne- La${label}_exit",
                           [(PPCcmp_unres GPRC:$rA, GPRC:$rB, imm:$label)]>;
..and I can't figure out the syntax for that. Any suggestions?

It seems, that stuff should be split into 2 different nodes for that.
Maybe there are another ways to do so.