http://llvm.org/bugs/show_bug.cgi?id=17611

            Bug ID: 17611
           Summary: Emit cmpxchg16b loops for i128 atomicrmw instructions
                    when mattr=+cx16
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

consider:
define void @test(i128* %a) nounwind {
entry:
  %0 = cmpxchg i128* %a, i128 1, i128 1 seq_cst
  %1 = atomicrmw xchg i128* %a, i128 1 seq_cst
  %2 = atomicrmw add i128* %a, i128 1 seq_cst
  %3 = atomicrmw sub i128* %a, i128 1 seq_cst
  %4 = atomicrmw and i128* %a, i128 1 seq_cst
  %5 = atomicrmw nand i128* %a, i128 1 seq_cst
  %6 = atomicrmw or i128* %a, i128 1 seq_cst
  %7 = atomicrmw xor i128* %a, i128 1 seq_cst
  ret void
}

compile with:
~/llvm/build/bin/llc /var/tmp/PR17481.ll -o - -mattr=+cx16 -march=x86-64
-mcpu=corei7

note that we are emitting libcalls for atomicrmw instructions instead of doing
something like:
.L6:    
        movq    %rax, %rbx
        movq    %rdx, %rcx
        orq     $1, %rbx
        lock cmpxchg16b -16(%rsp)
        jne     .L6

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to