Skip to content

Commit

Permalink
Fix atomic intrinsics
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Mar 6, 2019
1 parent 4cb9b2b commit 1f00b7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ macro_rules! atomic_binop_return_old {
($fx:expr, $op:ident<$T:ident>($ptr:ident, $src:ident) -> $ret:ident) => {
let clif_ty = $fx.clif_type($T).unwrap();
let old = $fx.bcx.ins().load(clif_ty, MemFlags::new(), $ptr, 0);
let new = $fx.bcx.ins().band(old, $src);
let new = $fx.bcx.ins().$op(old, $src);
$fx.bcx.ins().store(MemFlags::new(), new, $ptr, 0);
$ret.write_cvalue($fx, CValue::ByVal(old, $fx.layout_of($T)));
};
Expand Down Expand Up @@ -465,7 +465,7 @@ pub fn codegen_intrinsic_call<'a, 'tcx: 'a>(
atomic_binop_return_old! (fx, band<T>(ptr, src) -> ret);
};
_ if intrinsic.starts_with("atomic_nand"), <T> (v ptr, v src) {
atomic_binop_return_old! (fx, bnand<T>(ptr, src) -> ret);
atomic_binop_return_old! (fx, band_not<T>(ptr, src) -> ret);
};
_ if intrinsic.starts_with("atomic_or"), <T> (v ptr, v src) {
atomic_binop_return_old! (fx, bor<T>(ptr, src) -> ret);
Expand Down

0 comments on commit 1f00b7b

Please sign in to comment.