ref: 1b09060f468f530af2f4ef75441a40084e912e54
parent: 1c7e58e75bc6b5620984f164d66354350b28dfe0
author: mia soweli <inbox@tachibana-labs.org>
date: Sun May 19 11:31:32 EDT 2024
8[al]: support XADD
--- a/sys/src/cmd/8a/lex.c
+++ b/sys/src/cmd/8a/lex.c
@@ -504,6 +504,9 @@
"VERW", LTYPE2, AVERW,
"WAIT", LTYPE0, AWAIT,
"WORD", LTYPE2, AWORD,
+ "XADDB", LTYPE3, AXADDB,
+ "XADDL", LTYPE3, AXADDL,
+ "XADDW", LTYPE3, AXADDW,
"XCHGB", LTYPE3, AXCHGB,
"XCHGL", LTYPE3, AXCHGL,
"XCHGW", LTYPE3, AXCHGW,
--- a/sys/src/cmd/8c/8.out.h
+++ b/sys/src/cmd/8c/8.out.h
@@ -586,7 +586,11 @@
API2FL,
AJMPF,
+
ACMPXCHG8B,
+ AXADDB,
+ AXADDL,
+ AXADDW,
/* add new operations here. nowhere else. here. */
ALAST
--- a/sys/src/cmd/8l/optab.c
+++ b/sys/src/cmd/8l/optab.c
@@ -841,6 +841,9 @@
{ AVERW, ydivl, Pm, 0x00,(05) },
{ AWAIT, ynone, Px, 0x9b },
{ AWORD, ybyte, Px, 2 },
+ { AXADDB, yml_mb, Pm, 0xc0,0xc0 },
+ { AXADDL, yml_ml, Pm, 0xc1,0xc1 },
+ { AXADDW, yml_ml, Pq, 0xc1,0xc1 },
{ AXCHGB, yml_mb, Pb, 0x86,0x86 },
{ AXCHGL, yml_ml, Px, 0x87,0x87 },
{ AXCHGW, yml_ml, Pe, 0x87,0x87 },