2014-07-01 18:53:31 +00:00
|
|
|
; RUN: llc < %s -mcpu=corei7 -march=x86 -verify-machineinstrs | FileCheck %s
|
2011-08-24 22:33:28 +00:00
|
|
|
|
|
|
|
; 64-bit load/store on x86-32
|
|
|
|
; FIXME: The generated code can be substantially improved.
|
|
|
|
|
|
|
|
define void @test1(i64* %ptr, i64 %val1) {
|
2014-09-23 20:59:25 +00:00
|
|
|
; CHECK-LABEL: test1
|
|
|
|
; CHECK: lock
|
|
|
|
; CHECK-NEXT: cmpxchg8b
|
2011-08-24 22:33:28 +00:00
|
|
|
; CHECK-NEXT: jne
|
2011-09-13 20:50:54 +00:00
|
|
|
store atomic i64 %val1, i64* %ptr seq_cst, align 8
|
2011-08-24 22:33:28 +00:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test2(i64* %ptr) {
|
2014-09-23 20:59:25 +00:00
|
|
|
; CHECK-LABEL: test2
|
|
|
|
; CHECK: lock
|
|
|
|
; CHECK-NEXT: cmpxchg8b
|
2015-02-27 21:17:42 +00:00
|
|
|
%val = load atomic i64, i64* %ptr seq_cst, align 8
|
2011-08-24 22:33:28 +00:00
|
|
|
ret i64 %val
|
|
|
|
}
|