This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: impact of -minsert-sched-nops


>>>>> Jack Howarth writes:

Jack> The question I have is how portable is the code generated if I do
Jack> the following...

Jack> 1) On a G5 (Power4) based machine, compile code with 
Jack> -minsert-sched-nops=scheme (which I assume will result in 
Jack> the default with scheme="regroup_exact" being used). 

Jack> 2) Move the compiled binaries over to a G4 and try to
Jack> run them. Will the use of this scheme in the binary
Jack> cause problems on a G4?

	"Compile on a G5 based machine" is irrelevant.  The information of
importance is whether the compiler is targetting G5.

Jack> I guess I am still a bit confused. If the scheme="regroup_exact"
Jack> doesn't cause problems on a G4 but is useful on a G5, it would
Jack> seem appropriate to allow users to effectively 'cross-compile'
Jack> for the G5 on a G4. That is you ought to be able to do a 
Jack> compile with...

Jack> -minsert-sched-nops="regroup_exact"

Jack> ...on a G4 and move that code over to a G5 and have the
Jack> scheme "regroup_exact" still function. Again the point is
Jack> to be able to access this option for the G5 without resorting
Jack> to the -mcpu=670 flag that would make the code use G5-specific
Jack> instructions and not run on a G4.

	Whether the compiler is targeted for G4 or G5, -minsert-sched-nops
will not cause problems.  The option simply inserts NOPs and a few NOPs
are not harmful to non-G5 processors.  Without targetting G5/970/POWER4,
the feature cannot know where to insert NOPs.

	I infer that you want to compile code with

		-mtune=G5

or maybe

		-mcpu=G4 -mtune=G5

to use G4 features and G5 scheduling so the application runs on both
platforms but is tuned best for G5.

	Contrary to what I was trying to say in earlier messages, the
processor model for NOP insertion is keyed off of "-mtune=".  However, 
use of MFCRF is keyed off of that as well, which is incorrect.  Geoff and
I are going to need to figure out how to test arch for that decision.

David


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]