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: Add -march support for MIPS 1004K cores


Like the subject line says, this patch adds -march=1004k* options to GCC. The 1004K is approximately a 34K adapted for SMP, so I have basically just cloned the (non-deprecated) 34K options.

1004kc = integer only
1004kf2_1 = half-speed FPU
1004kf1_1 = full-speed FPU
1004kf = alias for 1004kf2_1

There's a corresponding binutils patch posted here:
http://sourceware.org/ml/binutils/2009-07/msg00398.html

I have had some difficulty testing this on mainline HEAD as the mips-sde-elf config is currently (without this patch) giving an ICE when building newlib. However, I did test this in a local 4.4-based branch, the patch applies and builds cleanly on HEAD, and it's all pretty close to being "obvious" anyway.
OK to commit?


-Sandra

2009-08-03  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/
	* doc/invoke.texi (MIPS Options): Document new 1004K -march options.
	* config/mips/mips.c (mips_cpu_info_table): Add 1004K cores.
	* config/mips/mips.h (MIPS_ISA_LEVEL_SPEC): Add pattern for 1004K.
	(MIPS_ARCH_FLOAT_SPEC): Likewise.
	(BASE_DRIVER_SELF_SPECS): Likewise.

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 150375)
+++ gcc/doc/invoke.texi	(working copy)
@@ -13050,6 +13050,7 @@ The processor names are:
 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
+@samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
 @samp{loongson2e}, @samp{loongson2f},
 @samp{m4k},
 @samp{octeon},
Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c	(revision 150375)
+++ gcc/config/mips/mips.c	(working copy)
@@ -686,6 +686,11 @@ static const struct mips_cpu_info mips_c
   { "74kx", PROCESSOR_74KF1_1, 33, 0 },
   { "74kf3_2", PROCESSOR_74KF3_2, 33, 0 },
 
+  { "1004kc", PROCESSOR_24KC, 33, 0 }, /* 1004K with MT/DSP.  */
+  { "1004kf2_1", PROCESSOR_24KF2_1, 33, 0 },
+  { "1004kf", PROCESSOR_24KF2_1, 33, 0 },
+  { "1004kf1_1", PROCESSOR_24KF1_1, 33, 0 },
+
   /* MIPS64 processors.  */
   { "5kc", PROCESSOR_5KC, 64, 0 },
   { "5kf", PROCESSOR_5KF, 64, 0 },
Index: gcc/config/mips/mips.h
===================================================================
--- gcc/config/mips/mips.h	(revision 150375)
+++ gcc/config/mips/mips.h	(working copy)
@@ -734,7 +734,7 @@ enum mips_code_readable_setting {
        |march=r10000|march=r12000|march=r14000|march=r16000:-mips4} \
      %{march=mips32|march=4kc|march=4km|march=4kp|march=4ksc:-mips32} \
      %{march=mips32r2|march=m4k|march=4ke*|march=4ksd|march=24k* \
-       |march=34k*|march=74k*: -mips32r2} \
+       |march=34k*|march=74k*|march=1004k*: -mips32r2} \
      %{march=mips64|march=5k*|march=20k*|march=sb1*|march=sr71000 \
        |march=xlr: -mips64} \
      %{march=mips64r2|march=octeon: -mips64r2} \
@@ -747,7 +747,7 @@ enum mips_code_readable_setting {
 #define MIPS_ARCH_FLOAT_SPEC \
   "%{mhard-float|msoft-float|march=mips*:; \
      march=vr41*|march=m4k|march=4k*|march=24kc|march=24kec \
-     |march=34kc|march=74kc|march=5kc|march=octeon|march=xlr: -msoft-float; \
+     |march=34kc|march=74kc|march=1004kc|march=5kc|march=octeon|march=xlr: -msoft-float; \
      march=*: -mhard-float}"
 
 /* A spec condition that matches 32-bit options.  It only works if
@@ -793,7 +793,7 @@ enum mips_code_readable_setting {
 
 /* A spec that infers the -mdsp setting from an -march argument.  */
 #define BASE_DRIVER_SELF_SPECS \
-  "%{!mno-dsp:%{march=24ke*|march=34k*|march=74k*: -mdsp}}"
+  "%{!mno-dsp:%{march=24ke*|march=34k*|march=74k*|march=1004k*: -mdsp}}"
 
 #define DRIVER_SELF_SPECS BASE_DRIVER_SELF_SPECS
 

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