aboutsummaryrefslogtreecommitdiff
path: root/gcc/libgcc2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r--gcc/libgcc2.c41
1 files changed, 13 insertions, 28 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 0cf1b12..dad2dca 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -935,17 +935,13 @@ XFtype
__floatdixf (DItype u)
{
XFtype d;
- SItype negate = 0;
- if (u < 0)
- u = -u, negate = 1;
-
- d = (USItype) (u >> WORD_SIZE);
+ d = (SItype) (u >> WORD_SIZE);
d *= HIGH_HALFWORD_COEFF;
d *= HIGH_HALFWORD_COEFF;
d += (USItype) (u & (HIGH_WORD_COEFF - 1));
- return (negate ? -d : d);
+ return d;
}
#endif
@@ -958,17 +954,13 @@ TFtype
__floatditf (DItype u)
{
TFtype d;
- SItype negate = 0;
-
- if (u < 0)
- u = -u, negate = 1;
- d = (USItype) (u >> WORD_SIZE);
+ d = (SItype) (u >> WORD_SIZE);
d *= HIGH_HALFWORD_COEFF;
d *= HIGH_HALFWORD_COEFF;
d += (USItype) (u & (HIGH_WORD_COEFF - 1));
- return (negate ? -d : d);
+ return d;
}
#endif
@@ -981,17 +973,13 @@ DFtype
__floatdidf (DItype u)
{
DFtype d;
- SItype negate = 0;
- if (u < 0)
- u = -u, negate = 1;
-
- d = (USItype) (u >> WORD_SIZE);
+ d = (SItype) (u >> WORD_SIZE);
d *= HIGH_HALFWORD_COEFF;
d *= HIGH_HALFWORD_COEFF;
d += (USItype) (u & (HIGH_WORD_COEFF - 1));
- return (negate ? -d : d);
+ return d;
}
#endif
@@ -1036,10 +1024,6 @@ __floatdisf (DItype u)
so that we don't lose any of the precision of the high word
while multiplying it. */
DFtype f;
- SItype negate = 0;
-
- if (u < 0)
- u = -u, negate = 1;
/* Protect against double-rounding error.
Represent any low-order bits, that might be truncated in DFmode,
@@ -1051,18 +1035,19 @@ __floatdisf (DItype u)
&& DF_SIZE > (DI_SIZE - DF_SIZE + SF_SIZE))
{
#define REP_BIT ((USItype) 1 << (DI_SIZE - DF_SIZE))
- if (u >= ((UDItype) 1 << DF_SIZE))
+ if (! (- ((UDItype) 1 << DF_SIZE) < u
+ && u < ((UDItype) 1 << DF_SIZE)))
{
if ((USItype) u & (REP_BIT - 1))
u |= REP_BIT;
}
}
- f = (USItype) (u >> WORD_SIZE);
+ f = (SItype) (u >> WORD_SIZE);
f *= HIGH_HALFWORD_COEFF;
f *= HIGH_HALFWORD_COEFF;
f += (USItype) (u & (HIGH_WORD_COEFF - 1));
- return (SFtype) (negate ? -f : f);
+ return (SFtype) f;
}
#endif
@@ -2988,9 +2973,9 @@ exit (int status)
#endif /* No NEED_ATEXIT */
#endif /* !defined (INIT_SECTION_ASM_OP) || !defined (OBJECT_FORMAT_ELF) */
/* In gbl-ctors.h, ON_EXIT is defined if HAVE_ATEXIT is defined. In
-__bb_init_func and _bb_init_prg, __bb_exit_func is registered with ON_EXIT if
-ON_EXIT is defined. Thus we must not call __bb_exit_func here anymore if
-HAVE_ATEXIT is defined. */
+ __bb_init_func and _bb_init_prg, __bb_exit_func is registered with
+ ON_EXIT if ON_EXIT is defined. Thus we must not call __bb_exit_func here
+ if HAVE_ATEXIT is defined. */
#ifndef HAVE_ATEXIT
#ifndef inhibit_libc
__bb_exit_func ();