1
Fork 0

Add intrinsics for compare_exchange and compare_exchange_weak

This commit is contained in:
Amanieu d'Antras 2016-01-16 23:40:11 +00:00
parent 8e2a577804
commit 64ddcb33f4
8 changed files with 114 additions and 40 deletions

View file

@ -191,11 +191,15 @@ extern "C" LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B,
LLVMValueRef old,
LLVMValueRef source,
AtomicOrdering order,
AtomicOrdering failure_order) {
return wrap(unwrap(B)->CreateAtomicCmpXchg(unwrap(target), unwrap(old),
unwrap(source), order,
failure_order
));
AtomicOrdering failure_order,
LLVMBool weak) {
AtomicCmpXchgInst* acxi = unwrap(B)->CreateAtomicCmpXchg(unwrap(target),
unwrap(old),
unwrap(source),
order,
failure_order);
acxi->setWeak(weak);
return wrap(acxi);
}
extern "C" LLVMValueRef LLVMBuildAtomicFence(LLVMBuilderRef B,
AtomicOrdering order,