[rfc] nopl should not be output on -mtune=i686

H.J. Lu hjl.tools@gmail.com
Tue Feb 8 18:20:00 GMT 2011


On Tue, Feb 8, 2011 at 9:10 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
>
> The flag `+nop' (such as `-march=i686+nop') does not work for me as expected
> with HEAD and neither works with the patched code.
>
>

That is what I checked in.

-- 
H.J.
---
gas/

2011-02-08  H.J. Lu  <hongjiu.lu@intel.com>

	* config/tc-i386.c (set_cpu_arch): Also update cpu_arch_isa_flags
	for ISA extensions.
	(md_parse_option): Likewise.

gas/testsuite/

2011-02-08  H.J. Lu  <hongjiu.lu@intel.com>

	* gas/i386/i386.exp: Run nops-4a-i686 and nops-6.

	* gas/i386/nops-4a-i686.d: New.
	* gas/i386/nops-6.d: Likewise.
	* gas/i386/nops-6.s: Likewise.
-------------- next part --------------
diff --git a/gas/ChangeLog b/gas/ChangeLog
index bf75bbf..636e9e8 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-08  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* config/tc-i386.c (set_cpu_arch): Also update cpu_arch_isa_flags
+	for ISA extensions.
+	(md_parse_option): Likewise.
+
 2011-02-04  Bernd Schmidt  <bernds@codesourcery.com>
 
 	* doc/as.texinfo (Target TIC6X options): Don't mention "-matomic".
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 0028f17..777d7cf 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2176,6 +2176,7 @@ set_cpu_arch (int dummy ATTRIBUTE_UNUSED)
 		  else
 		    cpu_sub_arch_name = xstrdup (cpu_arch[j].name);
 		  cpu_arch_flags = flags;
+		  cpu_arch_isa_flags = flags;
 		}
 	      *input_line_pointer = e;
 	      demand_empty_rest_of_line ();
@@ -8343,6 +8344,7 @@ md_parse_option (int c, char *arg)
 		      else
 			cpu_sub_arch_name = xstrdup (cpu_arch[j].name);
 		      cpu_arch_flags = flags;
+		      cpu_arch_isa_flags = flags;
 		    }
 		  break;
 		}
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 166d8db..16efa6d 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2011-02-08  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* gas/i386/i386.exp: Run nops-4a-i686 and nops-6.
+
+	* gas/i386/nops-4a-i686.d: New.
+	* gas/i386/nops-6.d: Likewise.
+	* gas/i386/nops-6.s: Likewise.
+
 2011-02-07  Vincent Riviere  <vincent.riviere@freesbee.fr>
 
 	PR gas/3041
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index a0abf28..306da65 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -91,8 +91,10 @@ if [expr ([istarget "i*86-*-*"] ||  [istarget "x86_64-*-*"]) && [gas_32_check]]
     run_dump_test "nops-4"
     run_dump_test "nops-4-i386"
     run_dump_test "nops-4-i686"
+    run_dump_test "nops-4a-i686"
     run_dump_test "nops-5"
     run_dump_test "nops-5-i686"
+    run_dump_test "nops-6"
     run_dump_test "addr16"
     run_dump_test "addr32"
     run_dump_test "sse4_1"
--- /dev/null	2011-02-07 14:55:09.229000001 -0800
+++ binutils/gas/testsuite/gas/i386/nops-4a-i686.d	2011-02-08 09:45:20.897474145 -0800
@@ -0,0 +1,210 @@
+#as: -march=i686+nop
+#source: nops-4.s
+#objdump: -drw
+#name: i386 -march=i686+nop nops 4a
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <nop31>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+20 <nop30>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+40 <nop29>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+60 <nop28>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+80 <nop27>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+a0 <nop26>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	66 66 2e 0f 1f 84 00 00 00 00 00 	data32 nopw %cs:0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+c0 <nop25>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	66 2e 0f 1f 84 00 00 00 00 00 	nopw   %cs:0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+e0 <nop24>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	66 0f 1f 84 00 00 00 00 00 	nopw   0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+100 <nop23>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	0f 1f 84 00 00 00 00 00 	nopl   0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+120 <nop22>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	0f 1f 80 00 00 00 00 	nopl   0x0\(%eax\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+140 <nop21>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+160 <nop20>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	0f 1f 44 00 00       	nopl   0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+180 <nop19>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	0f 1f 40 00          	nopl   0x0\(%eax\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+1a0 <nop18>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	0f 1f 00             	nopl   \(%eax\)
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+1c0 <nop17>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	66 90                	xchg   %ax,%ax
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+
+0+1e0 <nop16>:
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	90                   	nop
+[ 	]*[a-f0-9]+:	66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 	data32 data32 data32 data32 data32 nopw %cs:0x0\(%eax,%eax,1\)
+#pass
--- /dev/null	2011-02-07 14:55:09.229000001 -0800
+++ binutils/gas/testsuite/gas/i386/nops-6.d	2011-02-08 09:57:40.598154540 -0800
@@ -0,0 +1,17 @@
+#objdump: -drw
+#name: i386 nops 6
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <i386>:
+[ 	]*[a-f0-9]+:	0f be f0             	movsbl %al,%esi
+[ 	]*[a-f0-9]+:	8d b6 00 00 00 00    	lea    0x0\(%esi\),%esi
+[ 	]*[a-f0-9]+:	8d bc 27 00 00 00 00 	lea    0x0\(%edi,%eiz,1\),%edi
+
+0+10 <i386_nop>:
+[ 	]*[a-f0-9]+:	0f be f0             	movsbl %al,%esi
+[ 	]*[a-f0-9]+:	66 0f 1f 44 00 00    	nopw   0x0\(%eax,%eax,1\)
+[ 	]*[a-f0-9]+:	0f 1f 80 00 00 00 00 	nopl   0x0\(%eax\)
+#pass
--- /dev/null	2011-02-07 14:55:09.229000001 -0800
+++ binutils/gas/testsuite/gas/i386/nops-6.s	2011-02-08 09:53:51.199267429 -0800
@@ -0,0 +1,10 @@
+	.text
+	.arch i386
+i386:
+	movsbl %al,%esi
+	.p2align 4
+
+	.arch .nop
+i386_nop:
+	movsbl %al,%esi
+	.p2align 4


More information about the Binutils mailing list