|
|
@ -1225,39 +1225,39 @@ |
|
|
|
|
|
|
|
;;;; Rules for `AtomicRMW` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
|
|
|
|
|
|
(rule (lower (and (use_lse) |
|
|
|
(rule 1 (lower (and (use_lse) |
|
|
|
(has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_rmw flags (AtomicRmwOp.Add) addr src)))) |
|
|
|
(lse_atomic_rmw (AtomicRMWOp.Add) addr src ty)) |
|
|
|
(rule (lower (and (use_lse) |
|
|
|
(rule 1 (lower (and (use_lse) |
|
|
|
(has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_rmw flags (AtomicRmwOp.Xor) addr src)))) |
|
|
|
(lse_atomic_rmw (AtomicRMWOp.Eor) addr src ty)) |
|
|
|
(rule (lower (and (use_lse) |
|
|
|
(rule 1 (lower (and (use_lse) |
|
|
|
(has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_rmw flags (AtomicRmwOp.Or) addr src)))) |
|
|
|
(lse_atomic_rmw (AtomicRMWOp.Set) addr src ty)) |
|
|
|
(rule (lower (and (use_lse) |
|
|
|
(rule 1 (lower (and (use_lse) |
|
|
|
(has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_rmw flags (AtomicRmwOp.Smax) addr src)))) |
|
|
|
(lse_atomic_rmw (AtomicRMWOp.Smax) addr src ty)) |
|
|
|
(rule (lower (and (use_lse) |
|
|
|
(rule 1 (lower (and (use_lse) |
|
|
|
(has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_rmw flags (AtomicRmwOp.Smin) addr src)))) |
|
|
|
(lse_atomic_rmw (AtomicRMWOp.Smin) addr src ty)) |
|
|
|
(rule (lower (and (use_lse) |
|
|
|
(rule 1 (lower (and (use_lse) |
|
|
|
(has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_rmw flags (AtomicRmwOp.Umax) addr src)))) |
|
|
|
(lse_atomic_rmw (AtomicRMWOp.Umax) addr src ty)) |
|
|
|
(rule (lower (and (use_lse) |
|
|
|
(rule 1 (lower (and (use_lse) |
|
|
|
(has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_rmw flags (AtomicRmwOp.Umin) addr src)))) |
|
|
|
(lse_atomic_rmw (AtomicRMWOp.Umin) addr src ty)) |
|
|
|
(rule (lower (and (use_lse) |
|
|
|
(rule 1 (lower (and (use_lse) |
|
|
|
(has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_rmw flags (AtomicRmwOp.Sub) addr src)))) |
|
|
|
(lse_atomic_rmw (AtomicRMWOp.Add) addr (sub ty (zero_reg) src) ty)) |
|
|
|
(rule (lower (and (use_lse) |
|
|
|
(rule 1 (lower (and (use_lse) |
|
|
|
(has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_rmw flags (AtomicRmwOp.And) addr src)))) |
|
|
|
(lse_atomic_rmw (AtomicRMWOp.Clr) addr (eon ty src (zero_reg)) ty)) |
|
|
@ -1296,3 +1296,13 @@ |
|
|
|
(rule (lower (has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_rmw flags (AtomicRmwOp.Xchg) addr src))) |
|
|
|
(atomic_rmw_loop (AtomicRMWLoopOp.Xchg) addr src ty)) |
|
|
|
|
|
|
|
;;;; Rules for `AtomicCAS` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
|
|
(rule 1 (lower (and (use_lse) |
|
|
|
(has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_cas flags addr src1 src2)))) |
|
|
|
(lse_atomic_cas addr src1 src2 ty)) |
|
|
|
|
|
|
|
(rule (lower (and (has_type (valid_atomic_transaction ty) |
|
|
|
(atomic_cas flags addr src1 src2)))) |
|
|
|
(atomic_cas_loop addr src1 src2 ty)) |
|
|
|