From b43bde5a0ded46cdebb4f1baaf242efaa788ea9b Mon Sep 17 00:00:00 2001
From: dtc <dtc>
Date: Mon, 29 Sep 1997 16:51:18 +0000
Subject: [PATCH] Add the XADD instruction.

---
 compiler/x86/insts.lisp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/compiler/x86/insts.lisp b/compiler/x86/insts.lisp
index d09648986..f3d2ff48c 100644
--- a/compiler/x86/insts.lisp
+++ b/compiler/x86/insts.lisp
@@ -7,7 +7,7 @@
 ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/insts.lisp,v 1.9 1997/09/29 04:47:04 dtc Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/insts.lisp,v 1.10 1997/09/29 16:51:18 dtc Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -1375,6 +1375,17 @@
    (maybe-emit-operand-size-prefix segment :dword)
    (emit-byte segment #b10011001)))
 
+(define-instruction xadd (segment dst src)
+  ;; Register/Memory with Register.
+  (:printer ext-reg-reg/mem ((op #b1100000)) '(:name :tab reg/mem ", " reg))
+  (:emitter
+   (assert (register-p src))
+   (let ((size (matching-operand-size src dst)))
+     (maybe-emit-operand-size-prefix segment size)
+     (emit-byte segment #b00001111)
+     (emit-byte segment (if (eq size :byte) #b11000000 #b11000001))
+     (emit-ea segment dst (reg-tn-encoding src)))))
+
 
 ;;;; Logic.
 
-- 
GitLab