Skip to content

Commit

Permalink
Add atomic intrinsics (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf authored May 18, 2022
1 parent acc89d6 commit 7304237
Show file tree
Hide file tree
Showing 6 changed files with 776 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/instructions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ for op in opcodes
end


## atomics

export ordering, ordering!

# Ordering getter/setter are supported only for a subset of instructions
# https://github.com/llvm/llvm-project/blob/llvmorg-14.0.3/llvm/lib/IR/Core.cpp#L3779-L3798

ordering(val::Union{LoadInst,StoreInst,AtomicRMWInst}) = API.LLVMGetOrdering(val)
ordering!(val::Union{LoadInst,StoreInst}, ord::API.LLVMAtomicOrdering) =
API.LLVMSetOrdering(val, ord)


## call sites and invocations

# TODO: add this to the actual type hierarchy
Expand Down
1 change: 1 addition & 0 deletions src/interop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include("interop/base.jl")
include("interop/asmcall.jl")
include("interop/passes.jl")
include("interop/pointer.jl")
include("interop/atomics.jl")
include("interop/utils.jl")
include("interop/intrinsics.jl")

Expand Down
Loading

0 comments on commit 7304237

Please sign in to comment.