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]

[ColdFire 11/63] Treat mc680x0 macros as tuning-dependent macros


The mc680[12346]0 macros are effectively tuning macros.  E.g. -m68020-40
sets mc68020, mc68030 and mc68040, even though it only generates mc68020
instructions.  This patch makes that more explicit by setting the macros
in an m68k_tune switch statement.  The next patch will add ColdFire
macros to it.

Richard


gcc/
	* config/m68k/m68k.h (TARGET_CPU_CPP_BUILTINS): Treat all mc68*
	macros besides mc68000 as tuning macros.  Use a switch statement
	to set them and mcpu32.

Index: gcc/config/m68k/m68k.h
===================================================================
*** gcc/config/m68k/m68k.h	2007-01-09 15:01:53.000000000 +0000
--- gcc/config/m68k/m68k.h	2007-01-09 15:01:54.000000000 +0000
*************** #define TARGET_CPU_CPP_BUILTINS()					\
*** 67,105 ****
      {									\
        builtin_define ("__m68k__");					\
        builtin_define_std ("mc68000");					\
!       if (TARGET_68040)							\
! 	{								\
! 	  if (TUNE_68060)						\
! 	    builtin_define_std ("mc68060");				\
! 	  else								\
! 	    builtin_define_std ("mc68040");				\
! 	}								\
!       else if (TUNE_68060) /* -m68020-60 */				\
  	{								\
  	  builtin_define_std ("mc68060");				\
  	  builtin_define_std ("mc68040");				\
  	  builtin_define_std ("mc68030");				\
  	  builtin_define_std ("mc68020");				\
! 	}								\
!       else if (TUNE_68040) /* -m68020-40 */				\
! 	{								\
! 	  builtin_define_std ("mc68040");				\
! 	  builtin_define_std ("mc68030");				\
  	  builtin_define_std ("mc68020");				\
  	}								\
!       else if (TUNE_68030)						\
! 	builtin_define_std ("mc68030");					\
!       else if (TARGET_68020)						\
! 	builtin_define_std ("mc68020");					\
!       else if (TUNE_68010)						\
! 	builtin_define_std ("mc68010");					\
        if (TARGET_68881)							\
  	builtin_define ("__HAVE_68881__");				\
!       if (TUNE_CPU32)							\
! 	{								\
! 	  builtin_define_std ("mc68332");				\
! 	  builtin_define_std ("mcpu32");				\
! 	}								\
        if (TARGET_COLDFIRE)						\
  	{								\
  	  builtin_define ("__mcoldfire__");				\
--- 67,119 ----
      {									\
        builtin_define ("__m68k__");					\
        builtin_define_std ("mc68000");					\
!       /* The other mc680x0 macros have traditionally been derived	\
! 	 from the tuning setting.  For example, -m68020-60 defines	\
! 	 m68060, even though it generates pure 68020 code.  */		\
!       switch (m68k_tune)						\
  	{								\
+ 	case u68010:							\
+ 	  builtin_define_std ("mc68010");				\
+ 	  break;							\
+ 									\
+ 	case u68020:							\
+ 	  builtin_define_std ("mc68020");				\
+ 	  break;							\
+ 									\
+ 	case u68030:							\
+ 	  builtin_define_std ("mc68030");				\
+ 	  break;							\
+ 									\
+ 	case u68040:							\
+ 	  builtin_define_std ("mc68040");				\
+ 	  break;							\
+ 									\
+ 	case u68060:							\
+ 	  builtin_define_std ("mc68060");				\
+ 	  break;							\
+ 									\
+ 	case u68020_60:							\
  	  builtin_define_std ("mc68060");				\
+ 	  /* Fall through.  */						\
+ 	case u68020_40:							\
  	  builtin_define_std ("mc68040");				\
  	  builtin_define_std ("mc68030");				\
  	  builtin_define_std ("mc68020");				\
! 	  break;							\
! 									\
! 	case ucpu32:							\
! 	  builtin_define_std ("mc68332");				\
! 	  builtin_define_std ("mcpu32");				\
  	  builtin_define_std ("mc68020");				\
+ 	  break;							\
+ 									\
+ 	default:							\
+ 	  break;							\
  	}								\
! 									\
        if (TARGET_68881)							\
  	builtin_define ("__HAVE_68881__");				\
! 									\
        if (TARGET_COLDFIRE)						\
  	{								\
  	  builtin_define ("__mcoldfire__");				\


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