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]

Re: Move some i386 code to filescope


Any objections to moving it?

On May 7, 2007, at 2:13 PM, Mike Stump wrote:
I have a pragma for darwin that wants to be able to access these
values... by moving them to filescope instead of function local, I can
then access them.  I want to get at things like:

processor_target_table[ix86_tune].cost

Ok?

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 124358)
+++ config/i386/i386.c	(working copy)
@@ -1606,6 +1606,35 @@
     }
 }

+static struct ptt
+{
+  const struct processor_costs *cost;	/* Processor costs */
+  const int target_enable;			/* Target flags to enable.  */
+  const int target_disable;			/* Target flags to disable.  */
+  const int align_loop;			/* Default alignments.  */
+  const int align_loop_max_skip;
+  const int align_jump;
+  const int align_jump_max_skip;
+  const int align_func;
+}
+const processor_target_table[PROCESSOR_max] =
+  {
+    {&i386_cost, 0, 0, 4, 3, 4, 3, 4},
+    {&i486_cost, 0, 0, 16, 15, 16, 15, 16},
+    {&pentium_cost, 0, 0, 16, 7, 16, 7, 16},
+    {&pentiumpro_cost, 0, 0, 16, 15, 16, 7, 16},
+    {&geode_cost, 0, 0, 0, 0, 0, 0, 0},
+    {&k6_cost, 0, 0, 32, 7, 32, 7, 32},
+    {&athlon_cost, 0, 0, 16, 7, 16, 7, 16},
+    {&pentium4_cost, 0, 0, 0, 0, 0, 0, 0},
+    {&k8_cost, 0, 0, 16, 7, 16, 7, 16},
+    {&nocona_cost, 0, 0, 0, 0, 0, 0, 0},
+    {&core2_cost, 0, 0, 16, 7, 16, 7, 16},
+    {&generic32_cost, 0, 0, 16, 7, 16, 7, 16},
+    {&generic64_cost, 0, 0, 16, 7, 16, 7, 16},
+    {&amdfam10_cost, 0, 0, 32, 24, 32, 7, 32}
+  };
+
 /* Sometimes certain combinations of command options do not make
    sense on a particular target machine.  You can define a macro
    `OVERRIDE_OPTIONS' to take account of this.  This macro, if
@@ -1625,35 +1654,6 @@
   /* Comes from final.c -- no real reason to change it.  */
 #define MAX_CODE_ALIGN 16

-  static struct ptt
-    {
-      const struct processor_costs *cost;	/* Processor costs */
-      const int target_enable;			/* Target flags to enable.  */
-      const int target_disable;			/* Target flags to disable.  */
-      const int align_loop;			/* Default alignments.  */
-      const int align_loop_max_skip;
-      const int align_jump;
-      const int align_jump_max_skip;
-      const int align_func;
-    }
-  const processor_target_table[PROCESSOR_max] =
-    {
-      {&i386_cost, 0, 0, 4, 3, 4, 3, 4},
-      {&i486_cost, 0, 0, 16, 15, 16, 15, 16},
-      {&pentium_cost, 0, 0, 16, 7, 16, 7, 16},
-      {&pentiumpro_cost, 0, 0, 16, 15, 16, 7, 16},
-      {&geode_cost, 0, 0, 0, 0, 0, 0, 0},
-      {&k6_cost, 0, 0, 32, 7, 32, 7, 32},
-      {&athlon_cost, 0, 0, 16, 7, 16, 7, 16},
-      {&pentium4_cost, 0, 0, 0, 0, 0, 0, 0},
-      {&k8_cost, 0, 0, 16, 7, 16, 7, 16},
-      {&nocona_cost, 0, 0, 0, 0, 0, 0, 0},
-      {&core2_cost, 0, 0, 16, 7, 16, 7, 16},
-      {&generic32_cost, 0, 0, 16, 7, 16, 7, 16},
-      {&generic64_cost, 0, 0, 16, 7, 16, 7, 16},
-      {&amdfam10_cost, 0, 0, 32, 24, 32, 7, 32}
-    };
-
   static const char * const cpu_names[] = TARGET_CPU_DEFAULT_NAMES;
   static struct pta
     {


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