1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown- -mcpu=core2 | FileCheck %s --check-prefixes=CHECK,X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown- -mcpu=core2 | FileCheck %s --check-prefixes=CHECK,X64
4 ; RUN: llc < %s -mtriple=i686-unknown- -mcpu=i486 | FileCheck %s --check-prefixes=I486
5 ; RUN: llc < %s -mtriple=i686-unknown- -mcpu=znver1 | FileCheck %s --check-prefixes=CHECK,X86
8 define void @t1(i64* nocapture %p) nounwind ssp {
10 ; X86: # %bb.0: # %entry
11 ; X86-NEXT: pushl %ebx
12 ; X86-NEXT: pushl %esi
13 ; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
14 ; X86-NEXT: xorl %eax, %eax
15 ; X86-NEXT: xorl %edx, %edx
16 ; X86-NEXT: xorl %ecx, %ecx
17 ; X86-NEXT: movl $1, %ebx
18 ; X86-NEXT: lock cmpxchg8b (%esi)
24 ; X64: # %bb.0: # %entry
25 ; X64-NEXT: movl $1, %ecx
26 ; X64-NEXT: xorl %eax, %eax
27 ; X64-NEXT: lock cmpxchgq %rcx, (%rdi)
31 ; I486: # %bb.0: # %entry
32 ; I486-NEXT: pushl %ebp
33 ; I486-NEXT: movl %esp, %ebp
34 ; I486-NEXT: andl $-8, %esp
35 ; I486-NEXT: subl $8, %esp
36 ; I486-NEXT: movl 8(%ebp), %eax
37 ; I486-NEXT: movl $0, {{[0-9]+}}(%esp)
38 ; I486-NEXT: movl $0, (%esp)
39 ; I486-NEXT: movl %esp, %ecx
44 ; I486-NEXT: pushl %ecx
45 ; I486-NEXT: pushl %eax
46 ; I486-NEXT: calll __atomic_compare_exchange_8
47 ; I486-NEXT: addl $24, %esp
48 ; I486-NEXT: movl %ebp, %esp
49 ; I486-NEXT: popl %ebp
52 %r = cmpxchg i64* %p, i64 0, i64 1 seq_cst seq_cst