Patchwork [commited,rtems] Sync gcc/config/rs6000/*rtems* with RTEMS-gcc

login
register
mail settings
Submitter Ralf Corsepius
Date Nov. 5, 2011, 6:30 a.m.
Message ID <4EB4D7FB.4000409@rtems.org>
Download mbox | patch
Permalink /patch/123824/
State New
Headers show

Comments

Ralf Corsepius - Nov. 5, 2011, 6:30 a.m.
Hi,

I have applied the 2 patches below to gcc-svn/trunk.

They contain what RTEMS has been using for its powerpc target for some time.

Ralf
2011-11-05  Ralf Cors├ępius  <ralf.corsepius@rtems.org>

	* config/rs6000/t-rtems: Add -mcpu=8540/-mfloat-gprs=double multilib.
	Remove -mcpu=601 multilib.
	Remove -Dmpc8260 multilib.
	* config/rs6000/rtems.h: Allow --float-gprs=... to override grps
	on E500 targets.
2011-11-05  Peter Dufault  <dufault@hda.com>,
	    Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* config/rs6000/rtems.h (SUBSUBTARGET_OVERRIDE_OPTIONS):
	Extend rs6000_spe handling.

Index: config/rs6000/rtems.h
===================================================================
--- config/rs6000/rtems.h	(revision 181005)
+++ config/rs6000/rtems.h	(working copy)
@@ -63,5 +63,9 @@
       {									\
         if (TARGET_HARD_FLOAT && !rs6000_explicit_options.float_gprs)	\
           rs6000_float_gprs = 1; 					\
+        if (rs6000_float_gprs != 0 && !rs6000_explicit_options.spe)	\
+          rs6000_spe = 1;						\
+        if (rs6000_spe && !rs6000_explicit_options.spe_abi)		\
+          rs6000_spe_abi = 1;						\
       }									\
   } while(0)
Joseph S. Myers - Nov. 5, 2011, 6:14 p.m.
I'd like to remind you that specs such as %{!Dppc*: %{!Dmpc*: -Dppc8540}} 
(which you were adding to match existing specs) have been broken for some 
time, since the canonical form of -D options now has separate arguments 
(and they would never have worked with separate-argument -D options).

* Defining new macros like that in the user namespace is in any case 
frowned upon, and certainly they should not be defined if -ansi, -std=i* 
or -std=c* (PR 545) (I haven't actually checked the circumstances in which 
this spec is used).

* Similarly, in conformance modes the compiler shouldn't care about 
whether the user has defined such user-namespace macros on the command 
line.

* If, nevertheless, you want such specs to work (possibly for macros in 
the implementation namespace), see PR 48524; there are some use cases for 
which specs matching option arguments like this would be useful.

Patch

Index: config/rs6000/rtems.h
===================================================================
--- config/rs6000/rtems.h	(revision 181004)
+++ config/rs6000/rtems.h	(working copy)
@@ -49,8 +49,19 @@ 
 %{mcpu=604:  %{!Dppc*: %{!Dmpc*: -Dmpc604}  } } \
 %{mcpu=750:  %{!Dppc*: %{!Dmpc*: -Dmpc750}  } } \
 %{mcpu=821:  %{!Dppc*: %{!Dmpc*: -Dmpc821}  } } \
-%{mcpu=860:  %{!Dppc*: %{!Dmpc*: -Dmpc860}  } }" 
+%{mcpu=860:  %{!Dppc*: %{!Dmpc*: -Dmpc860}  } } \
+%{mcpu=8540: %{!Dppc*: %{!Dmpc*: -Dppc8540}  } }" 
 
 #undef  SUBSUBTARGET_EXTRA_SPECS
 #define SUBSUBTARGET_EXTRA_SPECS \
   { "cpp_os_rtems",		CPP_OS_RTEMS_SPEC }
+
+#undef SUBSUBTARGET_OVERRIDE_OPTIONS
+#define SUBSUBTARGET_OVERRIDE_OPTIONS					\
+  do {									\
+    if (TARGET_E500)							\
+      {									\
+        if (TARGET_HARD_FLOAT && !rs6000_explicit_options.float_gprs)	\
+          rs6000_float_gprs = 1; 					\
+      }									\
+  } while(0)
Index: config/rs6000/t-rtems
===================================================================
--- config/rs6000/t-rtems	(revision 181004)
+++ config/rs6000/t-rtems	(working copy)
@@ -19,14 +19,12 @@ 
 # <http://www.gnu.org/licenses/>.
 
 MULTILIB_OPTIONS	= \
-mcpu=403/mcpu=505/mcpu=601/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400 \
-Dmpc8260 \
-msoft-float
+mcpu=403/mcpu=505/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400/mcpu=8540 \
+msoft-float/mfloat-gprs=double
 
 MULTILIB_DIRNAMES	= \
-m403 m505 m601 m603e m604 m860 m7400 \
-mpc8260 \
-nof
+m403 m505 m603e m604 m860 m7400 m8540 \
+nof gprsdouble
 
 # MULTILIB_MATCHES	= ${MULTILIB_MATCHES_FLOAT}
 MULTILIB_MATCHES	=
@@ -47,6 +45,13 @@ 
 # Map 750 to .
 MULTILIB_MATCHES	+= mcpu?750=
 
+# Map 8548 to 8540
+MULTILIB_MATCHES	+= mcpu?8540=mcpu?8548
+
+# Map -mcpu=8540 -mfloat-gprs=single to -mcpu=8540
+# (mfloat-gprs=single is implicit default)
+MULTILIB_MATCHES	+= mcpu?8540=mcpu?8540/mfloat-gprs?single
+
 # Soft-float only, default implies msoft-float
 # NOTE: Must match with MULTILIB_MATCHES_FLOAT and MULTILIB_MATCHES
 MULTILIB_SOFTFLOAT_ONLY = \
@@ -62,6 +67,16 @@ 
 MULTILIB_HARDFLOAT_ONLY = \
 *mcpu=505/*msoft-float*
 
+# Targets which do not support gprs
+MULTILIB_NOGPRS = \
+mfloat-gprs=* \
+*mcpu=403/*mfloat-gprs=* \
+*mcpu=505/*mfloat-gprs=* \
+*mcpu=603e/*mfloat-gprs=* \
+*mcpu=604/*mfloat-gprs=* \
+*mcpu=860/*mfloat-gprs=* \
+*mcpu=7400/*mfloat-gprs=*
+
 MULTILIB_EXCEPTIONS =
 
 # Disallow -Dppc and -Dmpc without other options
@@ -69,14 +84,5 @@ 
 
 MULTILIB_EXCEPTIONS	+= \
 ${MULTILIB_SOFTFLOAT_ONLY} \
-${MULTILIB_HARDFLOAT_ONLY}
-
-# Special rules
-# Take out all variants we don't want
-MULTILIB_EXCEPTIONS += *mcpu=403/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=505/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=601/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=604/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=750/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=860/Dmpc*
-MULTILIB_EXCEPTIONS += *mcpu=7400/Dmpc*
+${MULTILIB_HARDFLOAT_ONLY} \
+${MULTILIB_NOGPRS}