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]

[patch] m68k: Add support for fido.


Hi,

Attached is a patch to support fido.

>From gcc's point of view, fido is basically CPU32.  Although it does
have a few new instructions, they are not something that gcc
can/should take advantage of.  However, it is important to pass
-mcpu=fidoa to the assembler so that the assembler can assemble
fido-specific instruction and MOVEC registers correctly.

Tested by building and running "Hello, world".  OK to apply?

Kazu Hirata

2007-03-15  Kazu Hirata  <kazu@codesourcery.com>

	* config.gcc: Recognize fido.
	* config/m68k/m68k-devices.def (fidoa): New.
	* config/m68k/m68k.h (TARGET_CPU_CPP_BUILTINS): Define
	__mfido__.
	(FL_FIDOA, TARGET_FIDOA): New.
	* config/m68k/m68k.opt (mfidoa): New.

Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 164340)
+++ gcc/config.gcc	(revision 164412)
@@ -262,6 +262,10 @@ ep9312*-*-*)
 	;;
 frv*)	cpu_type=frv
 	;;
+fido-*-*)
+	cpu_type=m68k
+	extra_headers=math-68881.h
+        ;;
 xscale-*-*)
 	cpu_type=arm
 	extra_headers="mmintrin.h"
@@ -1522,6 +1526,22 @@ m68020-*-elf* | m68k-*-elf*)
 	tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf m68k/t-mlibs"
 	extra_parts="crtbegin.o crtend.o"
 	;;
+fido-*-elf*)
+	default_m68k_cpu=fidoa
+	case $with_cpu in
+	"" | "fidoa")
+		;;
+	*)
+		echo "Cannot accept --with-cpu=$with_cpu"
+		exit 1
+		;;
+	esac
+	with_cpu=fidoa
+	tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h"
+	tm_defines="${tm_defines} MOTOROLA=1 USE_GAS"
+	tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf"
+	extra_parts="crtbegin.o crtend.o"
+	;;
 m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
 	default_m68k_cpu=68020
 	default_cf_cpu=5475
@@ -2853,7 +2873,7 @@ case "${target}" in
 		esac
 		;;
 
-	m680[012]0-*-* | m68k*-*-*)
+	fido-*-* | m680[012]0-*-* | m68k*-*-*)
 		supported_defaults="arch cpu"
 		case "$with_arch" in
 		"" | "m68k"| "cf")
@@ -3147,7 +3167,7 @@ case ${target} in
 		fi
 		;;
 
-	m680[012]0-*-* | m68k*-*-*)
+	fido*-*-* | m680[012]0-*-* | m68k*-*-*)
 		target_cpu_default2=$m68k_cpu_ident
 		if [ x"$m68k_arch_family" != x ]; then
 		        tmake_file="m68k/t-$m68k_arch_family $tmake_file"
Index: gcc/config/m68k/m68k.opt
===================================================================
--- gcc/config/m68k/m68k.opt	(revision 164340)
+++ gcc/config/m68k/m68k.opt	(revision 164412)
@@ -124,6 +124,10 @@ mdiv
 Target Report Mask(CF_HWDIV)
 Use hardware division instructions on ColdFire
 
+mfidoa
+Target RejectNegative
+Generate code for a Fido A
+
 mhard-float
 Target RejectNegative Mask(HARD_FLOAT) MaskExists
 Generate code which uses hardware floating point instructions
Index: gcc/config/m68k/m68k-devices.def
===================================================================
--- gcc/config/m68k/m68k-devices.def	(revision 164340)
+++ gcc/config/m68k/m68k-devices.def	(revision 164412)
@@ -142,3 +142,6 @@ M68K_DEVICE ("5483",  mcf5483,  "5485", 
 M68K_DEVICE ("5484",  mcf5484,  "5485",  "5475",  cfv4e,    isa_b,     FL_CF_USP | FL_CF_EMAC | FL_CF_FPU | FL_MMU)
 M68K_DEVICE ("5485",  mcf5485,  "5485",  "5475",  cfv4e,    isa_b,     FL_CF_USP | FL_CF_EMAC | FL_CF_FPU | FL_MMU)
 M68K_DEVICE ("548x",  mcf548x,  "5485",  "5475",  cfv4e,    isa_b,     FL_CF_USP | FL_CF_EMAC | FL_CF_FPU | FL_MMU)
+
+/* Fido processor.  */
+M68K_DEVICE ("fidoa", fidoa,    "cpu32", "fidoa", cpu32,    isa_cpu32, FL_FIDOA | FL_MMU)
Index: gcc/config/m68k/m68k.h
===================================================================
--- gcc/config/m68k/m68k.h	(revision 164340)
+++ gcc/config/m68k/m68k.h	(revision 164412)
@@ -187,6 +187,9 @@ Boston, MA 02110-1301, USA.  */
       if (TARGET_CF_HWDIV)						\
 	builtin_define ("__mcfhwdiv__");				\
 									\
+      if (TARGET_FIDOA)							\
+	builtin_define ("__mfido__");					\
+									\
       builtin_assert ("cpu=m68k");					\
       builtin_assert ("machine=m68k");					\
     }									\
@@ -220,6 +223,7 @@ Boston, MA 02110-1301, USA.  */
 #define FL_ISA_APLUS (1 << 14)
 #define FL_ISA_B     (1 << 15)
 #define FL_ISA_C     (1 << 16)
+#define FL_FIDOA     (1 << 17)
 #define FL_MMU 	     0   /* Used by multilib machinery.  */
 
 #define TARGET_68010		((m68k_cpu_flags & FL_ISA_68010) != 0)
@@ -228,6 +232,7 @@ Boston, MA 02110-1301, USA.  */
 #define TARGET_COLDFIRE		((m68k_cpu_flags & FL_COLDFIRE) != 0)
 #define TARGET_COLDFIRE_FPU	(m68k_fpu == FPUTYPE_COLDFIRE)
 #define TARGET_68881		(m68k_fpu == FPUTYPE_68881)
+#define TARGET_FIDOA		((m68k_cpu_flags & FL_FIDOA) != 0)
 
 /* Size (in bytes) of FPU registers.  */
 #define TARGET_FP_REG_SIZE	(TARGET_COLDFIRE ? 8 : 12)


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