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] remove dead optabs code from Ada f-e


largest_move_alignment, gnat_compute_largest_alignment and
enumerate_modes are no longer used by anything.  This patch
deletes them.  Bootstraps successfully on i686-pc-linux-gnu.

Duncan.
Index: gcc.fsf.master/gcc/ada/gigi.h
===================================================================
--- gcc.fsf.master.orig/gcc/ada/gigi.h	2006-11-29 16:34:41.000000000 +0100
+++ gcc.fsf.master/gcc/ada/gigi.h	2007-02-12 20:45:25.000000000 +0100
@@ -32,14 +32,6 @@
 
 /* Declare all functions and types used by gigi.  */
 
-/* The largest alignment, in bits, that is needed for using the widest
-   move instruction.  */
-extern unsigned int largest_move_alignment;
-
-/* Compute the alignment of the largest mode that can be used for copying
-   objects.  */
-extern void gnat_compute_largest_alignment (void);
-
 /* GNU_TYPE is a type. Determine if it should be passed by reference by
    default.  */
 extern bool default_pass_by_ref (tree gnu_type);
@@ -789,20 +781,6 @@
    Return the first node found, if any, or NULL_TREE otherwise.  */
 extern tree builtin_decl_for (tree name ATTRIBUTE_UNUSED);
 
-/* This function is called by the front end to enumerate all the supported
-   modes for the machine.  We pass a function which is called back with
-   the following integer parameters:
-
-   FLOAT_P	nonzero if this represents a floating-point mode
-   COMPLEX_P	nonzero is this represents a complex mode
-   COUNT	count of number of items, nonzero for vector mode
-   PRECISION	number of bits in data representation
-   MANTISSA	number of bits in mantissa, if FP and known, else zero.
-   SIZE		number of bits used to store data
-   ALIGN	number of bits to which mode is aligned.  */
-extern void enumerate_modes (void (*f) (int, int, int, int, int, int,
-					unsigned int));
-
 /* These are temporary function to deal with recent GCC changes related to
    FP type sizes and precisions.  */
 extern int fp_prec_to_size (int prec);
Index: gcc.fsf.master/gcc/ada/misc.c
===================================================================
--- gcc.fsf.master.orig/gcc/ada/misc.c	2007-02-09 15:39:28.000000000 +0100
+++ gcc.fsf.master/gcc/ada/misc.c	2007-02-12 20:45:25.000000000 +0100
@@ -52,7 +52,6 @@
 #include "insn-codes.h"
 #include "insn-flags.h"
 #include "insn-config.h"
-#include "optabs.h"
 #include "recog.h"
 #include "toplev.h"
 #include "output.h"
@@ -81,10 +80,6 @@
 
 extern FILE *asm_out_file;
 
-/* The largest alignment, in bits, that is needed for using the widest
-   move instruction.  */
-unsigned int largest_move_alignment;
-
 static bool gnat_init			(void);
 static void gnat_finish_incomplete_decl	(tree);
 static unsigned int gnat_init_options	(unsigned int, const char **);
@@ -452,22 +447,6 @@
 {
   abort ();
 }
-
-/* Compute the alignment of the largest mode that can be used for copying
-   objects.  */
-
-void
-gnat_compute_largest_alignment (void)
-{
-  enum machine_mode mode;
-
-  for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
-       mode = GET_MODE_WIDER_MODE (mode))
-    if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
-      largest_move_alignment = MIN (BIGGEST_ALIGNMENT,
-				    MAX (largest_move_alignment,
-					 GET_MODE_ALIGNMENT (mode)));
-}
 
 /* If we are using the GCC mechanism to process exception handling, we
    have to register the personality routine for Ada and to initialize
@@ -834,84 +813,6 @@
 	      && TREE_CODE (TYPE_SIZE (gnu_type)) != INTEGER_CST));
 }
 
-/* This function is called by the front end to enumerate all the supported
-   modes for the machine.  We pass a function which is called back with
-   the following integer parameters:
-
-   FLOAT_P	nonzero if this represents a floating-point mode
-   COMPLEX_P	nonzero is this represents a complex mode
-   COUNT	count of number of items, nonzero for vector mode
-   PRECISION	number of bits in data representation
-   MANTISSA	number of bits in mantissa, if FP and known, else zero.
-   SIZE		number of bits used to store data
-   ALIGN	number of bits to which mode is aligned.  */
-
-void
-enumerate_modes (void (*f) (int, int, int, int, int, int, unsigned int))
-{
-  enum machine_mode i;
-
-  for (i = 0; i < NUM_MACHINE_MODES; i++)
-    {
-      enum machine_mode j;
-      bool float_p = 0;
-      bool complex_p = 0;
-      bool vector_p = 0;
-      bool skip_p = 0;
-      int mantissa = 0;
-      enum machine_mode inner_mode = i;
-
-      switch (GET_MODE_CLASS (i))
-	{
-	case MODE_INT:
-	  break;
-	case MODE_FLOAT:
-	  float_p = 1;
-	  break;
-	case MODE_COMPLEX_INT:
-	  complex_p = 1;
-	  inner_mode = GET_MODE_INNER (i);
-	  break;
-	case MODE_COMPLEX_FLOAT:
-	  float_p = 1;
-	  complex_p = 1;
-	  inner_mode = GET_MODE_INNER (i);
-	  break;
-	case MODE_VECTOR_INT:
-	  vector_p = 1;
-	  inner_mode = GET_MODE_INNER (i);
-	  break;
-	case MODE_VECTOR_FLOAT:
-	  float_p = 1;
-	  vector_p = 1;
-	  inner_mode = GET_MODE_INNER (i);
-	  break;
-	default:
-	  skip_p = 1;
-	}
-
-      /* Skip this mode if it's one the front end doesn't need to know about
-	 (e.g., the CC modes) or if there is no add insn for that mode (or
-	 any wider mode), meaning it is not supported by the hardware.  If
-	 this a complex or vector mode, we care about the inner mode.  */
-      for (j = inner_mode; j != VOIDmode; j = GET_MODE_WIDER_MODE (j))
-	if (add_optab->handlers[j].insn_code != CODE_FOR_nothing)
-	  break;
-
-      if (float_p)
-	{
-	  const struct real_format *fmt = REAL_MODE_FORMAT (inner_mode);
-
-	  mantissa = fmt->p * fmt->log2_b;
-	}
-
-      if (!skip_p && j != VOIDmode)
-	(*f) (float_p, complex_p, vector_p ? GET_MODE_NUNITS (i) : 0,
-	      GET_MODE_BITSIZE (i), mantissa,
-	      GET_MODE_SIZE (i) * BITS_PER_UNIT, GET_MODE_ALIGNMENT (i));
-    }
-}
-
 int
 fp_prec_to_size (int prec)
 {
Index: gcc.fsf.master/gcc/ada/trans.c
===================================================================
--- gcc.fsf.master.orig/gcc/ada/trans.c	2007-02-09 15:39:28.000000000 +0100
+++ gcc.fsf.master/gcc/ada/trans.c	2007-02-12 20:45:25.000000000 +0100
@@ -204,7 +204,6 @@
   type_annotate_only = (gigi_operating_mode == 1);
 
   init_gnat_to_gnu ();
-  gnat_compute_largest_alignment ();
   init_dummy_type ();
 
   /* If we are just annotating types, give VOID_TYPE zero sizes to avoid

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