This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] x86 gas: allow 'rep nop'


On Mon, Jul 2, 2012 at 10:10 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> Please add the rep nop test to both rep-suffix.s and x86-64-rep-suffix.s.
> OK with this change.

I've committed it as follows.


Thanks,
Roland


gas/testsuite/
2012-07-02  Roland McGrath  <mcgrathr@google.com>

	* gas/i386/rep-suffix.s: Add 'rep nop' case.
	* gas/i386/x86-64-rep-suffix.s: Likewise.
	* gas/i386/rep-suffix.d: Updated.
	* gas/i386/x86-64-rep-suffix.d: Likewise.
	* gas/i386/ilp32/x86-64-rep-suffix.d: Likewise.

opcodes/
2012-07-02  Roland McGrath  <mcgrathr@google.com>

	* i386-opc.tbl: Add RepPrefixOk to nop.
	* i386-tbl.h: Regenerate.

diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-rep-suffix.d
b/gas/testsuite/gas/i386/ilp32/x86-64-rep-suffix.d
index 241365d..19bb585 100644
--- a/gas/testsuite/gas/i386/ilp32/x86-64-rep-suffix.d
+++ b/gas/testsuite/gas/i386/ilp32/x86-64-rep-suffix.d
@@ -17,5 +17,6 @@ Disassembly of section .text:
   11:	f3 48 ab[ 	]+rep stosq %rax,%es:\(%rdi\)
   14:	f3 0f bc c1[	 ]+tzcntl %ecx,%eax
   18:	f3 0f bd c1[	 ]+lzcntl %ecx,%eax
-  1c:	f3 c3[	 ]+repz retq
+  1c:	f3 c3[	 ]+repz retq\s*
+  1e:	f3 90[	 ]+pause\s*
 #pass
diff --git a/gas/testsuite/gas/i386/rep-suffix.d
b/gas/testsuite/gas/i386/rep-suffix.d
index 81f8d61..08e02d7 100644
--- a/gas/testsuite/gas/i386/rep-suffix.d
+++ b/gas/testsuite/gas/i386/rep-suffix.d
@@ -14,5 +14,6 @@ Disassembly of section .text:
    c:	f3 ab[ 	]+rep stosl %eax,%es:\(%edi\)
    e:	f3 0f bc c1[	 ]+tzcntl %ecx,%eax
   12:	f3 0f bd c1[	 ]+lzcntl %ecx,%eax
-  16:	f3 c3[	 ]+repz retl
+  16:	f3 c3[	 ]+repz retl\s*
+  18:	f3 90[	 ]+pause\s*
 #pass
diff --git a/gas/testsuite/gas/i386/rep-suffix.s
b/gas/testsuite/gas/i386/rep-suffix.s
index 6f53663..12bdbd0 100644
--- a/gas/testsuite/gas/i386/rep-suffix.s
+++ b/gas/testsuite/gas/i386/rep-suffix.s
@@ -12,3 +12,5 @@ _start:
 	rep bsr %ecx, %eax

 	rep ret
+
+	rep nop
diff --git a/gas/testsuite/gas/i386/x86-64-rep-suffix.d
b/gas/testsuite/gas/i386/x86-64-rep-suffix.d
index 3c3f7ea..bc6346d 100644
--- a/gas/testsuite/gas/i386/x86-64-rep-suffix.d
+++ b/gas/testsuite/gas/i386/x86-64-rep-suffix.d
@@ -16,5 +16,6 @@ Disassembly of section .text:
   11:	f3 48 ab[ 	]+rep stosq %rax,%es:\(%rdi\)
   14:	f3 0f bc c1[	 ]+tzcntl %ecx,%eax
   18:	f3 0f bd c1[	 ]+lzcntl %ecx,%eax
-  1c:	f3 c3[	 ]+repz retq
+  1c:	f3 c3[	 ]+repz retq\s*
+  1e:	f3 90[	 ]+pause\s*
 #pass
diff --git a/gas/testsuite/gas/i386/x86-64-rep-suffix.s
b/gas/testsuite/gas/i386/x86-64-rep-suffix.s
index 43d71cf..94df9e5 100644
--- a/gas/testsuite/gas/i386/x86-64-rep-suffix.s
+++ b/gas/testsuite/gas/i386/x86-64-rep-suffix.s
@@ -14,3 +14,5 @@ _start:
 	rep bsr %ecx, %eax

 	rep ret
+
+	rep nop
diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl
index 7de61a7..54cc0d1 100644
--- a/opcodes/i386-opc.tbl
+++ b/opcodes/i386-opc.tbl
@@ -504,7 +504,7 @@ nop, 1, 0xf1f, 0x0, 2, CpuNop,
Modrm|No_bSuf|No_sSuf|No_ldSuf, { Reg16|Reg32|Reg

 // nop is actually "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
 // 32bit mode and "xchg %rax,%rax" in 64bit mode.
-nop, 0, 0x90, None, 1, 0,
No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { 0 }
+nop, 0, 0x90, None, 1, 0,
No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|RepPrefixOk, { 0 }

 // Protection control.
 arpl, 2, 0x63, None, 1, Cpu286|CpuNo64,
Modrm|IgnoreSize|No_bSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Reg16,
Reg16|Word|Unspecified|BaseIndex|Disp8|Disp16|Disp32 }
diff --git a/opcodes/i386-tbl.h b/opcodes/i386-tbl.h
index 89dfda4..2248c7b 100644
--- a/opcodes/i386-tbl.h
+++ b/opcodes/i386-tbl.h
@@ -4142,7 +4142,7 @@ const insn_template i386_optab[] =
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
-      1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
       0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
     { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]