xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/atomics-fences.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=powerpc-apple-darwin -march=ppc32 -verify-machineinstrs | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=powerpc-apple-darwin -march=ppc64 -verify-machineinstrs | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=powerpc-apple-darwin -mcpu=440 | FileCheck %s --check-prefix=PPC440
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; Fences
6*9880d681SAndroid Build Coastguard Workerdefine void @fence_acquire() {
7*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: fence_acquire
8*9880d681SAndroid Build Coastguard Worker; CHECK: lwsync
9*9880d681SAndroid Build Coastguard Worker; PPC440-NOT: lwsync
10*9880d681SAndroid Build Coastguard Worker; PPC440: msync
11*9880d681SAndroid Build Coastguard Worker  fence acquire
12*9880d681SAndroid Build Coastguard Worker  ret void
13*9880d681SAndroid Build Coastguard Worker}
14*9880d681SAndroid Build Coastguard Workerdefine void @fence_release() {
15*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: fence_release
16*9880d681SAndroid Build Coastguard Worker; CHECK: lwsync
17*9880d681SAndroid Build Coastguard Worker; PPC440-NOT: lwsync
18*9880d681SAndroid Build Coastguard Worker; PPC440: msync
19*9880d681SAndroid Build Coastguard Worker  fence release
20*9880d681SAndroid Build Coastguard Worker  ret void
21*9880d681SAndroid Build Coastguard Worker}
22*9880d681SAndroid Build Coastguard Workerdefine void @fence_seq_cst() {
23*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: fence_seq_cst
24*9880d681SAndroid Build Coastguard Worker; CHECK: sync
25*9880d681SAndroid Build Coastguard Worker; PPC440: msync
26*9880d681SAndroid Build Coastguard Worker  fence seq_cst
27*9880d681SAndroid Build Coastguard Worker  ret void
28*9880d681SAndroid Build Coastguard Worker}
29