• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5; Basic 64-bit cmpxchg
6define void @t1(i64* nocapture %p) nounwind ssp {
7; X86-LABEL: t1:
8; X86:       # %bb.0: # %entry
9; X86-NEXT:    pushl %ebx
10; X86-NEXT:    pushl %esi
11; X86-NEXT:    movl {{[0-9]+}}(%esp), %esi
12; X86-NEXT:    xorl %eax, %eax
13; X86-NEXT:    xorl %edx, %edx
14; X86-NEXT:    xorl %ecx, %ecx
15; X86-NEXT:    movl $1, %ebx
16; X86-NEXT:    lock cmpxchg8b (%esi)
17; X86-NEXT:    popl %esi
18; X86-NEXT:    popl %ebx
19; X86-NEXT:    retl
20;
21; X64-LABEL: t1:
22; X64:       # %bb.0: # %entry
23; X64-NEXT:    movl $1, %ecx
24; X64-NEXT:    xorl %eax, %eax
25; X64-NEXT:    lock cmpxchgq %rcx, (%rdi)
26; X64-NEXT:    retq
27entry:
28  %r = cmpxchg i64* %p, i64 0, i64 1 seq_cst seq_cst
29  ret void
30}
31
32