mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
30e7514d01
Summary: AtomicExpand already had logic for expanding wide loads and stores on LL/SC architectures, and for expanding wide stores on CmpXchg architectures, but not for wide loads on CmpXchg architectures. This patch fills this hole, and makes use of this new feature in the X86 backend. Only one functionnal change: we now lose the SynchScope attribute. It is regrettable, but I have another patch that I will submit soon that will solve this for all of AtomicExpand (it seemed better to split it apart as it is a different concern). Test Plan: make check-all (lots of tests for this functionality already exist) Reviewers: jfb Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5404 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218332 91177308-0d34-0410-b5e6-96231b3b80d8
22 lines
510 B
LLVM
22 lines
510 B
LLVM
; 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
|
|
}
|