@@ -12,6 +12,11 @@ This is a unified atomic interface
12
12
- `CPU`: This reorganized the command to use atomic pointer logic
13
13
"""
14
14
15
+ # TODO : Remove?
16
+ # const atomic_acquire = LLVM.API.LLVMAtomicOrderingAcquire
17
+ # const atomic_release = LLVM.API.LLVMAtomicOrderingRelease
18
+ # const atomic_acquire_release = LLVM.API.LLVMAtomicOrderingAcquireRelease
19
+
15
20
# NOTE: This only grabs the first symbol of the expression, not the entire expr
16
21
macro atomic (ex)
17
22
quote
@@ -28,6 +33,58 @@ function atomic_add!(ptr, b)
28
33
Core. Intrinsics. atomic_pointermodify (ptr, + , b, :monotonic )
29
34
end
30
35
36
+ function atomic_and! (ptr, b)
37
+ Core. Intrinsics. atomic_pointermodify (ptr, & , b, :monotonic )
38
+ end
39
+
40
+ # Not sure what this one is...
41
+ function atomic_cas! (ptr, b)
42
+ Core. Intrinsics. atomic_pointermodify (ptr, & , b, :monotonic )
43
+ end
44
+
45
+ # TODO
46
+ function atomic_dec! (ptr, b)
47
+ Core. Intrinsics. atomic_pointermodify (ptr, & , b, :monotonic )
48
+ end
49
+
50
+ # TODO
51
+ function atomic_inc! (ptr, b)
52
+ Core. Intrinsics. atomic_pointermodify (ptr, & , b, :monotonic )
53
+ end
54
+
55
+ # TODO
56
+ function atomic_max! (ptr, b)
57
+ Core. Intrinsics. atomic_pointermodify (ptr, & , b, :monotonic )
58
+ end
59
+
60
+ # TODO
61
+ function atomic_min! (ptr, b)
62
+ Core. Intrinsics. atomic_pointermodify (ptr, & , b, :monotonic )
63
+ end
64
+
65
+ # TODO
66
+ function atomic_op! (ptr, b)
67
+ Core. Intrinsics. atomic_pointermodify (ptr, & , b, :monotonic )
68
+ end
69
+
70
+ function atomic_or! (ptr, b)
71
+ Core. Intrinsics. atomic_pointermodify (ptr, | , b, :monotonic )
72
+ end
73
+
74
+ function atomic_sub! (ptr, b)
75
+ Core. Intrinsics. atomic_pointermodify (ptr, - , b, :monotonic )
76
+ end
77
+
78
+ # TODO
79
+ function atomic_xchg! (ptr, b)
80
+ Core. Intrinsics. atomic_pointermodify (ptr, & , b, :monotonic )
81
+ end
82
+
83
+ # TODO
84
+ function atomic_xor! (ptr, b)
85
+ Core. Intrinsics. atomic_pointermodify (ptr, & , b, :monotonic )
86
+ end
87
+
31
88
# ##
32
89
# CPU implementation of atomic macro
33
90
# ##
0 commit comments