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: Patch config.gcc to accept --with-cpu=85xx for PowerPC


Geoff Keating wrote:
Michael Eager <eager@mvista.com> writes:


The attached patch makes gcc configure correctly with
--target=powerpc-unknown-linux and --with-cpu=8540.  This is the
same as --target=powerpc-unknown-linux-spe.


It's the same as using --target=powerpc-linux and then using
-mcpu=8540, which does not trigger the SPE ABI, and is therefore not
the same as powerpc-unknown-linux-spe.  The patch is not OK.

In the patch, linuxspe.h is appended to the tm header list when configured with --with-cpu=8540. So it should configure exactly the same as powerpc-unknown-linux-spe.

PowerPC seems to append model specific features to the target
tuple (eg, altivec, spe).  IMO, these features should be handled
dynamically (as they often are) or at worst, by testing --with-cpu in
configure.


These aren't "model specific features", they are ABI specifications.

I guess that's a matter of viewpoint. Not having FP regs seems to me to be a processor characteristic, not an ABI characteristic.

Specifying --target=powerpc-linux and -mcpu=8540 generates code which
is incorrect for the 8540, because it uses FP instructions.

As for ABI differences, other arch's handle this with -mabi, not
different configuration.  (I'm not always happy with the muddle
of MIPS mcpu/mtune/march/mabi, but at least I don't have to configure
gcc differently for each version.)



2004-05-13  Michael Eager  <eager@mvista.com>
	
	*  config.gcc (powerpc-*-linux*):  Accept --with-cpu=85*
	as equivalent to powerpc-*-linux-spe.

--
Michael Eager     eager@mvista.com	408-328-8426	
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA  94085	
Index: gcc/config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.457
diff -u -r1.457 config.gcc
--- gcc/config.gcc	3 May 2004 21:27:42 -0000	1.457
+++ gcc/config.gcc	13 May 2004 20:51:54 -0000
@@ -1569,6 +1580,10 @@
powerpc-*-linux*)
	tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
	tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
+	case x$with_cpu in
+		x85*)   tm_file="${tm_file} rs6000/linuxspe.h"
+			;;
+	esac
	;;
powerpc-*-gnu-gnualtivec*)
	tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h rs6000/gnu.h"




--
Michael Eager     eager@mvista.com	408-328-8426	
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA  94085	


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