This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[arm] patch for default tuning
- From: Philip Blundell <pb at nexus dot co dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Date: 05 Apr 2002 16:55:19 +0100
- Subject: [arm] patch for default tuning
This patch has been languishing in the Debian gcc tree for a while now.
Most of our users are on StrongARM, so we want the generated code to be
scheduled for best performance there. But a few are still using ARM7,
so we must avoid generating v4 opcodes.
(Originally this was against 3.0, but I don't think much has changed in
newer versions that will upset it.)
p.
2002-04-05 Philip Blundell <philb@gnu.org>
* config/arm/linux-elf.h (TARGET_TUNE_DEFAULT): New.
* config/arm/arm.c (arm_override_options): Use above macro,
if defined.
--- src/gcc/config/arm/arm.c 2001/05/24 21:09:05 1.146
+++ src/gcc/config/arm/arm.c 2001/06/17 19:10:22
@@ -430,6 +430,32 @@ arm_override_options ()
abort ();
insn_flags = sel->flags;
+
+#ifdef TARGET_TUNE_DEFAULT
+ /* If the user didn't specify tuning either, use the target's
+ preferred flags. */
+ if (tune_flags == 0)
+ {
+ struct processors * tunesel;
+ struct cpu_default * tunedef;
+
+ for (tunedef = cpu_defaults; tunedef->name; tunedef++)
+ if (tunedef->cpu == TARGET_TUNE_DEFAULT)
+ break;
+
+ if (tunedef->name == NULL)
+ abort ();
+
+ for (tunesel = all_cores; tunesel->name != NULL; tunesel++)
+ if (streq (tunedef->name, tunesel->name))
+ break;
+
+ if (tunesel->name == NULL)
+ abort ();
+
+ tune_flags = tunesel->flags;
+ }
+#endif
/* Now check to see if the user has specified some command line
switch that require certain abilities from the cpu. */
--- src/gcc/config/arm/linux-elf.h 13 Dec 2001 00:27:30 -0000 1.30
+++ src/gcc/config/arm/linux-elf.h 5 Apr 2002 15:49:43 -0000
@@ -117,3 +117,6 @@
#undef CC1_SPEC
#define CC1_SPEC "%{profile:-p}"
+
+/* Tune for StrongARM by default. This turns on load scheduling. */
+#define TARGET_TUNE_DEFAULT TARGET_CPU_strongarm