OSDN Git Service

* real.h (struct real_format): Split the signbit field into two
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Mar 2005 04:24:02 +0000 (04:24 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Mar 2005 04:24:02 +0000 (04:24 +0000)
two fields, signbit_ro and signbit_rw.
* real.c (ieee_single_format, mips_single_format, ieee_double_format,
mips_double_format, ieee_extended_motorola_format,
ieee_extended_intel_96_format, ieee_extended_intel_96_round_53_format,
ieee_extended_intel_128_format, ibm_extended_format,
mips_extended_format, ieee_quad_format, mips_quad_format,
vax_f_format, vax_d_format, vax_g_format, i370_single_format,
i370_double_format, c4x_single_format, c4x_extended_format,
real_internal_format): Update initializers for new field.
* builtins.c (expand_builtin_signbit): Use signbit_ro field of the
real_format structure.
* optabs.c (expand_absneg_bit, expand_copysign): Use signbit_rw
field of the real_format structure.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96471 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/builtins.c
gcc/optabs.c
gcc/real.c
gcc/real.h

index 010a9ad..8a3f9c6 100644 (file)
@@ -1,3 +1,20 @@
+2005-03-14  Roger Sayle  <roger@eyesopen.com>
+
+       * real.h (struct real_format): Split the signbit field into two
+       two fields, signbit_ro and signbit_rw.
+       * real.c (ieee_single_format, mips_single_format, ieee_double_format,
+       mips_double_format, ieee_extended_motorola_format,
+       ieee_extended_intel_96_format, ieee_extended_intel_96_round_53_format,
+       ieee_extended_intel_128_format, ibm_extended_format,
+       mips_extended_format, ieee_quad_format, mips_quad_format,
+       vax_f_format, vax_d_format, vax_g_format, i370_single_format,
+       i370_double_format, c4x_single_format, c4x_extended_format,
+       real_internal_format): Update initializers for new field.
+       * builtins.c (expand_builtin_signbit): Use signbit_ro field of the
+       real_format structure.
+       * optabs.c (expand_absneg_bit, expand_copysign): Use signbit_rw
+       field of the real_format structure.
+
 2005-03-14  Daniel Berlin <dberlin@dberlin.org>
 
        Fix PR tree-optimization/20458
index c239d6c..c00fe1c 100644 (file)
@@ -4969,7 +4969,7 @@ expand_builtin_signbit (tree exp, rtx target)
 
   /* For floating point formats without a sign bit, implement signbit
      as "ARG < 0.0".  */
-  bitpos = fmt->signbit;
+  bitpos = fmt->signbit_ro;
   if (bitpos < 0)
   {
     /* But we can't do this if the format supports signed zero.  */
index f0c336e..d41a234 100644 (file)
@@ -2182,7 +2182,7 @@ expand_absneg_bit (enum rtx_code code, enum machine_mode mode,
   if (fmt == NULL)
     return NULL_RTX;
 
-  bitpos = fmt->signbit;
+  bitpos = fmt->signbit_rw;
   if (bitpos < 0)
     return NULL_RTX;
 
@@ -2882,7 +2882,7 @@ expand_copysign (rtx op0, rtx op1, rtx target)
   if (fmt == NULL || !fmt->has_signed_zero)
     return NULL_RTX;
 
-  bitpos = fmt->signbit;
+  bitpos = fmt->signbit_rw;
   if (bitpos < 0)
     return NULL_RTX;
 
index 5d1a79f..bed2fb0 100644 (file)
@@ -2651,6 +2651,7 @@ const struct real_format ieee_single_format =
     -125,
     128,
     31,
+    31,
     true,
     true,
     true,
@@ -2669,6 +2670,7 @@ const struct real_format mips_single_format =
     -125,
     128,
     31,
+    31,
     true,
     true,
     true,
@@ -2874,6 +2876,7 @@ const struct real_format ieee_double_format =
     -1021,
     1024,
     63,
+    63,
     true,
     true,
     true,
@@ -2892,6 +2895,7 @@ const struct real_format mips_double_format =
     -1021,
     1024,
     63,
+    63,
     true,
     true,
     true,
@@ -3221,6 +3225,7 @@ const struct real_format ieee_extended_motorola_format =
     -16382,
     16384,
     95,
+    95,
     true,
     true,
     true,
@@ -3239,6 +3244,7 @@ const struct real_format ieee_extended_intel_96_format =
     -16381,
     16384,
     79,
+    79,
     true,
     true,
     true,
@@ -3257,6 +3263,7 @@ const struct real_format ieee_extended_intel_128_format =
     -16381,
     16384,
     79,
+    79,
     true,
     true,
     true,
@@ -3277,6 +3284,7 @@ const struct real_format ieee_extended_intel_96_round_53_format =
     -16381,
     16384,
     79,
+    79,
     true,
     true,
     true,
@@ -3361,6 +3369,7 @@ const struct real_format ibm_extended_format =
     53,
     -1021 + 53,
     1024,
+    127,
     -1,
     true,
     true,
@@ -3379,6 +3388,7 @@ const struct real_format mips_extended_format =
     53,
     -1021 + 53,
     1024,
+    127,
     -1,
     true,
     true,
@@ -3646,6 +3656,7 @@ const struct real_format ieee_quad_format =
     -16381,
     16384,
     127,
+    127,
     true,
     true,
     true,
@@ -3664,6 +3675,7 @@ const struct real_format mips_quad_format =
     -16381,
     16384,
     127,
+    127,
     true,
     true,
     true,
@@ -3961,6 +3973,7 @@ const struct real_format vax_f_format =
     -127,
     127,
     15,
+    15,
     false,
     false,
     false,
@@ -3979,6 +3992,7 @@ const struct real_format vax_d_format =
     -127,
     127,
     15,
+    15,
     false,
     false,
     false,
@@ -3997,6 +4011,7 @@ const struct real_format vax_g_format =
     -1023,
     1023,
     15,
+    15,
     false,
     false,
     false,
@@ -4172,6 +4187,7 @@ const struct real_format i370_single_format =
     -64,
     63,
     31,
+    31,
     false,
     false,
     false, /* ??? The encoding does allow for "unnormals".  */
@@ -4190,6 +4206,7 @@ const struct real_format i370_double_format =
     -64,
     63,
     63,
+    63,
     false,
     false,
     false, /* ??? The encoding does allow for "unnormals".  */
@@ -4398,6 +4415,7 @@ const struct real_format c4x_single_format =
     -126,
     128,
     -1,
+    -1,
     false,
     false,
     false,
@@ -4416,6 +4434,7 @@ const struct real_format c4x_extended_format =
     -126,
     128,
     -1,
+    -1,
     false,
     false,
     false,
@@ -4459,6 +4478,7 @@ const struct real_format real_internal_format =
     -MAX_EXP,
     MAX_EXP,
     -1,
+    -1,
     true,
     true,
     false,
index 5c4e9c6..9e52c6d 100644 (file)
@@ -138,8 +138,13 @@ struct real_format
   /* The maximum integer, x, such that b**(x-1) is representable.  */
   int emax;
 
-  /* The bit position of the sign bit, or -1 for a complex encoding.  */
-  int signbit;
+  /* The bit position of the sign bit, for determining whether a value
+     is positive/negative, or -1 for a complex encoding.  */
+  int signbit_ro;
+
+  /* The bit position of the sign bit, for changing the sign of a number,
+     or -1 for a complex encoding.  */
+  int signbit_rw;
 
   /* Properties of the format.  */
   bool has_nans;