This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] init_default_arch for s390*.
- From: Martin Schwidefsky <schwidefsky at de dot ibm dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 18 Jun 2003 13:13:23 +0200
- Subject: [PATCH] init_default_arch for s390*.
Hi,
I changed init_default_arch for s390 so that the default for the cpu mode
(-m{esa,zarch}) depends on the chosen architecture size and not on the
default architecture size, and the default cpu -march={g5,g6,z900} depends
on the cpu mode that is used for the assembly.
For example if a gas with the defaults -m31, -mesa and -march=g5 is called
with -m64 the other two options will now be set to -mzarch and -march=z900
instead of -mesa and -march=g5. With the old init_default_arch the resulting
set of options (-m64 -mesa -march=g5) didn't make sense.
blue skies,
Martin.
2003-06-18 Martin Schwidefsky <schwidefsky@de.ibm.com>
* config/tc-s390.c (init_default_arch): Make current_mode_mask
dependent on s390_arch_size and current_cpu dependent on
current_mode_mask.
diff -urN src/gas/config/tc-s390.c src-s390/gas/config/tc-s390.c
--- src/gas/config/tc-s390.c Fri May 9 17:30:31 2003
+++ src-s390/gas/config/tc-s390.c Wed Jun 18 12:55:15 2003
@@ -327,22 +327,29 @@
{
if (s390_arch_size == 0)
s390_arch_size = 32;
- if (current_mode_mask == 0)
- current_mode_mask = 1 << S390_OPCODE_ESA;
- if (current_cpu == -1U)
- current_cpu = S390_OPCODE_G5;
}
else if (strcmp (default_arch, "s390x") == 0)
{
if (s390_arch_size == 0)
s390_arch_size = 64;
- if (current_mode_mask == 0)
- current_mode_mask = 1 << S390_OPCODE_ZARCH;
- if (current_cpu == -1U)
- current_cpu = S390_OPCODE_Z900;
}
else
as_fatal ("Invalid default architecture, broken assembler.");
+
+ if (current_mode_mask == 0)
+ {
+ if (s390_arch_size == 32)
+ 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. */