aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2009-11-14 06:04:34 +0000
committerH.J. Lu <hjl.tools@gmail.com>2009-11-14 06:04:34 +0000
commitc1ba026631b21acbb0cf32e36fa7130df3cc6eee (patch)
tree5b1e28b4bc59016a6c1df1ca8c8d8905dd1bd7eb /gas
parent68a3e151dab3d8be31eb5347e10db53daba25e2a (diff)
downloadgdb-c1ba026631b21acbb0cf32e36fa7130df3cc6eee.zip
gdb-c1ba026631b21acbb0cf32e36fa7130df3cc6eee.tar.gz
gdb-c1ba026631b21acbb0cf32e36fa7130df3cc6eee.tar.bz2
Check destination operand for lockable instructions.
gas/ 2009-11-13 H.J. Lu <hongjiu.lu@intel.com> * config/tc-i386.c (md_assemble): Check destination operand for lockable instructions. gas/testsuite/ 2009-11-13 H.J. Lu <hongjiu.lu@intel.com> * gas/i386/lock-1-intel.d: Updated. * gas/i386/lock-1.d: Likewise. * gas/i386/lock-1.s: Likewise. * gas/i386/lockbad-1.l: Likewise. * gas/i386/lockbad-1.s: Likewise. * gas/i386/x86-64-lock-1-intel.d: Likewise. * gas/i386/x86-64-lock-1.d: Likewise. * gas/i386/x86-64-lock-1.s: Likewise. * gas/i386/x86-64-lockbad-1.l: Likewise. * gas/i386/x86-64-lockbad-1.s: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386.c7
-rw-r--r--gas/testsuite/ChangeLog13
-rw-r--r--gas/testsuite/gas/i386/lock-1-intel.d28
-rw-r--r--gas/testsuite/gas/i386/lock-1.d28
-rw-r--r--gas/testsuite/gas/i386/lock-1.s28
-rw-r--r--gas/testsuite/gas/i386/lockbad-1.l100
-rw-r--r--gas/testsuite/gas/i386/lockbad-1.s16
-rw-r--r--gas/testsuite/gas/i386/x86-64-lock-1-intel.d28
-rw-r--r--gas/testsuite/gas/i386/x86-64-lock-1.d28
-rw-r--r--gas/testsuite/gas/i386/x86-64-lock-1.s28
-rw-r--r--gas/testsuite/gas/i386/x86-64-lockbad-1.l100
-rw-r--r--gas/testsuite/gas/i386/x86-64-lockbad-1.s16
13 files changed, 269 insertions, 156 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index f61097c..94dc620 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2009-11-13 H.J. Lu <hongjiu.lu@intel.com>
+ * config/tc-i386.c (md_assemble): Check destination operand
+ for lockable instructions.
+
+2009-11-13 H.J. Lu <hongjiu.lu@intel.com>
+
* config/tc-i386.c (_i386_insn): Don't use bit field on
swap_operand.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 6aa9949..8a67797 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2932,10 +2932,13 @@ md_assemble (char *line)
if (!add_prefix (FWAIT_OPCODE))
return;
- /* Check for lock without a lockable instruction. */
+ /* Check for lock without a lockable instruction. Destination operand
+ must be memory unless it is xchg (0x86). */
if (i.prefix[LOCK_PREFIX]
&& (!i.tm.opcode_modifier.islockable
- || i.mem_operands == 0))
+ || i.mem_operands == 0
+ || (i.tm.base_opcode != 0x86
+ && !operand_type_check (i.types[i.operands - 1], anymem))))
{
as_bad (_("expecting lockable instruction after `lock'"));
return;
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 2c55bd5..165266d 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,18 @@
2009-11-13 H.J. Lu <hongjiu.lu@intel.com>
+ * gas/i386/lock-1-intel.d: Updated.
+ * gas/i386/lock-1.d: Likewise.
+ * gas/i386/lock-1.s: Likewise.
+ * gas/i386/lockbad-1.l: Likewise.
+ * gas/i386/lockbad-1.s: Likewise.
+ * gas/i386/x86-64-lock-1-intel.d: Likewise.
+ * gas/i386/x86-64-lock-1.d: Likewise.
+ * gas/i386/x86-64-lock-1.s: Likewise.
+ * gas/i386/x86-64-lockbad-1.l: Likewise.
+ * gas/i386/x86-64-lockbad-1.s: Likewise.
+
+2009-11-13 H.J. Lu <hongjiu.lu@intel.com>
+
* gas/i386/rex.s: Add a test for VEX insn.
* gas/i386/rex.d: Updated.
diff --git a/gas/testsuite/gas/i386/lock-1-intel.d b/gas/testsuite/gas/i386/lock-1-intel.d
index 9897a92..d197a09 100644
--- a/gas/testsuite/gas/i386/lock-1-intel.d
+++ b/gas/testsuite/gas/i386/lock-1-intel.d
@@ -8,11 +8,11 @@
Disassembly of section .text:
0+ <foo>:
-[ ]*[a-f0-9]+: f0 03 03 lock add eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 01 03 lock add DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 03 64 lock add DWORD PTR \[ebx\],0x64
-[ ]*[a-f0-9]+: f0 13 03 lock adc eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 11 03 lock adc DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 13 64 lock adc DWORD PTR \[ebx\],0x64
-[ ]*[a-f0-9]+: f0 23 03 lock and eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 21 03 lock and DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 23 64 lock and DWORD PTR \[ebx\],0x64
[ ]*[a-f0-9]+: f0 0f bb 03 lock btc DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 0f ba 3b 64 lock btc DWORD PTR \[ebx\],0x64
@@ -26,22 +26,22 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f0 ff 03 lock inc DWORD PTR \[ebx\]
[ ]*[a-f0-9]+: f0 f7 1b lock neg DWORD PTR \[ebx\]
[ ]*[a-f0-9]+: f0 f7 13 lock not DWORD PTR \[ebx\]
-[ ]*[a-f0-9]+: f0 0b 03 lock or eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 09 03 lock or DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 0b 64 lock or DWORD PTR \[ebx\],0x64
-[ ]*[a-f0-9]+: f0 1b 03 lock sbb eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 19 03 lock sbb DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 1b 64 lock sbb DWORD PTR \[ebx\],0x64
-[ ]*[a-f0-9]+: f0 2b 03 lock sub eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 29 03 lock sub DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 2b 64 lock sub DWORD PTR \[ebx\],0x64
[ ]*[a-f0-9]+: f0 0f c1 03 lock xadd DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 87 03 lock xchg DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 87 03 lock xchg DWORD PTR \[ebx\],eax
-[ ]*[a-f0-9]+: f0 33 03 lock xor eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 31 03 lock xor DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 33 64 lock xor DWORD PTR \[ebx\],0x64
-[ ]*[a-f0-9]+: f0 03 03 lock add eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 01 03 lock add DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 03 64 lock add DWORD PTR \[ebx\],0x64
-[ ]*[a-f0-9]+: f0 13 03 lock adc eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 11 03 lock adc DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 13 64 lock adc DWORD PTR \[ebx\],0x64
-[ ]*[a-f0-9]+: f0 23 03 lock and eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 21 03 lock and DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 23 64 lock and DWORD PTR \[ebx\],0x64
[ ]*[a-f0-9]+: f0 0f bb 03 lock btc DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 0f ba 3b 64 lock btc DWORD PTR \[ebx\],0x64
@@ -55,15 +55,15 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f0 ff 03 lock inc DWORD PTR \[ebx\]
[ ]*[a-f0-9]+: f0 f7 1b lock neg DWORD PTR \[ebx\]
[ ]*[a-f0-9]+: f0 f7 13 lock not DWORD PTR \[ebx\]
-[ ]*[a-f0-9]+: f0 0b 03 lock or eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 09 03 lock or DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 0b 64 lock or DWORD PTR \[ebx\],0x64
-[ ]*[a-f0-9]+: f0 1b 03 lock sbb eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 19 03 lock sbb DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 1b 64 lock sbb DWORD PTR \[ebx\],0x64
-[ ]*[a-f0-9]+: f0 2b 03 lock sub eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 29 03 lock sub DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 2b 64 lock sub DWORD PTR \[ebx\],0x64
[ ]*[a-f0-9]+: f0 0f c1 03 lock xadd DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 87 03 lock xchg DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 87 03 lock xchg DWORD PTR \[ebx\],eax
-[ ]*[a-f0-9]+: f0 33 03 lock xor eax,DWORD PTR \[ebx\]
+[ ]*[a-f0-9]+: f0 31 03 lock xor DWORD PTR \[ebx\],eax
[ ]*[a-f0-9]+: f0 83 33 64 lock xor DWORD PTR \[ebx\],0x64
#pass
diff --git a/gas/testsuite/gas/i386/lock-1.d b/gas/testsuite/gas/i386/lock-1.d
index a9ab747..3621a2e 100644
--- a/gas/testsuite/gas/i386/lock-1.d
+++ b/gas/testsuite/gas/i386/lock-1.d
@@ -7,11 +7,11 @@
Disassembly of section .text:
0+ <foo>:
-[ ]*[a-f0-9]+: f0 03 03 lock add \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 01 03 lock add %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 03 64 lock addl \$0x64,\(%ebx\)
-[ ]*[a-f0-9]+: f0 13 03 lock adc \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 11 03 lock adc %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 13 64 lock adcl \$0x64,\(%ebx\)
-[ ]*[a-f0-9]+: f0 23 03 lock and \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 21 03 lock and %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 23 64 lock andl \$0x64,\(%ebx\)
[ ]*[a-f0-9]+: f0 0f bb 03 lock btc %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 0f ba 3b 64 lock btcl \$0x64,\(%ebx\)
@@ -25,22 +25,22 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f0 ff 03 lock incl \(%ebx\)
[ ]*[a-f0-9]+: f0 f7 1b lock negl \(%ebx\)
[ ]*[a-f0-9]+: f0 f7 13 lock notl \(%ebx\)
-[ ]*[a-f0-9]+: f0 0b 03 lock or \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 09 03 lock or %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 0b 64 lock orl \$0x64,\(%ebx\)
-[ ]*[a-f0-9]+: f0 1b 03 lock sbb \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 19 03 lock sbb %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 1b 64 lock sbbl \$0x64,\(%ebx\)
-[ ]*[a-f0-9]+: f0 2b 03 lock sub \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 29 03 lock sub %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 2b 64 lock subl \$0x64,\(%ebx\)
[ ]*[a-f0-9]+: f0 0f c1 03 lock xadd %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 87 03 lock xchg %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 87 03 lock xchg %eax,\(%ebx\)
-[ ]*[a-f0-9]+: f0 33 03 lock xor \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 31 03 lock xor %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 33 64 lock xorl \$0x64,\(%ebx\)
-[ ]*[a-f0-9]+: f0 03 03 lock add \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 01 03 lock add %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 03 64 lock addl \$0x64,\(%ebx\)
-[ ]*[a-f0-9]+: f0 13 03 lock adc \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 11 03 lock adc %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 13 64 lock adcl \$0x64,\(%ebx\)
-[ ]*[a-f0-9]+: f0 23 03 lock and \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 21 03 lock and %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 23 64 lock andl \$0x64,\(%ebx\)
[ ]*[a-f0-9]+: f0 0f bb 03 lock btc %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 0f ba 3b 64 lock btcl \$0x64,\(%ebx\)
@@ -54,15 +54,15 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f0 ff 03 lock incl \(%ebx\)
[ ]*[a-f0-9]+: f0 f7 1b lock negl \(%ebx\)
[ ]*[a-f0-9]+: f0 f7 13 lock notl \(%ebx\)
-[ ]*[a-f0-9]+: f0 0b 03 lock or \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 09 03 lock or %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 0b 64 lock orl \$0x64,\(%ebx\)
-[ ]*[a-f0-9]+: f0 1b 03 lock sbb \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 19 03 lock sbb %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 1b 64 lock sbbl \$0x64,\(%ebx\)
-[ ]*[a-f0-9]+: f0 2b 03 lock sub \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 29 03 lock sub %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 2b 64 lock subl \$0x64,\(%ebx\)
[ ]*[a-f0-9]+: f0 0f c1 03 lock xadd %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 87 03 lock xchg %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 87 03 lock xchg %eax,\(%ebx\)
-[ ]*[a-f0-9]+: f0 33 03 lock xor \(%ebx\),%eax
+[ ]*[a-f0-9]+: f0 31 03 lock xor %eax,\(%ebx\)
[ ]*[a-f0-9]+: f0 83 33 64 lock xorl \$0x64,\(%ebx\)
#pass
diff --git a/gas/testsuite/gas/i386/lock-1.s b/gas/testsuite/gas/i386/lock-1.s
index 11991f7..4a2a90e 100644
--- a/gas/testsuite/gas/i386/lock-1.s
+++ b/gas/testsuite/gas/i386/lock-1.s
@@ -2,11 +2,11 @@
.text
foo:
- lock add (%ebx), %eax
+ lock add %eax, (%ebx)
lock add $0x64, (%ebx)
- lock adc (%ebx), %eax
+ lock adc %eax, (%ebx)
lock adc $0x64, (%ebx)
- lock and (%ebx), %eax
+ lock and %eax, (%ebx)
lock and $0x64, (%ebx)
lock btc %eax, (%ebx)
lock btc $0x64, (%ebx)
@@ -20,24 +20,24 @@ foo:
lock incl (%ebx)
lock negl (%ebx)
lock notl (%ebx)
- lock or (%ebx), %eax
+ lock or %eax, (%ebx)
lock or $0x64, (%ebx)
- lock sbb (%ebx), %eax
+ lock sbb %eax, (%ebx)
lock sbb $0x64, (%ebx)
- lock sub (%ebx), %eax
+ lock sub %eax, (%ebx)
lock sub $0x64, (%ebx)
lock xadd %eax, (%ebx)
lock xchg (%ebx), %eax
lock xchg %eax, (%ebx)
- lock xor (%ebx), %eax
+ lock xor %eax, (%ebx)
lock xor $0x64, (%ebx)
.intel_syntax noprefix
- lock add eax,DWORD PTR [ebx]
+ lock add DWORD PTR [ebx],eax
lock add DWORD PTR [ebx],0x64
- lock adc eax,DWORD PTR [ebx]
+ lock adc DWORD PTR [ebx],eax
lock adc DWORD PTR [ebx],0x64
- lock and eax,DWORD PTR [ebx]
+ lock and DWORD PTR [ebx],eax
lock and DWORD PTR [ebx],0x64
lock btc DWORD PTR [ebx],eax
lock btc DWORD PTR [ebx],0x64
@@ -51,14 +51,14 @@ foo:
lock inc DWORD PTR [ebx]
lock neg DWORD PTR [ebx]
lock not DWORD PTR [ebx]
- lock or eax,DWORD PTR [ebx]
+ lock or DWORD PTR [ebx],eax
lock or DWORD PTR [ebx],0x64
- lock sbb eax,DWORD PTR [ebx]
+ lock sbb DWORD PTR [ebx],eax
lock sbb DWORD PTR [ebx],0x64
- lock sub eax,DWORD PTR [ebx]
+ lock sub DWORD PTR [ebx],eax
lock sub DWORD PTR [ebx],0x64
lock xadd DWORD PTR [ebx],eax
lock xchg DWORD PTR [ebx],eax
lock xchg DWORD PTR [ebx],eax
- lock xor eax,DWORD PTR [ebx]
+ lock xor DWORD PTR [ebx],eax
lock xor DWORD PTR [ebx],0x64
diff --git a/gas/testsuite/gas/i386/lockbad-1.l b/gas/testsuite/gas/i386/lockbad-1.l
index 19ea049..a639b52 100644
--- a/gas/testsuite/gas/i386/lockbad-1.l
+++ b/gas/testsuite/gas/i386/lockbad-1.l
@@ -29,16 +29,15 @@
.*:33: Error: .*
.*:34: Error: .*
.*:35: Error: .*
+.*:37: Error: .*
.*:38: Error: .*
.*:39: Error: .*
+.*:40: Error: .*
.*:41: Error: .*
.*:42: Error: .*
.*:43: Error: .*
-.*:44: Error: .*
-.*:45: Error: .*
.*:46: Error: .*
.*:47: Error: .*
-.*:48: Error: .*
.*:49: Error: .*
.*:50: Error: .*
.*:51: Error: .*
@@ -59,6 +58,21 @@
.*:66: Error: .*
.*:67: Error: .*
.*:68: Error: .*
+.*:69: Error: .*
+.*:70: Error: .*
+.*:71: Error: .*
+.*:72: Error: .*
+.*:73: Error: .*
+.*:74: Error: .*
+.*:75: Error: .*
+.*:76: Error: .*
+.*:78: Error: .*
+.*:79: Error: .*
+.*:80: Error: .*
+.*:81: Error: .*
+.*:82: Error: .*
+.*:83: Error: .*
+.*:84: Error: .*
GAS LISTING .*
@@ -98,38 +112,54 @@ GAS LISTING .*
[ ]*34[ ]+lock xor %ebx, %eax
[ ]*35[ ]+lock xor \$0x64, %ebx
[ ]*36[ ]+
-[ ]*37[ ]+\.intel_syntax noprefix
-[ ]*38[ ]+lock mov eax,ebx
-[ ]*39[ ]+lock mov eax,DWORD PTR \[ebx\]
-[ ]*40[ ]+
-[ ]*41[ ]+lock add eax,ebx
-[ ]*42[ ]+lock add ebx,0x64
-[ ]*43[ ]+lock adc eax,ebx
-[ ]*44[ ]+lock adc ebx,0x64
-[ ]*45[ ]+lock and eax,ebx
-[ ]*46[ ]+lock and ebx,0x64
-[ ]*47[ ]+lock btc ebx,eax
-[ ]*48[ ]+lock btc ebx,0x64
-[ ]*49[ ]+lock btr ebx,eax
-[ ]*50[ ]+lock btr ebx,0x64
-[ ]*51[ ]+lock bts ebx,eax
-[ ]*52[ ]+lock bts ebx,0x64
-[ ]*53[ ]+lock cmpxchg ebx,eax
-[ ]*54[ ]+lock dec ebx
-[ ]*55[ ]+lock inc ebx
-[ ]*56[ ]+lock neg ebx
-[ ]*57[ ]+lock not ebx
+[ ]*37[ ]+lock add \(%ebx\), %eax
+[ ]*38[ ]+lock adc \(%ebx\), %eax
+[ ]*39[ ]+lock and \(%ebx\), %eax
+[ ]*40[ ]+lock or \(%ebx\), %eax
+[ ]*41[ ]+lock sbb \(%ebx\), %eax
+[ ]*42[ ]+lock sub \(%ebx\), %eax
+[ ]*43[ ]+lock xor \(%ebx\), %eax
+[ ]*44[ ]+
+[ ]*45[ ]+\.intel_syntax noprefix
+[ ]*46[ ]+lock mov eax,ebx
+[ ]*47[ ]+lock mov eax,DWORD PTR \[ebx\]
+[ ]*48[ ]+
+[ ]*49[ ]+lock add eax,ebx
+[ ]*50[ ]+lock add ebx,0x64
+[ ]*51[ ]+lock adc eax,ebx
+[ ]*52[ ]+lock adc ebx,0x64
+[ ]*53[ ]+lock and eax,ebx
+[ ]*54[ ]+lock and ebx,0x64
+[ ]*55[ ]+lock btc ebx,eax
+[ ]*56[ ]+lock btc ebx,0x64
+[ ]*57[ ]+lock btr ebx,eax
GAS LISTING .*
-[ ]*58[ ]+lock or eax,ebx
-[ ]*59[ ]+lock or ebx,0x64
-[ ]*60[ ]+lock sbb eax,ebx
-[ ]*61[ ]+lock sbb ebx,0x64
-[ ]*62[ ]+lock sub eax,ebx
-[ ]*63[ ]+lock sub ebx,0x64
-[ ]*64[ ]+lock xadd ebx,eax
-[ ]*65[ ]+lock xchg ebx,eax
-[ ]*66[ ]+lock xchg ebx,eax
-[ ]*67[ ]+lock xor eax,ebx
-[ ]*68[ ]+lock xor ebx,0x64
+[ ]*58[ ]+lock btr ebx,0x64
+[ ]*59[ ]+lock bts ebx,eax
+[ ]*60[ ]+lock bts ebx,0x64
+[ ]*61[ ]+lock cmpxchg ebx,eax
+[ ]*62[ ]+lock dec ebx
+[ ]*63[ ]+lock inc ebx
+[ ]*64[ ]+lock neg ebx
+[ ]*65[ ]+lock not ebx
+[ ]*66[ ]+lock or eax,ebx
+[ ]*67[ ]+lock or ebx,0x64
+[ ]*68[ ]+lock sbb eax,ebx
+[ ]*69[ ]+lock sbb ebx,0x64
+[ ]*70[ ]+lock sub eax,ebx
+[ ]*71[ ]+lock sub ebx,0x64
+[ ]*72[ ]+lock xadd ebx,eax
+[ ]*73[ ]+lock xchg ebx,eax
+[ ]*74[ ]+lock xchg ebx,eax
+[ ]*75[ ]+lock xor eax,ebx
+[ ]*76[ ]+lock xor ebx,0x64
+[ ]*77[ ]+
+[ ]*78[ ]+lock add eax,DWORD PTR \[ebx\]
+[ ]*79[ ]+lock adc eax,DWORD PTR \[ebx\]
+[ ]*80[ ]+lock and eax,DWORD PTR \[ebx\]
+[ ]*81[ ]+lock or eax,DWORD PTR \[ebx\]
+[ ]*82[ ]+lock sbb eax,DWORD PTR \[ebx\]
+[ ]*83[ ]+lock sub eax,DWORD PTR \[ebx\]
+[ ]*84[ ]+lock xor eax,DWORD PTR \[ebx\]
diff --git a/gas/testsuite/gas/i386/lockbad-1.s b/gas/testsuite/gas/i386/lockbad-1.s
index dbb5b5c..0dd493a 100644
--- a/gas/testsuite/gas/i386/lockbad-1.s
+++ b/gas/testsuite/gas/i386/lockbad-1.s
@@ -34,6 +34,14 @@ foo:
lock xor %ebx, %eax
lock xor $0x64, %ebx
+ lock add (%ebx), %eax
+ lock adc (%ebx), %eax
+ lock and (%ebx), %eax
+ lock or (%ebx), %eax
+ lock sbb (%ebx), %eax
+ lock sub (%ebx), %eax
+ lock xor (%ebx), %eax
+
.intel_syntax noprefix
lock mov eax,ebx
lock mov eax,DWORD PTR [ebx]
@@ -66,3 +74,11 @@ foo:
lock xchg ebx,eax
lock xor eax,ebx
lock xor ebx,0x64
+
+ lock add eax,DWORD PTR [ebx]
+ lock adc eax,DWORD PTR [ebx]
+ lock and eax,DWORD PTR [ebx]
+ lock or eax,DWORD PTR [ebx]
+ lock sbb eax,DWORD PTR [ebx]
+ lock sub eax,DWORD PTR [ebx]
+ lock xor eax,DWORD PTR [ebx]
diff --git a/gas/testsuite/gas/i386/x86-64-lock-1-intel.d b/gas/testsuite/gas/i386/x86-64-lock-1-intel.d
index 5cc0c08..3a5cc38 100644
--- a/gas/testsuite/gas/i386/x86-64-lock-1-intel.d
+++ b/gas/testsuite/gas/i386/x86-64-lock-1-intel.d
@@ -8,11 +8,11 @@
Disassembly of section .text:
0+ <foo>:
-[ ]*[a-f0-9]+: f0 03 03 lock add eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 01 03 lock add DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 03 64 lock add DWORD PTR \[rbx\],0x64
-[ ]*[a-f0-9]+: f0 13 03 lock adc eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 11 03 lock adc DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 13 64 lock adc DWORD PTR \[rbx\],0x64
-[ ]*[a-f0-9]+: f0 23 03 lock and eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 21 03 lock and DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 23 64 lock and DWORD PTR \[rbx\],0x64
[ ]*[a-f0-9]+: f0 0f bb 03 lock btc DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 0f ba 3b 64 lock btc DWORD PTR \[rbx\],0x64
@@ -26,22 +26,22 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f0 ff 03 lock inc DWORD PTR \[rbx\]
[ ]*[a-f0-9]+: f0 f7 1b lock neg DWORD PTR \[rbx\]
[ ]*[a-f0-9]+: f0 f7 13 lock not DWORD PTR \[rbx\]
-[ ]*[a-f0-9]+: f0 0b 03 lock or eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 09 03 lock or DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 0b 64 lock or DWORD PTR \[rbx\],0x64
-[ ]*[a-f0-9]+: f0 1b 03 lock sbb eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 19 03 lock sbb DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 1b 64 lock sbb DWORD PTR \[rbx\],0x64
-[ ]*[a-f0-9]+: f0 2b 03 lock sub eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 29 03 lock sub DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 2b 64 lock sub DWORD PTR \[rbx\],0x64
[ ]*[a-f0-9]+: f0 0f c1 03 lock xadd DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 87 03 lock xchg DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 87 03 lock xchg DWORD PTR \[rbx\],eax
-[ ]*[a-f0-9]+: f0 33 03 lock xor eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 31 03 lock xor DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 33 64 lock xor DWORD PTR \[rbx\],0x64
-[ ]*[a-f0-9]+: f0 03 03 lock add eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 01 03 lock add DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 03 64 lock add DWORD PTR \[rbx\],0x64
-[ ]*[a-f0-9]+: f0 13 03 lock adc eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 11 03 lock adc DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 13 64 lock adc DWORD PTR \[rbx\],0x64
-[ ]*[a-f0-9]+: f0 23 03 lock and eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 21 03 lock and DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 23 64 lock and DWORD PTR \[rbx\],0x64
[ ]*[a-f0-9]+: f0 0f bb 03 lock btc DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 0f ba 3b 64 lock btc DWORD PTR \[rbx\],0x64
@@ -55,15 +55,15 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f0 ff 03 lock inc DWORD PTR \[rbx\]
[ ]*[a-f0-9]+: f0 f7 1b lock neg DWORD PTR \[rbx\]
[ ]*[a-f0-9]+: f0 f7 13 lock not DWORD PTR \[rbx\]
-[ ]*[a-f0-9]+: f0 0b 03 lock or eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 09 03 lock or DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 0b 64 lock or DWORD PTR \[rbx\],0x64
-[ ]*[a-f0-9]+: f0 1b 03 lock sbb eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 19 03 lock sbb DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 1b 64 lock sbb DWORD PTR \[rbx\],0x64
-[ ]*[a-f0-9]+: f0 2b 03 lock sub eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 29 03 lock sub DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 2b 64 lock sub DWORD PTR \[rbx\],0x64
[ ]*[a-f0-9]+: f0 0f c1 03 lock xadd DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 87 03 lock xchg DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 87 03 lock xchg DWORD PTR \[rbx\],eax
-[ ]*[a-f0-9]+: f0 33 03 lock xor eax,DWORD PTR \[rbx\]
+[ ]*[a-f0-9]+: f0 31 03 lock xor DWORD PTR \[rbx\],eax
[ ]*[a-f0-9]+: f0 83 33 64 lock xor DWORD PTR \[rbx\],0x64
#pass
diff --git a/gas/testsuite/gas/i386/x86-64-lock-1.d b/gas/testsuite/gas/i386/x86-64-lock-1.d
index 112f289..bf065cb 100644
--- a/gas/testsuite/gas/i386/x86-64-lock-1.d
+++ b/gas/testsuite/gas/i386/x86-64-lock-1.d
@@ -7,11 +7,11 @@
Disassembly of section .text:
0+ <foo>:
-[ ]*[a-f0-9]+: f0 03 03 lock add \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 01 03 lock add %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 03 64 lock addl \$0x64,\(%rbx\)
-[ ]*[a-f0-9]+: f0 13 03 lock adc \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 11 03 lock adc %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 13 64 lock adcl \$0x64,\(%rbx\)
-[ ]*[a-f0-9]+: f0 23 03 lock and \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 21 03 lock and %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 23 64 lock andl \$0x64,\(%rbx\)
[ ]*[a-f0-9]+: f0 0f bb 03 lock btc %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 0f ba 3b 64 lock btcl \$0x64,\(%rbx\)
@@ -25,22 +25,22 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f0 ff 03 lock incl \(%rbx\)
[ ]*[a-f0-9]+: f0 f7 1b lock negl \(%rbx\)
[ ]*[a-f0-9]+: f0 f7 13 lock notl \(%rbx\)
-[ ]*[a-f0-9]+: f0 0b 03 lock or \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 09 03 lock or %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 0b 64 lock orl \$0x64,\(%rbx\)
-[ ]*[a-f0-9]+: f0 1b 03 lock sbb \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 19 03 lock sbb %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 1b 64 lock sbbl \$0x64,\(%rbx\)
-[ ]*[a-f0-9]+: f0 2b 03 lock sub \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 29 03 lock sub %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 2b 64 lock subl \$0x64,\(%rbx\)
[ ]*[a-f0-9]+: f0 0f c1 03 lock xadd %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 87 03 lock xchg %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 87 03 lock xchg %eax,\(%rbx\)
-[ ]*[a-f0-9]+: f0 33 03 lock xor \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 31 03 lock xor %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 33 64 lock xorl \$0x64,\(%rbx\)
-[ ]*[a-f0-9]+: f0 03 03 lock add \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 01 03 lock add %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 03 64 lock addl \$0x64,\(%rbx\)
-[ ]*[a-f0-9]+: f0 13 03 lock adc \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 11 03 lock adc %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 13 64 lock adcl \$0x64,\(%rbx\)
-[ ]*[a-f0-9]+: f0 23 03 lock and \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 21 03 lock and %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 23 64 lock andl \$0x64,\(%rbx\)
[ ]*[a-f0-9]+: f0 0f bb 03 lock btc %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 0f ba 3b 64 lock btcl \$0x64,\(%rbx\)
@@ -54,15 +54,15 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f0 ff 03 lock incl \(%rbx\)
[ ]*[a-f0-9]+: f0 f7 1b lock negl \(%rbx\)
[ ]*[a-f0-9]+: f0 f7 13 lock notl \(%rbx\)
-[ ]*[a-f0-9]+: f0 0b 03 lock or \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 09 03 lock or %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 0b 64 lock orl \$0x64,\(%rbx\)
-[ ]*[a-f0-9]+: f0 1b 03 lock sbb \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 19 03 lock sbb %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 1b 64 lock sbbl \$0x64,\(%rbx\)
-[ ]*[a-f0-9]+: f0 2b 03 lock sub \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 29 03 lock sub %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 2b 64 lock subl \$0x64,\(%rbx\)
[ ]*[a-f0-9]+: f0 0f c1 03 lock xadd %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 87 03 lock xchg %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 87 03 lock xchg %eax,\(%rbx\)
-[ ]*[a-f0-9]+: f0 33 03 lock xor \(%rbx\),%eax
+[ ]*[a-f0-9]+: f0 31 03 lock xor %eax,\(%rbx\)
[ ]*[a-f0-9]+: f0 83 33 64 lock xorl \$0x64,\(%rbx\)
#pass
diff --git a/gas/testsuite/gas/i386/x86-64-lock-1.s b/gas/testsuite/gas/i386/x86-64-lock-1.s
index 5f21dce..e6da5c5 100644
--- a/gas/testsuite/gas/i386/x86-64-lock-1.s
+++ b/gas/testsuite/gas/i386/x86-64-lock-1.s
@@ -2,11 +2,11 @@
.text
foo:
- lock add (%rbx), %eax
+ lock add %eax, (%rbx)
lock add $0x64, (%rbx)
- lock adc (%rbx), %eax
+ lock adc %eax, (%rbx)
lock adc $0x64, (%rbx)
- lock and (%rbx), %eax
+ lock and %eax, (%rbx)
lock and $0x64, (%rbx)
lock btc %eax, (%rbx)
lock btc $0x64, (%rbx)
@@ -20,24 +20,24 @@ foo:
lock incl (%rbx)
lock negl (%rbx)
lock notl (%rbx)
- lock or (%rbx), %eax
+ lock or %eax, (%rbx)
lock or $0x64, (%rbx)
- lock sbb (%rbx), %eax
+ lock sbb %eax, (%rbx)
lock sbb $0x64, (%rbx)
- lock sub (%rbx), %eax
+ lock sub %eax, (%rbx)
lock sub $0x64, (%rbx)
lock xadd %eax, (%rbx)
lock xchg (%rbx), %eax
lock xchg %eax, (%rbx)
- lock xor (%rbx), %eax
+ lock xor %eax, (%rbx)
lock xor $0x64, (%rbx)
.intel_syntax noprefix
- lock add eax,DWORD PTR [rbx]
+ lock add DWORD PTR [rbx],eax
lock add DWORD PTR [rbx],0x64
- lock adc eax,DWORD PTR [rbx]
+ lock adc DWORD PTR [rbx],eax
lock adc DWORD PTR [rbx],0x64
- lock and eax,DWORD PTR [rbx]
+ lock and DWORD PTR [rbx],eax
lock and DWORD PTR [rbx],0x64
lock btc DWORD PTR [rbx],eax
lock btc DWORD PTR [rbx],0x64
@@ -51,14 +51,14 @@ foo:
lock inc DWORD PTR [rbx]
lock neg DWORD PTR [rbx]
lock not DWORD PTR [rbx]
- lock or eax,DWORD PTR [rbx]
+ lock or DWORD PTR [rbx],eax
lock or DWORD PTR [rbx],0x64
- lock sbb eax,DWORD PTR [rbx]
+ lock sbb DWORD PTR [rbx],eax
lock sbb DWORD PTR [rbx],0x64
- lock sub eax,DWORD PTR [rbx]
+ lock sub DWORD PTR [rbx],eax
lock sub DWORD PTR [rbx],0x64
lock xadd DWORD PTR [rbx],eax
lock xchg DWORD PTR [rbx],eax
lock xchg DWORD PTR [rbx],eax
- lock xor eax,DWORD PTR [rbx]
+ lock xor DWORD PTR [rbx],eax
lock xor DWORD PTR [rbx],0x64
diff --git a/gas/testsuite/gas/i386/x86-64-lockbad-1.l b/gas/testsuite/gas/i386/x86-64-lockbad-1.l
index 9753e14..dad0c06 100644
--- a/gas/testsuite/gas/i386/x86-64-lockbad-1.l
+++ b/gas/testsuite/gas/i386/x86-64-lockbad-1.l
@@ -29,16 +29,15 @@
.*:33: Error: .*
.*:34: Error: .*
.*:35: Error: .*
+.*:37: Error: .*
.*:38: Error: .*
.*:39: Error: .*
+.*:40: Error: .*
.*:41: Error: .*
.*:42: Error: .*
.*:43: Error: .*
-.*:44: Error: .*
-.*:45: Error: .*
.*:46: Error: .*
.*:47: Error: .*
-.*:48: Error: .*
.*:49: Error: .*
.*:50: Error: .*
.*:51: Error: .*
@@ -59,6 +58,21 @@
.*:66: Error: .*
.*:67: Error: .*
.*:68: Error: .*
+.*:69: Error: .*
+.*:70: Error: .*
+.*:71: Error: .*
+.*:72: Error: .*
+.*:73: Error: .*
+.*:74: Error: .*
+.*:75: Error: .*
+.*:76: Error: .*
+.*:78: Error: .*
+.*:79: Error: .*
+.*:80: Error: .*
+.*:81: Error: .*
+.*:82: Error: .*
+.*:83: Error: .*
+.*:84: Error: .*
GAS LISTING .*
@@ -98,38 +112,54 @@ GAS LISTING .*
[ ]*34[ ]+lock xor %ebx, %eax
[ ]*35[ ]+lock xor \$0x64, %ebx
[ ]*36[ ]+
-[ ]*37[ ]+\.intel_syntax noprefix
-[ ]*38[ ]+lock mov eax,ebx
-[ ]*39[ ]+lock mov eax,DWORD PTR \[rbx\]
-[ ]*40[ ]+
-[ ]*41[ ]+lock add eax,ebx
-[ ]*42[ ]+lock add ebx,0x64
-[ ]*43[ ]+lock adc eax,ebx
-[ ]*44[ ]+lock adc ebx,0x64
-[ ]*45[ ]+lock and eax,ebx
-[ ]*46[ ]+lock and ebx,0x64
-[ ]*47[ ]+lock btc ebx,eax
-[ ]*48[ ]+lock btc ebx,0x64
-[ ]*49[ ]+lock btr ebx,eax
-[ ]*50[ ]+lock btr ebx,0x64
-[ ]*51[ ]+lock bts ebx,eax
-[ ]*52[ ]+lock bts ebx,0x64
-[ ]*53[ ]+lock cmpxchg ebx,eax
-[ ]*54[ ]+lock dec ebx
-[ ]*55[ ]+lock inc ebx
-[ ]*56[ ]+lock neg ebx
-[ ]*57[ ]+lock not ebx
+[ ]*37[ ]+lock add \(%rbx\), %eax
+[ ]*38[ ]+lock adc \(%rbx\), %eax
+[ ]*39[ ]+lock and \(%rbx\), %eax
+[ ]*40[ ]+lock or \(%rbx\), %eax
+[ ]*41[ ]+lock sbb \(%rbx\), %eax
+[ ]*42[ ]+lock sub \(%rbx\), %eax
+[ ]*43[ ]+lock xor \(%rbx\), %eax
+[ ]*44[ ]+
+[ ]*45[ ]+\.intel_syntax noprefix
+[ ]*46[ ]+lock mov eax,ebx
+[ ]*47[ ]+lock mov eax,DWORD PTR \[rbx\]
+[ ]*48[ ]+
+[ ]*49[ ]+lock add eax,ebx
+[ ]*50[ ]+lock add ebx,0x64
+[ ]*51[ ]+lock adc eax,ebx
+[ ]*52[ ]+lock adc ebx,0x64
+[ ]*53[ ]+lock and eax,ebx
+[ ]*54[ ]+lock and ebx,0x64
+[ ]*55[ ]+lock btc ebx,eax
+[ ]*56[ ]+lock btc ebx,0x64
+[ ]*57[ ]+lock btr ebx,eax
GAS LISTING .*
-[ ]*58[ ]+lock or eax,ebx
-[ ]*59[ ]+lock or ebx,0x64
-[ ]*60[ ]+lock sbb eax,ebx
-[ ]*61[ ]+lock sbb ebx,0x64
-[ ]*62[ ]+lock sub eax,ebx
-[ ]*63[ ]+lock sub ebx,0x64
-[ ]*64[ ]+lock xadd ebx,eax
-[ ]*65[ ]+lock xchg ebx,eax
-[ ]*66[ ]+lock xchg ebx,eax
-[ ]*67[ ]+lock xor eax,ebx
-[ ]*68[ ]+lock xor ebx,0x64
+[ ]*58[ ]+lock btr ebx,0x64
+[ ]*59[ ]+lock bts ebx,eax
+[ ]*60[ ]+lock bts ebx,0x64
+[ ]*61[ ]+lock cmpxchg ebx,eax
+[ ]*62[ ]+lock dec ebx
+[ ]*63[ ]+lock inc ebx
+[ ]*64[ ]+lock neg ebx
+[ ]*65[ ]+lock not ebx
+[ ]*66[ ]+lock or eax,ebx
+[ ]*67[ ]+lock or ebx,0x64
+[ ]*68[ ]+lock sbb eax,ebx
+[ ]*69[ ]+lock sbb ebx,0x64
+[ ]*70[ ]+lock sub eax,ebx
+[ ]*71[ ]+lock sub ebx,0x64
+[ ]*72[ ]+lock xadd ebx,eax
+[ ]*73[ ]+lock xchg ebx,eax
+[ ]*74[ ]+lock xchg ebx,eax
+[ ]*75[ ]+lock xor eax,ebx
+[ ]*76[ ]+lock xor ebx,0x64
+[ ]*77[ ]+
+[ ]*78[ ]+lock add eax,DWORD PTR \[rbx\]
+[ ]*79[ ]+lock adc eax,DWORD PTR \[rbx\]
+[ ]*80[ ]+lock and eax,DWORD PTR \[rbx\]
+[ ]*81[ ]+lock or eax,DWORD PTR \[rbx\]
+[ ]*82[ ]+lock sbb eax,DWORD PTR \[rbx\]
+[ ]*83[ ]+lock sub eax,DWORD PTR \[rbx\]
+[ ]*84[ ]+lock xor eax,DWORD PTR \[rbx\]
diff --git a/gas/testsuite/gas/i386/x86-64-lockbad-1.s b/gas/testsuite/gas/i386/x86-64-lockbad-1.s
index 6a20a0c..8b1f9b0 100644
--- a/gas/testsuite/gas/i386/x86-64-lockbad-1.s
+++ b/gas/testsuite/gas/i386/x86-64-lockbad-1.s
@@ -34,6 +34,14 @@ foo:
lock xor %ebx, %eax
lock xor $0x64, %ebx
+ lock add (%rbx), %eax
+ lock adc (%rbx), %eax
+ lock and (%rbx), %eax
+ lock or (%rbx), %eax
+ lock sbb (%rbx), %eax
+ lock sub (%rbx), %eax
+ lock xor (%rbx), %eax
+
.intel_syntax noprefix
lock mov eax,ebx
lock mov eax,DWORD PTR [rbx]
@@ -66,3 +74,11 @@ foo:
lock xchg ebx,eax
lock xor eax,ebx
lock xor ebx,0x64
+
+ lock add eax,DWORD PTR [rbx]
+ lock adc eax,DWORD PTR [rbx]
+ lock and eax,DWORD PTR [rbx]
+ lock or eax,DWORD PTR [rbx]
+ lock sbb eax,DWORD PTR [rbx]
+ lock sub eax,DWORD PTR [rbx]
+ lock xor eax,DWORD PTR [rbx]