S/390: -march= and -mcpu= options

David Edelsohn dje@watson.ibm.com
Mon Dec 23 20:16:00 GMT 2002


>>>>> Ulrich Weigand writes:

Ulrich> David Edelsohn wrote:
>> First there are backward compatibility issues in a complete s390
>> port.

Ulrich> Which issues are you thinking of?  Up to now, the s390 port has
Ulrich> never accepted any of the options under discussion now, so there
Ulrich> are no old options to be compatible with ...

	Compatibility with pre-G5 processors.  I am not referring to
command-line compatibility.

>> Second, the people who participated in the earlier discussion
>> agreed that there should be a shorthand.

Ulrich> Why shouldn't -march=z900 be enough?  The compiler has to 
Ulrich> select *some* scheduling model, and it would be silly to
Ulrich> schedule for a CPU the generated code cannot run on, thus
Ulrich> it would be reasonable to default to -mtune=z900 if
Ulrich> -march=z900 is given.  What should then be the difference 
Ulrich> between -mcpu=z900 and -march=z900?

	Your premise is wrong.  z900 64-bit code cannot run on a G5
system, but G5 code can run on a z900 system.  One may want to compile
applications tuned for systems with the widest deployment or tuned for
newest systems.  Commercial compilers from hardware vendors like HP, IBM,
SGI, Sun, etc. frequently do the latter -- one wants applications to run
best on new hardware while remaining backward compatible with the earliest
architecture still supported.

	It would be useful to have consistent options in all GCC ports.
-march=, -mtune=, and -mcpu= have individual merit and well-defined
meaning.  It would be helpful if the s390 port adopted the same
conventions as other ports, especially because it is not difficult to
implement the semantics of the three options.

David



More information about the Gcc-patches mailing list