From 61edc9ba66f4ce42c7cc4aab0f26d060470cdb14 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 19 Apr 2009 04:56:49 -0700 Subject: [PATCH] X86: Implement a locking version of XADD. --- .../x86/isa/insts/general_purpose/semaphores.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/arch/x86/isa/insts/general_purpose/semaphores.py b/src/arch/x86/isa/insts/general_purpose/semaphores.py index a34e2a3c7..a7da0720e 100644 --- a/src/arch/x86/isa/insts/general_purpose/semaphores.py +++ b/src/arch/x86/isa/insts/general_purpose/semaphores.py @@ -113,6 +113,21 @@ def macroop XADD_P_R { mov reg, reg, t1 }; +def macroop XADD_LOCKED_M_R { + ldstl t1, seg, sib, disp + add t2, t1, reg, flags=(OF,SF,ZF,AF,PF,CF) + stul t2, seg, sib, disp + mov reg, reg, t1 +}; + +def macroop XADD_LOCKED_P_R { + rdip t7 + ldstl t1, seg, riprel, disp + add t2, t1, reg, flags=(OF,SF,ZF,AF,PF,CF) + stul t2, seg, riprel, disp + mov reg, reg, t1 +}; + def macroop XADD_R_R { add t2, regm, reg, flags=(OF,SF,ZF,AF,PF,CF) mov regm, regm, reg -- 2.30.2