x64: port atomic_cas to ISLE (#4223)

This commit is contained in:
Andrew Brown
2022-06-06 13:20:33 -07:00
committed by GitHub
parent d8ba1ddc86
commit 6df56e6aa6
4 changed files with 23 additions and 26 deletions

View File

@@ -1058,6 +1058,11 @@
(decl encode_fcmp_imm (FcmpImm) u8)
(extern constructor encode_fcmp_imm encode_fcmp_imm)
;;;; Registers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(decl rax () WritableGpr)
(extern constructor rax rax)
;;;; Newtypes for Different Register Classes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(type Gpr (primitive Gpr))
@@ -2876,6 +2881,11 @@
(rule (x64_mfence)
(SideEffectNoResult.Inst (MInst.Fence (FenceKind.MFence))))
(decl x64_cmpxchg (Type Gpr Gpr SyntheticAmode) Gpr)
(rule (x64_cmpxchg ty expected replacement addr)
(let ((_ Unit (emit (MInst.LockCmpxchg ty replacement expected addr (rax)))))
(rax)))
;;;; Automatic conversions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(convert Gpr InstOutput output_gpr)