Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
- Fix for default mtree style
- Update libelf
- Importing libexecinfo
- Resynchronize GCC, mpc, gmp, mpfr
- build.sh: Replace params with show-params.
This has been done as the make target has been renamed in the same
way, while a new target named params has been added. This new
target generates a file containing all the parameters, instead of
printing it on the console.
- Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
get getservbyport() out of the inner loop
Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: softfloat.c,v 1.2 2012/03/21 14:17:54 christos Exp $ */
|
||||
/* $NetBSD: softfloat.c,v 1.3 2013/01/10 08:16:11 matt Exp $ */
|
||||
|
||||
/*
|
||||
* This version hacked for use with gcc -msoft-float by bjh21.
|
||||
@@ -53,7 +53,7 @@ this code that are retained.
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: softfloat.c,v 1.2 2012/03/21 14:17:54 christos Exp $");
|
||||
__RCSID("$NetBSD: softfloat.c,v 1.3 2013/01/10 08:16:11 matt Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#ifdef SOFTFLOAT_FOR_GCC
|
||||
@@ -79,8 +79,14 @@ __RCSID("$NetBSD: softfloat.c,v 1.2 2012/03/21 14:17:54 christos Exp $");
|
||||
Floating-point rounding mode and exception flags.
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef set_float_rounding_mode
|
||||
fp_rnd float_rounding_mode = float_round_nearest_even;
|
||||
fp_except float_exception_flags = 0;
|
||||
#endif
|
||||
#ifndef set_float_exception_inexact_flag
|
||||
#define set_float_exception_inexact_flag() \
|
||||
((void)(float_exception_flags |= float_flag_inexact))
|
||||
#endif
|
||||
|
||||
/*
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -244,7 +250,7 @@ static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig )
|
||||
if ( isTiny && roundBits ) float_raise( float_flag_underflow );
|
||||
}
|
||||
}
|
||||
if ( roundBits ) float_exception_flags |= float_flag_inexact;
|
||||
if ( roundBits ) set_float_exception_inexact_flag();
|
||||
zSig = ( zSig + roundIncrement )>>7;
|
||||
zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
|
||||
if ( zSig == 0 ) zExp = 0;
|
||||
@@ -472,7 +478,7 @@ static float64
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( zSig2 ) float_exception_flags |= float_flag_inexact;
|
||||
if ( zSig2 ) set_float_exception_inexact_flag();
|
||||
if ( increment ) {
|
||||
add64( zSig0, zSig1, 0, 1, &zSig0, &zSig1 );
|
||||
zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven );
|
||||
@@ -615,7 +621,7 @@ int32 float32_to_int32( float32 a )
|
||||
aSigExtra = aSig<<( shiftCount & 31 );
|
||||
z = aSig>>( - shiftCount );
|
||||
}
|
||||
if ( aSigExtra ) float_exception_flags |= float_flag_inexact;
|
||||
if ( aSigExtra ) set_float_exception_inexact_flag();
|
||||
roundingMode = float_rounding_mode;
|
||||
if ( roundingMode == float_round_nearest_even ) {
|
||||
if ( (sbits32) aSigExtra < 0 ) {
|
||||
@@ -670,13 +676,13 @@ int32 float32_to_int32_round_to_zero( float32 a )
|
||||
return (sbits32) 0x80000000;
|
||||
}
|
||||
else if ( aExp <= 0x7E ) {
|
||||
if ( aExp | aSig ) float_exception_flags |= float_flag_inexact;
|
||||
if ( aExp | aSig ) set_float_exception_inexact_flag();
|
||||
return 0;
|
||||
}
|
||||
aSig = ( aSig | 0x00800000 )<<8;
|
||||
z = aSig>>( - shiftCount );
|
||||
if ( (bits32) ( aSig<<( shiftCount & 31 ) ) ) {
|
||||
float_exception_flags |= float_flag_inexact;
|
||||
set_float_exception_inexact_flag();
|
||||
}
|
||||
if ( aSign ) z = - z;
|
||||
return z;
|
||||
@@ -740,7 +746,7 @@ float32 float32_round_to_int( float32 a )
|
||||
}
|
||||
if ( aExp <= 0x7E ) {
|
||||
if ( (bits32) ( a<<1 ) == 0 ) return a;
|
||||
float_exception_flags |= float_flag_inexact;
|
||||
set_float_exception_inexact_flag();
|
||||
aSign = extractFloat32Sign( a );
|
||||
switch ( float_rounding_mode ) {
|
||||
case float_round_nearest_even:
|
||||
@@ -772,7 +778,7 @@ float32 float32_round_to_int( float32 a )
|
||||
}
|
||||
}
|
||||
z &= ~ roundBitsMask;
|
||||
if ( z != a ) float_exception_flags |= float_flag_inexact;
|
||||
if ( z != a ) set_float_exception_inexact_flag();
|
||||
return z;
|
||||
|
||||
}
|
||||
@@ -1463,7 +1469,7 @@ int32 float64_to_int32( float64 a )
|
||||
float_raise( float_flag_invalid );
|
||||
return aSign ? (sbits32) 0x80000000 : 0x7FFFFFFF;
|
||||
}
|
||||
if ( aSigExtra ) float_exception_flags |= float_flag_inexact;
|
||||
if ( aSigExtra ) set_float_exception_inexact_flag();
|
||||
return z;
|
||||
|
||||
}
|
||||
@@ -1503,7 +1509,7 @@ int32 float64_to_int32_round_to_zero( float64 a )
|
||||
else {
|
||||
if ( aExp < 0x3FF ) {
|
||||
if ( aExp | aSig0 | aSig1 ) {
|
||||
float_exception_flags |= float_flag_inexact;
|
||||
set_float_exception_inexact_flag();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1517,7 +1523,7 @@ int32 float64_to_int32_round_to_zero( float64 a )
|
||||
float_raise( float_flag_invalid );
|
||||
return aSign ? (sbits32) 0x80000000 : 0x7FFFFFFF;
|
||||
}
|
||||
if ( aSigExtra ) float_exception_flags |= float_flag_inexact;
|
||||
if ( aSigExtra ) set_float_exception_inexact_flag();
|
||||
return z;
|
||||
|
||||
}
|
||||
@@ -1607,7 +1613,7 @@ float64 float64_round_to_int( float64 a )
|
||||
else {
|
||||
if ( aExp <= 0x3FE ) {
|
||||
if ( ( ( (bits32) ( a.high<<1 ) ) | a.low ) == 0 ) return a;
|
||||
float_exception_flags |= float_flag_inexact;
|
||||
set_float_exception_inexact_flag();
|
||||
aSign = extractFloat64Sign( a );
|
||||
switch ( float_rounding_mode ) {
|
||||
case float_round_nearest_even:
|
||||
@@ -1650,7 +1656,7 @@ float64 float64_round_to_int( float64 a )
|
||||
z.high &= ~ roundBitsMask;
|
||||
}
|
||||
if ( ( z.low != a.low ) || ( z.high != a.high ) ) {
|
||||
float_exception_flags |= float_flag_inexact;
|
||||
set_float_exception_inexact_flag();
|
||||
}
|
||||
return z;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user