This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] real.c: Remove i370-related stuff.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 07 Feb 2004 20:56:13 -0500 (EST)
- Subject: [patch] real.c: Remove i370-related stuff.
Hi,
Attached is a patch to remove i370-related stuff.
Bootstrapped on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
2004-02-07 Kazu Hirata <kazu@cs.umass.edu>
* real.c (encode_i370_single): Remove.
(decode_i370_single): Likewise.
(encode_i370_double): Likewise.
(encode_i370_double): Likewise.
(i370_single_format): Likewise.
(i370_double_format): Likewise.
Index: real.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/real.c,v
retrieving revision 1.136
diff -u -r1.136 real.c
--- real.c 23 Jan 2004 16:16:32 -0000 1.136
+++ real.c 7 Feb 2004 19:09:00 -0000
@@ -3927,199 +3927,6 @@
false
};
-/* A good reference for these can be found in chapter 9 of
- "ESA/390 Principles of Operation", IBM document number SA22-7201-01.
- An on-line version can be found here:
-
- http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DZ9AR001/9.1?DT=19930923083613
-*/
-
-static void encode_i370_single (const struct real_format *fmt,
- long *, const REAL_VALUE_TYPE *);
-static void decode_i370_single (const struct real_format *,
- REAL_VALUE_TYPE *, const long *);
-static void encode_i370_double (const struct real_format *fmt,
- long *, const REAL_VALUE_TYPE *);
-static void decode_i370_double (const struct real_format *,
- REAL_VALUE_TYPE *, const long *);
-
-static void
-encode_i370_single (const struct real_format *fmt ATTRIBUTE_UNUSED,
- long *buf, const REAL_VALUE_TYPE *r)
-{
- unsigned long sign, exp, sig, image;
-
- sign = r->sign << 31;
-
- switch (r->class)
- {
- case rvc_zero:
- image = 0;
- break;
-
- case rvc_inf:
- case rvc_nan:
- image = 0x7fffffff | sign;
- break;
-
- case rvc_normal:
- sig = (r->sig[SIGSZ-1] >> (HOST_BITS_PER_LONG - 24)) & 0xffffff;
- exp = ((r->exp / 4) + 64) << 24;
- image = sign | exp | sig;
- break;
-
- default:
- abort ();
- }
-
- buf[0] = image;
-}
-
-static void
-decode_i370_single (const struct real_format *fmt ATTRIBUTE_UNUSED,
- REAL_VALUE_TYPE *r, const long *buf)
-{
- unsigned long sign, sig, image = buf[0];
- int exp;
-
- sign = (image >> 31) & 1;
- exp = (image >> 24) & 0x7f;
- sig = image & 0xffffff;
-
- memset (r, 0, sizeof (*r));
-
- if (exp || sig)
- {
- r->class = rvc_normal;
- r->sign = sign;
- r->exp = (exp - 64) * 4;
- r->sig[SIGSZ-1] = sig << (HOST_BITS_PER_LONG - 24);
- normalize (r);
- }
-}
-
-static void
-encode_i370_double (const struct real_format *fmt ATTRIBUTE_UNUSED,
- long *buf, const REAL_VALUE_TYPE *r)
-{
- unsigned long sign, exp, image_hi, image_lo;
-
- sign = r->sign << 31;
-
- switch (r->class)
- {
- case rvc_zero:
- image_hi = image_lo = 0;
- break;
-
- case rvc_inf:
- case rvc_nan:
- image_hi = 0x7fffffff | sign;
- image_lo = 0xffffffff;
- break;
-
- case rvc_normal:
- if (HOST_BITS_PER_LONG == 64)
- {
- image_hi = r->sig[SIGSZ-1];
- image_lo = (image_hi >> (64 - 56)) & 0xffffffff;
- image_hi = (image_hi >> (64 - 56 + 1) >> 31) & 0xffffff;
- }
- else
- {
- image_hi = r->sig[SIGSZ-1];
- image_lo = r->sig[SIGSZ-2];
- image_lo = (image_lo >> 8) | (image_hi << 24);
- image_hi >>= 8;
- }
-
- exp = ((r->exp / 4) + 64) << 24;
- image_hi |= sign | exp;
- break;
-
- default:
- abort ();
- }
-
- if (FLOAT_WORDS_BIG_ENDIAN)
- buf[0] = image_hi, buf[1] = image_lo;
- else
- buf[0] = image_lo, buf[1] = image_hi;
-}
-
-static void
-decode_i370_double (const struct real_format *fmt ATTRIBUTE_UNUSED,
- REAL_VALUE_TYPE *r, const long *buf)
-{
- unsigned long sign, image_hi, image_lo;
- int exp;
-
- if (FLOAT_WORDS_BIG_ENDIAN)
- image_hi = buf[0], image_lo = buf[1];
- else
- image_lo = buf[0], image_hi = buf[1];
-
- sign = (image_hi >> 31) & 1;
- exp = (image_hi >> 24) & 0x7f;
- image_hi &= 0xffffff;
- image_lo &= 0xffffffff;
-
- memset (r, 0, sizeof (*r));
-
- if (exp || image_hi || image_lo)
- {
- r->class = rvc_normal;
- r->sign = sign;
- r->exp = (exp - 64) * 4 + (SIGNIFICAND_BITS - 56);
-
- if (HOST_BITS_PER_LONG == 32)
- {
- r->sig[0] = image_lo;
- r->sig[1] = image_hi;
- }
- else
- r->sig[0] = image_lo | (image_hi << 31 << 1);
-
- normalize (r);
- }
-}
-
-const struct real_format i370_single_format =
- {
- encode_i370_single,
- decode_i370_single,
- 16,
- 4,
- 6,
- 6,
- -64,
- 63,
- 31,
- false,
- false,
- false, /* ??? The encoding does allow for "unnormals". */
- false, /* ??? The encoding does allow for "unnormals". */
- false
- };
-
-const struct real_format i370_double_format =
- {
- encode_i370_double,
- decode_i370_double,
- 16,
- 4,
- 14,
- 14,
- -64,
- 63,
- 63,
- false,
- false,
- false, /* ??? The encoding does allow for "unnormals". */
- false, /* ??? The encoding does allow for "unnormals". */
- false
- };
-
/* The "twos-complement" c4x format is officially defined as
x = s(~s).f * 2**e