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]

lingering REAL_VALUE_LDEXP


This is a macro that I removed in my real.c rewrite.  Equivalent
functionality does exist via different interfaces.


r~


        * trans.c (tree_transform): Use real_ldexp not REAL_VALUE_LDEXP.
        * config/dsp16xx/dsp16xx.md (fixuns_trunchfhi2): Use real_2expN.
        * config/mips/mips.md (fixuns_truncdfsi2): Likewise.
        (fixuns_truncdfdi2, fixuns_truncsfsi2, fixuns_truncsfdi2): Likewise.
        * config/m68k/m68k.c (floating_exact_log2): Use real_exponent
        and real_2expN instead of a loop.
        * doc/tm.texi (REAL_VALUE_LDEXP): Remove.
        (REAL_VALUE_RNDZINT, REAL_VALUE_UNSIGNED_RNDZINT): Remove.

Index: ada/trans.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/trans.c,v
retrieving revision 1.19
diff -u -p -u -r1.19 trans.c
--- ada/trans.c	4 Jun 2002 07:08:34 -0000	1.19
+++ ada/trans.c	17 Sep 2002 09:24:18 -0000
@@ -576,11 +576,13 @@ tree_transform (gnat_node)
 		gigi_abort (336);
 
 	      else
-		gnu_result
-		  = build_real (gnu_result_type,
-				REAL_VALUE_LDEXP
-				(TREE_REAL_CST (gnu_result),
-				 - UI_To_Int (Denominator (ur_realval))));
+		{
+		  REAL_VALUE_TYPE tmp;
+
+		  real_ldexp (&tmp, &TREE_REAL_CST (gnu_result),
+			      - UI_To_Int (Denominator (ur_realval)));
+		  gnu_result = build_real (gnu_result_type, tmp);
+		}
 	    }
 
 	  /* Now see if we need to negate the result.  Do it this way to
Index: config/dsp16xx/dsp16xx.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/dsp16xx/dsp16xx.md,v
retrieving revision 1.19
diff -u -p -u -r1.19 dsp16xx.md
--- config/dsp16xx/dsp16xx.md	11 Aug 2002 19:24:07 -0000	1.19
+++ config/dsp16xx/dsp16xx.md	17 Sep 2002 09:24:19 -0000
@@ -1937,7 +1937,7 @@
   rtx label2 = gen_label_rtx ();
   REAL_VALUE_TYPE offset;
 
-  offset = REAL_VALUE_LDEXP (dconst1, 31);
+  real_2expN (&offset, 31);
 
   if (reg1)			/* turn off complaints about unreached code */
     {
Index: config/m68k/m68k.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k.c,v
retrieving revision 1.65
diff -u -p -u -r1.65 m68k.c
--- config/m68k/m68k.c	20 Aug 2002 23:27:02 -0000	1.65
+++ config/m68k/m68k.c	17 Sep 2002 09:24:19 -0000
@@ -2719,22 +2719,18 @@ floating_exact_log2 (x)
      rtx x;
 {
   REAL_VALUE_TYPE r, r1;
-  int i;
+  int exp;
 
   REAL_VALUE_FROM_CONST_DOUBLE (r, x);
 
-  if (REAL_VALUES_LESS (r, dconst0))
+  if (REAL_VALUES_LESS (r, dconst1))
     return 0;
 
-  r1 = dconst1;
-  i = 0;
-  while (REAL_VALUES_LESS (r1, r))
-    {
-      r1 = REAL_VALUE_LDEXP (dconst1, i);
-      if (REAL_VALUES_EQUAL (r1, r))
-        return i;
-      i = i + 1;
-    }
+  exp = real_exponent (&r);
+  real_2expN (&r1, exp);
+  if (REAL_VALUES_EQUAL (r1, r))
+    return exp;
+
   return 0;
 }
 
Index: config/mips/mips.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.md,v
retrieving revision 1.141
diff -u -p -u -r1.141 mips.md
--- config/mips/mips.md	20 Aug 2002 21:53:28 -0000	1.141
+++ config/mips/mips.md	17 Sep 2002 09:24:21 -0000
@@ -4667,7 +4667,7 @@ move\\t%0,%z4\\n\\
   rtx label2 = gen_label_rtx ();
   REAL_VALUE_TYPE offset;
 
-  offset = REAL_VALUE_LDEXP (dconst1, 31);
+  real_2expN (&offset, 31);
 
   if (reg1)			/* turn off complaints about unreached code */
     {
@@ -4713,7 +4713,7 @@ move\\t%0,%z4\\n\\
   rtx label2 = gen_label_rtx ();
   REAL_VALUE_TYPE offset;
 
-  offset = REAL_VALUE_LDEXP (dconst1, 63);
+  real_2expN (&offset, 63);
 
   if (reg1)			/* turn off complaints about unreached code */
     {
@@ -4759,7 +4759,7 @@ move\\t%0,%z4\\n\\
   rtx label2 = gen_label_rtx ();
   REAL_VALUE_TYPE offset;
 
-  offset = REAL_VALUE_LDEXP (dconst1, 31);
+  real_2expN (&offset, 31);
 
   if (reg1)			/* turn off complaints about unreached code */
     {
@@ -4805,7 +4805,7 @@ move\\t%0,%z4\\n\\
   rtx label2 = gen_label_rtx ();
   REAL_VALUE_TYPE offset;
 
-  offset = REAL_VALUE_LDEXP (dconst1, 63);
+  real_2expN (&offset, 63);
 
   if (reg1)			/* turn off complaints about unreached code */
     {
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.169
diff -u -p -u -r1.169 tm.texi
--- doc/tm.texi	16 Sep 2002 16:36:37 -0000	1.169
+++ doc/tm.texi	17 Sep 2002 09:24:26 -0000
@@ -8134,11 +8134,6 @@ floating point format supports negative 
 Tests whether @var{x} is less than @var{y}.
 @end deftypefn
 
-@findex ldexp
-@deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_LDEXP (REAL_VALUE_TYPE @var{x}, int @var{scale})
-Multiplies @var{x} by 2 raised to the power @var{scale}.
-@end deftypefn
-
 @deftypefn Macro HOST_WIDE_INT REAL_VALUE_FIX (REAL_VALUE_TYPE @var{x})
 Truncates @var{x} to a signed integer, rounding toward zero.
 @end deftypefn
@@ -8146,17 +8141,6 @@ Truncates @var{x} to a signed integer, r
 @deftypefn Macro {unsigned HOST_WIDE_INT} REAL_VALUE_UNSIGNED_FIX (REAL_VALUE_TYPE @var{x})
 Truncates @var{x} to an unsigned integer, rounding toward zero.  If
 @var{x} is negative, returns zero.
-@end deftypefn
-
-@deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_RNDZINT (REAL_VALUE_TYPE @var{x})
-Rounds the target-machine floating point value @var{x} towards zero to an
-integer value, but leaves it represented as a floating point number.
-@end deftypefn
-
-@deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_UNSIGNED_RNDZINT (REAL_VALUE_TYPE @var{x})
-Rounds the target-machine floating point value @var{x} towards zero to an
-unsigned integer value, but leaves it represented as a floating point
-number.  If @var{x} is negative, returns (positive) zero.
 @end deftypefn
 
 @deftypefn Macro REAL_VALUE_TYPE REAL_VALUE_ATOF (const char *@var{string}, enum machine_mode @var{mode})


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