Modified:
trunk/cc/test-cc.lisp
trunk/cc/x86-64-syntax.lisp
wiki/AssemblyX64C.wiki
wiki/AssemblyX64X.wiki
Log:
Add instruction xadd.
Modified: trunk/cc/test-cc.lisp
==============================================================================
--- trunk/cc/test-cc.lisp (original)
+++ trunk/cc/test-cc.lisp Tue Mar 3 05:25:55 2009
@@ -227,6 +227,10 @@
(jb near msg)
(syscall)
(sysret)
+ (xadd cl dl)
+ (xadd cx dx)
+ (xadd edi edx)
+ (xadd rcx r10)
(equ hi 4)
(dw meta-msg msg)
@@ -239,16 +243,17 @@
"Miscellaneous instructions.")
(defparameter *misc-code*
- '(232 145 0 248 252 250 244 228 3 229 4 236 237 204 205 16 116 254
- 235 252 15 1 22 148 124 15 1 30 148 124 15 0 210 15 0 22 148 124
- 172 173 226 230 180 9 187 13 0 137 200 137 30 148 124 139 14 123
- 28 199 6 148 124 123 0 142 195 140 200 144 230 3 231 4 238 239 81
+ '(232 159 0 248 252 250 244 228 3 229 4 236 237 204 205 16 116 254
+ 235 252 15 1 22 162 124 15 1 30 162 124 15 0 210 15 0 22 162 124
+ 172 173 226 230 180 9 187 13 0 137 200 137 30 162 124 139 14 123
+ 28 199 6 162 124 123 0 142 195 140 200 144 230 3 231 4 238 239 81
14 22 30 6 90 23 31 7 243 164 243 165 243 102 165 195 249 253 251
170 171 15 203 72 15 200 73 15 202 102 15 71 195 15 66 194 73 15
68 210 15 176 209 102 15 177 209 15 177 215 76 15 177 209 15 199
- 11 72 15 199 11 15 130 6 0 0 0 15 5 15 7 148 124 72 101 108 108
- 111 32 87 111 114 108 100 33 32 0 0 0 85 170 64 226 1 0 67 104 120
- 0 0 0 230 130 217 250 11 0))
+ 11 72 15 199 11 15 130 20 0 0 0 15 5 15 7 15 192 209 102 15 193
+ 209 15 193 215 76 15 193 209 162 124 72 101 108 108 111 32 87 111
+ 114 108 100 33 32 0 0 0 85 170 64 226 1 0 67 104 120 0 0 0 230 130
+ 217 250 11 0))
(defparameter *address-asm*
'((org #x7c00)
Modified: trunk/cc/x86-64-syntax.lisp
==============================================================================
--- trunk/cc/x86-64-syntax.lisp (original)
+++ trunk/cc/x86-64-syntax.lisp Tue Mar 3 05:25:55 2009
@@ -171,6 +171,9 @@
((test word m (imm16 imm8)) . (#xf7 /0 iw))
((test (r/m8 r8 m) r8) . (#x84 /r))
((test (r/m16 r16 m) r16) . (#x85 /r))
+ ((xadd (r/m8 r8 m) r8) . (#x0f #xc0 /r))
+ ((xadd (r/m16 r16 m) r16) . (o16 #x0f #xc1 /r))
+ ((xadd (r/m32 r32 m) r32) . (o32 #x0f #xc1 /r))
,@(arith-syntax-1 'xor nil))
"Valid for both 16-bit and 64-bit modes.")
@@ -209,6 +212,7 @@
,@(arith-syntax-1 'sub t)
((syscall) . (#x0f #x05))
((sysret) . (#x0f #x07))
+ ((xadd (r/m64 r64 m) r64) . (#x0f #xc1 /r))
,@(arith-syntax-1 'xor t)))
(defparameter *x86-64-syntax-16/32-bit*
Modified: wiki/AssemblyX64C.wiki
==============================================================================
--- wiki/AssemblyX64C.wiki (original)
+++ wiki/AssemblyX64C.wiki Tue Mar 3 05:25:55 2009
@@ -53,7 +53,6 @@
--------
-
= cmpxchg: Compare and Exchange =
|| Instruction || Opcode || 64-Bit Mode || 16/32-Bit Mode ||
Description ||
Modified: wiki/AssemblyX64X.wiki
==============================================================================
--- wiki/AssemblyX64X.wiki (original)
+++ wiki/AssemblyX64X.wiki Tue Mar 3 05:25:55 2009
@@ -4,9 +4,17 @@
<wiki:toc max_depth="1" />
+= xadd: Exchange and Add =
+
+|| Instruction || Opcode || 64-Bit Mode || 16/32-Bit Mode ||
Description ||
+|| xadd r/m8 r8 || 0F C0 /r || Valid || Valid ||
Exchange r8 and r/m8, load sum into r/m8 ||
+|| xadd r/m16 r16 || o16 0F C1 /r || Valid || Valid ||
Exchange r16 and r/m16, load sum into r/m16 ||
+|| xadd r/m32 r32 || o32 0F C1 /r || Valid || Valid ||
Exchange r32 and r/m32, load sum into r/m32 ||
+|| xadd r/m64 r64 || 0F C1 /r || Valid || ~~N.E.~~ ||
Exchange r64 and r/m64, load sum into r/m64 ||
+
--------
-= or: Logical Exclusive OR =
+= xor: Logical Exclusive OR =
|| Instruction || Opcode || 64-Bit Mode || 16/32-Bit Mode ||
Description ||
|| xor al imm8 || 34 ib || Valid || Valid || al XOR
imm8 ||