aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/atomic-load-store-wide.ll
blob: ad1a5c6d02679b5ffb8c84a0fe2a1954b8e83ea0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; RUN: llc < %s -mcpu=corei7 -march=x86 -verify-machineinstrs | FileCheck %s

; 64-bit load/store on x86-32
; FIXME: The generated code can be substantially improved.

define void @test1(i64* %ptr, i64 %val1) {
; CHECK-LABEL: test1
; CHECK: lock
; CHECK-NEXT: cmpxchg8b
; CHECK-NEXT: jne
  store atomic i64 %val1, i64* %ptr seq_cst, align 8
  ret void
}

define i64 @test2(i64* %ptr) {
; CHECK-LABEL: test2
; CHECK: lock
; CHECK-NEXT: cmpxchg8b
  %val = load atomic i64* %ptr seq_cst, align 8
  ret i64 %val
}