blob: 8e1ef1b0f8756ab6d98b9ccb563bf9d41c94d279 [file] [log] [blame]
Evan Cheng8608f2e2008-04-19 02:30:38 +00001; RUN: llvm-as < %s | llc -march=ppc64 | grep ldarx | count 3
2; RUN: llvm-as < %s | llc -march=ppc64 | grep stdcx. | count 3
3
4define i64 @exchange_and_add(i64* %mem, i64 %val) nounwind {
5 %tmp = call i64 @llvm.atomic.las.i64( i64* %mem, i64 %val )
6 ret i64 %tmp
7}
8
9define i64 @exchange_and_cmp(i64* %mem) nounwind {
10 %tmp = call i64 @llvm.atomic.lcs.i64( i64* %mem, i64 0, i64 1 )
11 ret i64 %tmp
12}
13
14define i64 @exchange(i64* %mem, i64 %val) nounwind {
15 %tmp = call i64 @llvm.atomic.swap.i64( i64* %mem, i64 1 )
16 ret i64 %tmp
17}
18
19declare i64 @llvm.atomic.las.i64(i64*, i64) nounwind
20declare i64 @llvm.atomic.lcs.i64(i64*, i64, i64) nounwind
21declare i64 @llvm.atomic.swap.i64(i64*, i64) nounwind