[Committed] S/390: gas: Add -march=all

Andreas Krebbel krebbel@linux.vnet.ibm.com
Fri Mar 18 09:59:00 GMT 2011


Hi,

the attached patch adds "all" as cpu type for the S/390 backend.  It
can be used in situations where the code does runtime checks in order
to make sure that an instruction can be used.  'as' in then would
reject the instruction when invoked with a lower CPU level.  Having
-march=all the build machinery can override the passthrough of
-march=x from GCC by using -Wa,-march=all on the GCC command line.

We had this situation recently in glibc:

http://sources.redhat.com/ml/libc-alpha/2011-03/msg00000.html

Committed to mainline.

Bye,

-Andreas-

2011-03-18  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* config/tc-s390.c (md_parse_option): Add -march=all option which
	switches to the highest available CPU.

Index: gas/config/tc-s390.c
===================================================================
--- gas/config/tc-s390.c.orig
+++ gas/config/tc-s390.c
@@ -398,6 +398,8 @@ md_parse_option (int c, char *arg)
 	    current_cpu = S390_OPCODE_Z10;
 	  else if (strcmp (arg + 5, "z196") == 0)
 	    current_cpu = S390_OPCODE_Z196;
+	  else if (strcmp (arg + 5, "all") == 0)
+	    current_cpu = S390_OPCODE_MAXCPU - 1;
 	  else
 	    {
 	      as_bad (_("invalid switch -m%s"), arg);



More information about the Binutils mailing list