xref: /llvm-project/llvm/test/CodeGen/X86/atomic-ops-ancient-64.ll (revision ed4194bb8dbca5222628c2cddbc032fff57193b5)
1; RUN: llc -mtriple=i386-linux-gnu -mcpu=i386 %s -o - | FileCheck %s
2
3define i64 @test_add(ptr %addr, i64 %inc) {
4; CHECK-LABEL: test_add:
5; CHECK: calll __atomic_fetch_add_8
6  %old = atomicrmw add ptr %addr, i64 %inc seq_cst
7  ret i64 %old
8}
9
10define i64 @test_sub(ptr %addr, i64 %inc) {
11; CHECK-LABEL: test_sub:
12; CHECK: calll __atomic_fetch_sub_8
13  %old = atomicrmw sub ptr %addr, i64 %inc seq_cst
14  ret i64 %old
15}
16
17define i64 @test_and(ptr %andr, i64 %inc) {
18; CHECK-LABEL: test_and:
19; CHECK: calll __atomic_fetch_and_8
20  %old = atomicrmw and ptr %andr, i64 %inc seq_cst
21  ret i64 %old
22}
23
24define i64 @test_or(ptr %orr, i64 %inc) {
25; CHECK-LABEL: test_or:
26; CHECK: calll __atomic_fetch_or_8
27  %old = atomicrmw or ptr %orr, i64 %inc seq_cst
28  ret i64 %old
29}
30
31define i64 @test_xor(ptr %xorr, i64 %inc) {
32; CHECK-LABEL: test_xor:
33; CHECK: calll __atomic_fetch_xor_8
34  %old = atomicrmw xor ptr %xorr, i64 %inc seq_cst
35  ret i64 %old
36}
37
38define i64 @test_nand(ptr %nandr, i64 %inc) {
39; CHECK-LABEL: test_nand:
40; CHECK: calll __atomic_fetch_nand_8
41  %old = atomicrmw nand ptr %nandr, i64 %inc seq_cst
42  ret i64 %old
43}
44