File: atomic-ops-ancient-64.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.4-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,236,516 kB
  • sloc: cpp: 7,619,569; ansic: 1,433,956; asm: 1,058,748; python: 252,181; f90: 94,671; objc: 70,753; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,585; awk: 3,523; javascript: 2,272; xml: 892; fortran: 770
file content (43 lines) | stat: -rw-r--r-- 1,113 bytes parent folder | download | duplicates (20)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
; RUN: llc -mtriple=i386-linux-gnu -mcpu=i386 %s -o - | FileCheck %s

define i64 @test_add(ptr %addr, i64 %inc) {
; CHECK-LABEL: test_add:
; CHECK: calll __atomic_fetch_add_8
  %old = atomicrmw add ptr %addr, i64 %inc seq_cst
  ret i64 %old
}

define i64 @test_sub(ptr %addr, i64 %inc) {
; CHECK-LABEL: test_sub:
; CHECK: calll __atomic_fetch_sub_8
  %old = atomicrmw sub ptr %addr, i64 %inc seq_cst
  ret i64 %old
}

define i64 @test_and(ptr %andr, i64 %inc) {
; CHECK-LABEL: test_and:
; CHECK: calll __atomic_fetch_and_8
  %old = atomicrmw and ptr %andr, i64 %inc seq_cst
  ret i64 %old
}

define i64 @test_or(ptr %orr, i64 %inc) {
; CHECK-LABEL: test_or:
; CHECK: calll __atomic_fetch_or_8
  %old = atomicrmw or ptr %orr, i64 %inc seq_cst
  ret i64 %old
}

define i64 @test_xor(ptr %xorr, i64 %inc) {
; CHECK-LABEL: test_xor:
; CHECK: calll __atomic_fetch_xor_8
  %old = atomicrmw xor ptr %xorr, i64 %inc seq_cst
  ret i64 %old
}

define i64 @test_nand(ptr %nandr, i64 %inc) {
; CHECK-LABEL: test_nand:
; CHECK: calll __atomic_fetch_nand_8
  %old = atomicrmw nand ptr %nandr, i64 %inc seq_cst
  ret i64 %old
}