[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: powerpc-rtems-4.7-gcc-4.0 patch commited

On Thu, Feb 17, 2005 at 01:52:58PM -0800, Till Straumann wrote:

> David Querbach wrote:
> >The ss555 BSP uses -mcpu=505, because as far as I can tell, it's the most
> >appropriate gcc cpu variant for the MPC555.  From what I can see in the
> >source for gcc (up to 3.4.1), there is no other -mcpu=5xx variant 
> >available.
> >
> >If a 555 variant has been added in newer versions of gcc, I'd like a chance
> >to test it before the m505 multilib disappears.
> >
> Why do you think you need mcpu=xxx other than powerpc ?

Working by analogy from other ports, especially the mbx8xx ports.  Upon
closer examination, it's clear that the mbx8xx ports are not good examples,
since they need soft-float, whereas the mpc555 does not.  The mpc555 is thus
much closer to the PowerPC mainstream, and we might expect that -mcpu=powerpc
would work.

I just tried rebuilding the ss555 port using -mcpu=powerpc.  The code seems
to work properly, but it's not identical to the -mcpu=505 code at the object
code level.  The same functionality appears in both, but re-arranged.

I've looked through the compiler specs and through gcc/config/rs6000/* in
the compiler source, but I can't for the life of me see where the -mcpu=505
switch is converted to "-mno-power, -mpowerpc, -mnew-mnemonics", as gcc.info

> It's amazing: until now, nobody has come up with a good reason for 
> creating any
> -mcpu=xxx variant and yet there are still way too many...

If they truly generate identical code (or even functionally equivalent
code), then they serve only to muddy the waters.

> Note that a #ifdef __mpcXXX in a BSP is *not* a valid reason as the
> respective compiler switch could go into bsp_specs. A run-time check for
> CPU type is even better.

There aren't any of these sorts of tests in the ss555 port.
> The only (legacy) reason I can think of are #ifdef __mpcXXX in cpukit
> and/or libcpu - however, these should be cleaned up.

There are still a few of these, but only one in .../new-exceptions/cpu.h
refers to "mpc555".  (It's used to add a CPU clock speed field to the
rtems_cpu_table structure.)  Again, I'm working by analogy with other ports,
and I welcome suggestions for better ways of doing this.

As long as the code still works, I see no reason not to use -mcpu=powerpc in
the ss555 port.  But since it generates different object code, I'd like to
either understand why, or at least test it a bit first.  I'm in the middle
of an ss555 project, so I'll switch over to -mcpu=powerpc now to put a few
miles on it.


David Querbach
Real-Time Systems Inc.

Attachment: signature.asc
Description: Digital signature