aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2008-01-25 20:49:04 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2008-01-25 20:49:04 +0000
commit8d8da227888f95418be8d0c90fcec2ff1a2c8438 (patch)
treec661d734edca52044b7e928322867308ff62a8d2 /gcc/real.c
parent1d555e263297673f544484d6f9dd82ee50958bd7 (diff)
downloadgcc-8d8da227888f95418be8d0c90fcec2ff1a2c8438.zip
gcc-8d8da227888f95418be8d0c90fcec2ff1a2c8438.tar.gz
gcc-8d8da227888f95418be8d0c90fcec2ff1a2c8438.tar.bz2
MAINTAINERS (c4x port): Remove.
* MAINTAINERS (c4x port): Remove. contrib: * paranoia.cc (main): Remove handling of c4x_single and c4x_extended formats. gcc: * config/c4x: Remove directory. * config.gcc (crx-*, mt-*): Mark obsolete. (c4x-*, tic4x-*, c4x-*-rtems*, tic4x-*-rtems*, c4x-*, tic4x-*, h8300-*-rtemscoff*, ns32k-*-netbsdelf*, ns32k-*-netbsd*, sh-*-rtemscoff*): Remove cases. * defaults.h (C4X_FLOAT_FORMAT): Remove. * real.c (encode_c4x_single, decode_c4x_single, encode_c4x_extended, decode_c4x_extended, c4x_single_format, c4x_extended_format): Remove. * real.h (c4x_single_format, c4x_extended_format): Remove. * doc/extend.texi (interrupt, naked): Remove mention of attributes on C4x. (Pragmas): Remove comment about c4x pragmas. * doc/install.texi (c4x): Remove target-specific instructions. * doc/invoke.texi (TMS320C3x/C4x Options): Remove. * doc/md.texi (Machine Constraints): Remove C4x documentation. * doc/tm.texi (MEMBER_TYPE_FORCES_BLK, c_register_pragma): Do not refer to C4x source files as examples. (C4X_FLOAT_FORMAT): Remove documentation. gcc/testsuite: * gcc.dg/builtin-inf-1.c, gcc.dg/compare6.c, gcc.dg/sibcall-3.c, gcc.dg/sibcall-4.c, gcc.dg/torture/builtin-attr-1.c: Don't handle c4x-*-* targets. libgcc: * config.host (tic4x-*-*, c4x-*-rtems*, tic4x-*-rtems*, c4x-*, tic4x-*, h8300-*-rtemscoff*, ns32k-*-netbsdelf*, ns32k-*-netbsd*, sh-*-rtemscoff*): Remove cases. From-SVN: r131835
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c231
1 files changed, 1 insertions, 230 deletions
diff --git a/gcc/real.c b/gcc/real.c
index ec7d56b..38f18a8 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -1,6 +1,6 @@
/* real.c - software floating point emulation.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ 2000, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Contributed by Stephen L. Moshier (moshier@world.std.com).
Re-written by Richard Henderson <rth@redhat.com>
@@ -4278,235 +4278,6 @@ const struct real_format decimal_quad_format =
false
};
-/* The "twos-complement" c4x format is officially defined as
-
- x = s(~s).f * 2**e
-
- This is rather misleading. One must remember that F is signed.
- A better description would be
-
- x = -1**s * ((s + 1 + .f) * 2**e
-
- So if we have a (4 bit) fraction of .1000 with a sign bit of 1,
- that's -1 * (1+1+(-.5)) == -1.5. I think.
-
- The constructions here are taken from Tables 5-1 and 5-2 of the
- TMS320C4x User's Guide wherein step-by-step instructions for
- conversion from IEEE are presented. That's close enough to our
- internal representation so as to make things easy.
-
- See http://www-s.ti.com/sc/psheets/spru063c/spru063c.pdf */
-
-static void encode_c4x_single (const struct real_format *fmt,
- long *, const REAL_VALUE_TYPE *);
-static void decode_c4x_single (const struct real_format *,
- REAL_VALUE_TYPE *, const long *);
-static void encode_c4x_extended (const struct real_format *fmt,
- long *, const REAL_VALUE_TYPE *);
-static void decode_c4x_extended (const struct real_format *,
- REAL_VALUE_TYPE *, const long *);
-
-static void
-encode_c4x_single (const struct real_format *fmt ATTRIBUTE_UNUSED,
- long *buf, const REAL_VALUE_TYPE *r)
-{
- unsigned long image, exp, sig;
-
- switch (r->cl)
- {
- case rvc_zero:
- exp = -128;
- sig = 0;
- break;
-
- case rvc_inf:
- case rvc_nan:
- exp = 127;
- sig = 0x800000 - r->sign;
- break;
-
- case rvc_normal:
- exp = REAL_EXP (r) - 1;
- sig = (r->sig[SIGSZ-1] >> (HOST_BITS_PER_LONG - 24)) & 0x7fffff;
- if (r->sign)
- {
- if (sig)
- sig = -sig;
- else
- exp--;
- sig |= 0x800000;
- }
- break;
-
- default:
- gcc_unreachable ();
- }
-
- image = ((exp & 0xff) << 24) | (sig & 0xffffff);
- buf[0] = image;
-}
-
-static void
-decode_c4x_single (const struct real_format *fmt ATTRIBUTE_UNUSED,
- REAL_VALUE_TYPE *r, const long *buf)
-{
- unsigned long image = buf[0];
- unsigned long sig;
- int exp, sf;
-
- exp = (((image >> 24) & 0xff) ^ 0x80) - 0x80;
- sf = ((image & 0xffffff) ^ 0x800000) - 0x800000;
-
- memset (r, 0, sizeof (*r));
-
- if (exp != -128)
- {
- r->cl = rvc_normal;
-
- sig = sf & 0x7fffff;
- if (sf < 0)
- {
- r->sign = 1;
- if (sig)
- sig = -sig;
- else
- exp++;
- }
- sig = (sig << (HOST_BITS_PER_LONG - 24)) | SIG_MSB;
-
- SET_REAL_EXP (r, exp + 1);
- r->sig[SIGSZ-1] = sig;
- }
-}
-
-static void
-encode_c4x_extended (const struct real_format *fmt ATTRIBUTE_UNUSED,
- long *buf, const REAL_VALUE_TYPE *r)
-{
- unsigned long exp, sig;
-
- switch (r->cl)
- {
- case rvc_zero:
- exp = -128;
- sig = 0;
- break;
-
- case rvc_inf:
- case rvc_nan:
- exp = 127;
- sig = 0x80000000 - r->sign;
- break;
-
- case rvc_normal:
- exp = REAL_EXP (r) - 1;
-
- sig = r->sig[SIGSZ-1];
- if (HOST_BITS_PER_LONG == 64)
- sig = sig >> 1 >> 31;
- sig &= 0x7fffffff;
-
- if (r->sign)
- {
- if (sig)
- sig = -sig;
- else
- exp--;
- sig |= 0x80000000;
- }
- break;
-
- default:
- gcc_unreachable ();
- }
-
- exp = (exp & 0xff) << 24;
- sig &= 0xffffffff;
-
- if (FLOAT_WORDS_BIG_ENDIAN)
- buf[0] = exp, buf[1] = sig;
- else
- buf[0] = sig, buf[0] = exp;
-}
-
-static void
-decode_c4x_extended (const struct real_format *fmt ATTRIBUTE_UNUSED,
- REAL_VALUE_TYPE *r, const long *buf)
-{
- unsigned long sig;
- int exp, sf;
-
- if (FLOAT_WORDS_BIG_ENDIAN)
- exp = buf[0], sf = buf[1];
- else
- sf = buf[0], exp = buf[1];
-
- exp = (((exp >> 24) & 0xff) & 0x80) - 0x80;
- sf = ((sf & 0xffffffff) ^ 0x80000000) - 0x80000000;
-
- memset (r, 0, sizeof (*r));
-
- if (exp != -128)
- {
- r->cl = rvc_normal;
-
- sig = sf & 0x7fffffff;
- if (sf < 0)
- {
- r->sign = 1;
- if (sig)
- sig = -sig;
- else
- exp++;
- }
- if (HOST_BITS_PER_LONG == 64)
- sig = sig << 1 << 31;
- sig |= SIG_MSB;
-
- SET_REAL_EXP (r, exp + 1);
- r->sig[SIGSZ-1] = sig;
- }
-}
-
-const struct real_format c4x_single_format =
- {
- encode_c4x_single,
- decode_c4x_single,
- 2,
- 24,
- 24,
- -126,
- 128,
- 23,
- -1,
- false,
- false,
- false,
- false,
- false,
- false
- };
-
-const struct real_format c4x_extended_format =
- {
- encode_c4x_extended,
- decode_c4x_extended,
- 2,
- 32,
- 32,
- -126,
- 128,
- 31,
- -1,
- false,
- false,
- false,
- false,
- false,
- false
- };
-
-
/* A synthetic "format" for internal arithmetic. It's the size of the
internal significand minus the two bits needed for proper rounding.
The encode and decode routines exist only to satisfy our paranoia