xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/atomic-load-store.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-apple-macosx10.7.0 -verify-machineinstrs | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-apple-macosx10.7.0 -verify-machineinstrs -O0 | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workerdefine void @test1(i32* %ptr, i32 %val1) {
5*9880d681SAndroid Build Coastguard Worker; CHECK: test1
6*9880d681SAndroid Build Coastguard Worker; CHECK: xchgl	%esi, (%rdi)
7*9880d681SAndroid Build Coastguard Worker  store atomic i32 %val1, i32* %ptr seq_cst, align 4
8*9880d681SAndroid Build Coastguard Worker  ret void
9*9880d681SAndroid Build Coastguard Worker}
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Workerdefine void @test2(i32* %ptr, i32 %val1) {
12*9880d681SAndroid Build Coastguard Worker; CHECK: test2
13*9880d681SAndroid Build Coastguard Worker; CHECK: movl	%esi, (%rdi)
14*9880d681SAndroid Build Coastguard Worker  store atomic i32 %val1, i32* %ptr release, align 4
15*9880d681SAndroid Build Coastguard Worker  ret void
16*9880d681SAndroid Build Coastguard Worker}
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerdefine i32 @test3(i32* %ptr) {
19*9880d681SAndroid Build Coastguard Worker; CHECK: test3
20*9880d681SAndroid Build Coastguard Worker; CHECK: movl	(%rdi), %eax
21*9880d681SAndroid Build Coastguard Worker  %val = load atomic i32, i32* %ptr seq_cst, align 4
22*9880d681SAndroid Build Coastguard Worker  ret i32 %val
23*9880d681SAndroid Build Coastguard Worker}
24