public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work104)] Revert patch
@ 2023-01-05 22:32 Michael Meissner
  0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2023-01-05 22:32 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5d12fc09b9b813e6f1888c9dec5ed1d166ede22f

commit 5d12fc09b9b813e6f1888c9dec5ed1d166ede22f
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Thu Jan 5 17:32:39 2023 -0500

    Revert patch

Diff:
---
 gcc/config/rs6000/rs6000-modes.def |  4 ---
 gcc/genmodes.cc                    | 57 ++++----------------------------------
 gcc/machmode.def                   |  7 ++---
 gcc/machmode.h                     |  2 +-
 4 files changed, 9 insertions(+), 61 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-modes.def b/gcc/config/rs6000/rs6000-modes.def
index 84854ca3b93..8ef910869c5 100644
--- a/gcc/config/rs6000/rs6000-modes.def
+++ b/gcc/config/rs6000/rs6000-modes.def
@@ -43,13 +43,9 @@
 
 /* IBM 128-bit floating point.  */
 FRACTIONAL_FLOAT_MODE (IF, FLOAT_PRECISION_IFmode, 16, ibm_extended_format);
-ADJUST_PRECISION(IF, FLOAT128_IBM_P (TFmode) \
-		 ? FLOAT_PRECISION_TFmode : FLOAT_PRECISION_IFmode);
 
 /* Explicit IEEE 128-bit floating point.  */
 FRACTIONAL_FLOAT_MODE (KF, FLOAT_PRECISION_KFmode, 16, ieee_quad_format);
-ADJUST_PRECISION(KF, FLOAT128_IEEE_P (TFmode) \
-		 ? FLOAT_PRECISION_TFmode : FLOAT_PRECISION_KFmode);
 
 /* 128-bit floating point, either IBM 128-bit or IEEE 128-bit.  This is
    adjusted in rs6000_option_override_internal to be the appropriate floating
diff --git a/gcc/genmodes.cc b/gcc/genmodes.cc
index 67914ae5630..2d418f09aab 100644
--- a/gcc/genmodes.cc
+++ b/gcc/genmodes.cc
@@ -77,8 +77,6 @@ struct mode_data
 				   adjustment */
   bool need_bytesize_adj;	/* true if this mode needs dynamic size
 				   adjustment */
-  bool need_precision_adj;	/* true if this mode needs dynamic precision
-				   adjustment */
   unsigned int int_n;		/* If nonzero, then __int<INT_N> will be defined */
   bool boolean;
 };
@@ -91,7 +89,7 @@ static const struct mode_data blank_mode = {
   0, "<unknown>", MAX_MODE_CLASS,
   0, -1U, -1U, -1U, -1U,
   0, 0, 0, 0, 0, 0,
-  "<unknown>", 0, 0, 0, 0, false, false, false, 0,
+  "<unknown>", 0, 0, 0, 0, false, false, 0,
   false
 };
 
@@ -116,7 +114,6 @@ static struct mode_adjust *adj_alignment;
 static struct mode_adjust *adj_format;
 static struct mode_adjust *adj_ibit;
 static struct mode_adjust *adj_fbit;
-static struct mode_adjust *adj_precision;
 
 /* Mode class operations.  */
 static enum mode_class
