2010-11-25 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
authorAndreas Krebbel <Andreas.Krebbel@de.ibm.com>
Thu, 25 Nov 2010 09:33:54 +0000 (09:33 +0000)
committerAndreas Krebbel <Andreas.Krebbel@de.ibm.com>
Thu, 25 Nov 2010 09:33:54 +0000 (09:33 +0000)
* config/tc-s390.c (current_cpu): Initialize with latest CPU.
(init_default_arch): Default to z/Architecture mode if CPU provides it.
Remove the check setting the CPU default.

2010-11-25  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

* opcode/s390.h (enum s390_opcode_cpu_val): Add S390_OPCODE_MAXCPU.

gas/ChangeLog
gas/config/tc-s390.c
include/ChangeLog
include/opcode/s390.h

index fcce43cc9ed2e010e65227b46fbe585ad049e53c..60cb1b0fcd069244674400466e48bdc173089183 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-25  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+       * config/tc-s390.c (current_cpu): Initialize with latest CPU.
+       (init_default_arch): Default to z/Architecture mode if CPU provides it.
+       Remove the check setting the CPU default.
+
 2010-11-25  Alan Modra  <amodra@gmail.com>
 
        * po/es.po: Update.
index 273ddd6512e3740501f8724b6f3be0fdc492adf5..ca7ad3b58d7765a52b28c19056060283ce04a27e 100644 (file)
@@ -38,8 +38,11 @@ static char *default_arch = DEFAULT_ARCH;
 /* Either 32 or 64, selects file format.  */
 static int s390_arch_size = 0;
 
+/* If no -march option was given default to the highest available CPU.
+   Since with S/390 a newer CPU always supports everything from its
+   predecessors this will accept every valid asm input.  */
+static unsigned int current_cpu = S390_OPCODE_MAXCPU - 1;
 static unsigned int current_mode_mask = 0;
-static unsigned int current_cpu = -1U;
 
 /* Whether to use user friendly register names. Default is TRUE.  */
 #ifndef TARGET_REG_NAMES_P
@@ -328,18 +331,12 @@ init_default_arch (void)
 
   if (current_mode_mask == 0)
     {
-      if (s390_arch_size == 32)
+      /* Default to z/Architecture mode if the CPU supports it.  */
+      if (current_cpu < S390_OPCODE_Z900)
        current_mode_mask = 1 << S390_OPCODE_ESA;
       else
        current_mode_mask = 1 << S390_OPCODE_ZARCH;
     }
-  if (current_cpu == -1U)
-    {
-      if (current_mode_mask == (1 << S390_OPCODE_ESA))
-       current_cpu = S390_OPCODE_G5;
-      else
-       current_cpu = S390_OPCODE_Z900;
-    }
 }
 
 /* Called by TARGET_FORMAT.  */
index bcaf5f2b2256b610d387905be51a2fc2795cdbd2..1cff8930558abf2affd5cbb613554063f05d65b3 100644 (file)
@@ -1,3 +1,7 @@
+2010-11-25  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
+
+       * opcode/s390.h (enum s390_opcode_cpu_val): Add S390_OPCODE_MAXCPU.
+
 2010-11-16  Ian Lance Taylor  <iant@google.com>
 
        * simple-object.h (simple_object_attributes_merge): Declare,
index 399904c04f76209387e620dc9a1c70a519c8ed06..2cbe5f53d60cc347949790564b6a72e260132efb 100644 (file)
@@ -39,7 +39,8 @@ enum s390_opcode_cpu_val
     S390_OPCODE_Z9_109,
     S390_OPCODE_Z9_EC,
     S390_OPCODE_Z10,
-    S390_OPCODE_Z196
+    S390_OPCODE_Z196,
+    S390_OPCODE_MAXCPU
   };
 
 /* The opcode table is an array of struct s390_opcode.  */
This page took 0.028628 seconds and 4 git commands to generate.