This is the mail archive of the gcc-patches@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: config.guess for mpc8540-linux


Hi Ben,

On Wed, Apr 04, 2007 at 11:45:17AM +1000, Ben Elliston wrote:
> Hi.
> 
> > I just compiled gcc with default options on a mpc8540 board running
> > linux but the produced compiler is not able to generate the specific
> > SPE instructions of the MPC8540, because config.guess does not
> > differentiate my board from another powerpc computer.
> 
> There are many CPU variants on some of the most common processor
> architectures.  We do not attempt to deal with them in the way you've
> described.  config.guess has correctly guessed that the host system is
> powerpc-unknown-linux-gnu.  If you want to ensure that the compiled
> code is optimial for the mpc8540, you should pass appropriate options
> to GCC.

Note : I sent this answer also to the two lists.

In this precise case, it is not a tuning problem, but an instruction set
problem.  The powerpc family has fadd & co for floating point instructions.
The mpc8540 does not have those instructions, but has efsadd & co (called
also spe) for floating point instructions.

When the system is recognised as powerpc-unknown-linux-gnu :
- the produced gcc compiler will emit fadd & co.  On mpc8540-linux, That
  will run, but very slowly, and only because linux traps and emulates
  those instruction in software.  
- the produced gcc compiler accepts silently the -mcpu=8540 and -mspe options,
  but continues to emit fadd & co, not efsadd & co.  Using `strings' on cc1
  reveals that efsadd is even not compiled in gcc.

IMHO, using `make bootstrap' on a given machine machine should produce a native
compiler that is tuned (as far as it is already supported in gcc) for that
machine, and that is eventually able to generate code for some other members
of the same cpu family.  That's what gcc does for the m68k and i*86 machines
that I use.

For that to happen in mpc8540-linux, the first step is to recognise precisely
the machine we're running on; that's config.guess's job.

The concern I have is that config.gcc currently expects powerpc-*-linux*spe*
to produce a mpc8540 targetted compiler.  I had expected
powerpcmpc8540-*-linux* or some variant of that.

Best regards

Philippe


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