@@ -825,7 +822,6 @@ make_vector_mode (enum mode_class bclass,
 #define ADJUST_FLOAT_FORMAT(M, X)    _ADD_ADJUST (format, M, X, FLOAT, FLOAT)
 #define ADJUST_IBIT(M, X)  _ADD_ADJUST (ibit, M, X, ACCUM, UACCUM)
 #define ADJUST_FBIT(M, X)  _ADD_ADJUST (fbit, M, X, FRACT, UACCUM)
-#define ADJUST_PRECISION(M, X)  _ADD_ADJUST (precision, M, X, FLOAT, FLOAT)
 
 static int bits_per_unit;
 static int max_bitsize_mode_any_int;
@@ -1216,8 +1212,7 @@ extern __inline__ __attribute__((__always_inline__, __gnu_inline__))\n\
 unsigned short\n\
 mode_unit_precision_inline (machine_mode mode)\n\
 {\n\
-  extern CONST_MODE_PRECISION unsigned short \n\
-    mode_unit_precision[NUM_MACHINE_MODES];\n\
+  extern const unsigned short mode_unit_precision[NUM_MACHINE_MODES];\n\
   gcc_assert (mode >= 0 && mode < NUM_MACHINE_MODES);\n\
   switch (mode)\n\
     {");
@@ -1365,8 +1360,7 @@ enum machine_mode\n{");
 
   /* I can't think of a better idea, can you?  */
   printf ("#define CONST_MODE_NUNITS%s\n", adj_nunits ? "" : " const");
-  printf ("#define CONST_MODE_PRECISION%s\n",
-	  adj_precision || adj_nunits ? "" : " const");
+  printf ("#define CONST_MODE_PRECISION%s\n", adj_nunits ? "" : " const");
   printf ("#define CONST_MODE_SIZE%s\n",
 	  adj_bytesize || adj_nunits ? "" : " const");
   printf ("#define CONST_MODE_UNIT_SIZE%s\n", adj_bytesize ? "" : " const");
@@ -1485,7 +1479,7 @@ emit_mode_precision (void)
   struct mode_data *m;
 
   print_maybe_const_decl ("%spoly_uint16_pod", "mode_precision",
-			  "NUM_MACHINE_MODES", adj_precision || adj_nunits);
+			  "NUM_MACHINE_MODES", adj_nunits);
 
   for_all_modes (c, m)
     if (m->precision != (unsigned int)-1)
@@ -1705,8 +1699,7 @@ emit_mode_unit_precision (void)
   int c;
   struct mode_data *m;
 
-  print_maybe_const_decl ("%sunsigned short", "mode_unit_precision",
-			  "NUM_MACHINE_MODES", adj_precision);
+  print_decl ("unsigned short", "mode_unit_precision", "NUM_MACHINE_MODES");
 
   for_all_modes (c, m)
     {
@@ -1970,46 +1963,6 @@ emit_mode_adjustments (void)
     printf ("\n  /* %s:%d */\n  REAL_MODE_FORMAT (E_%smode) = %s;\n",
 	    a->file, a->line, a->mode->name, a->adjustment);
 
-
-  /* Precision adjustments propagate too.  */
-  for (a = adj_precision; a; a = a->next)
-    {
-      printf ("\n  /* %s:%d */\n  s = %s;\n",
-	      a->file, a->line, a->adjustment);
-      printf ("  mode_unit_precision[E_%smode] = s;\n", a->mode->name);
-
-      for (m = a->mode->contained; m; m = m->next_cont)
-	{
-	  switch (m->cl)
-	    {
-	    case MODE_COMPLEX_INT:
-	    case MODE_COMPLEX_FLOAT:
-	      printf ("  mode_unit_precision[E_%smode] = s;\n", m->name);
-	      break;
-
-	    case MODE_VECTOR_BOOL:
-	      /* Changes to BImode should not affect vector booleans.  */
-	      break;
-
-	    case MODE_VECTOR_INT:
-	    case MODE_VECTOR_FLOAT:
-	    case MODE_VECTOR_FRACT:
-	    case MODE_VECTOR_UFRACT:
-	    case MODE_VECTOR_ACCUM:
-	    case MODE_VECTOR_UACCUM:
-	      printf ("  mode_unit_precision[E_%smode] = %d*s;\n",
-		      m->name, m->ncomponents);
-	      break;
-
-	    default:
-	      internal_error (
-	      "mode %s is neither vector nor complex but contains %s",
-	      m->name, a->mode->name);
-	      /* NOTREACHED */
-	    }
-	}
-    }
-
   puts ("}");
 }
 
diff --git a/gcc/machmode.def b/gcc/machmode.def
index 343dabc1b2e..62e2ba10d45 100644
--- a/gcc/machmode.def
+++ b/gcc/machmode.def
@@ -171,10 +171,9 @@ along with GCC; see the file COPYING3.  If not see
      ADJUST_FLOAT_FORMAT (MODE, EXPR);
      ADJUST_IBIT (MODE, EXPR);
      ADJUST_FBIT (MODE, EXPR);
-     ADJUST_PRECISION (MODE, EXPR);
-	Arrange for the byte size, alignment, floating point format, ibit, fbit
-	or precision mode of MODE to be adjustable at run time.  EXPR will be
-	executed once after processing all command line options, and should
+	Arrange for the byte size, alignment, floating point format, ibit,
+	or fbit of MODE to be adjustable at run time.  EXPR will be executed
+	once after processing all command line options, and should
 	evaluate to the desired byte size, alignment, format, ibit or fbit.
 
 	Unlike a FORMAT argument, if you are adjusting a float format
diff --git a/gcc/machmode.h b/gcc/machmode.h
index e4e0caf9abb..f1865c1ef42 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -27,7 +27,7 @@ extern CONST_MODE_PRECISION poly_uint16_pod mode_precision[NUM_MACHINE_MODES];
 extern const unsigned char mode_inner[NUM_MACHINE_MODES];
 extern CONST_MODE_NUNITS poly_uint16_pod mode_nunits[NUM_MACHINE_MODES];
 extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];
-extern CONST_MODE_PRECISION unsigned short mode_unit_precision[NUM_MACHINE_MODES];
+extern const unsigned short mode_unit_precision[NUM_MACHINE_MODES];
 extern const unsigned char mode_next[NUM_MACHINE_MODES];
 extern const unsigned char mode_wider[NUM_MACHINE_MODES];
 extern const unsigned char mode_2xwider[NUM_MACHINE_MODES];

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-05 22:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 22:32 [gcc(refs/users/meissner/heads/work104)] Revert patch Michael Meissner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).