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:
2013-12-06 12:04:52 +01:00
parent ff10274392
commit 84d9c625bf
4655 changed files with 379317 additions and 151059 deletions

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.10 2011/07/04 02:53:15 mrg Exp $
# $NetBSD: Makefile.inc,v 1.15 2013/04/30 01:42:04 matt Exp $
SOFTFLOAT_BITS?=64
.if defined(__MINIX)
@@ -21,17 +21,29 @@ SRCS.softfloat= softfloat.c
SRCS.softfloat+=fpgetround.c fpsetround.c fpgetmask.c fpsetmask.c \
fpgetsticky.c fpsetsticky.c
.if !empty(LIBC_MACHINE_ARCH:Mearm*)
SRCS.softfloat+=__aeabi_dcmpeq.c __aeabi_fcmpeq.c
SRCS.softfloat+=__aeabi_dcmpge.c __aeabi_fcmpge.c
SRCS.softfloat+=__aeabi_dcmpgt.c __aeabi_fcmpgt.c
SRCS.softfloat+=__aeabi_dcmple.c __aeabi_fcmple.c
SRCS.softfloat+=__aeabi_dcmplt.c __aeabi_fcmplt.c
SRCS.softfloat+=__aeabi_dcmpun.c __aeabi_fcmpun.c
.else
SRCS.softfloat+=eqsf2.c nesf2.c gtsf2.c gesf2.c ltsf2.c lesf2.c negsf2.c \
eqdf2.c nedf2.c gtdf2.c gedf2.c ltdf2.c ledf2.c negdf2.c \
eqtf2.c netf2.c gttf2.c getf2.c lttf2.c letf2.c negtf2.c \
nexf2.c gtxf2.c gexf2.c negxf2.c unordsf2.c unorddf2.c
.endif
SRCS+= ${SRCS.softfloat}
# XXX
.if defined(HAVE_GCC) && ${HAVE_GCC} >= 45 && \
(${MACHINE_CPU} == "arm" || \
${MACHINE_CPU} == "mips" || \
.if defined(HAVE_GCC) && ${HAVE_GCC} >= 45
.if (${MACHINE_CPU} == "arm")
# See doc/HACKS for more information.
COPTS.softfloat.c+= -Wno-enum-compare -fno-tree-vrp
.elif (${MACHINE_CPU} == "mips" || \
${MACHINE_CPU} == "sh3")
COPTS.softfloat.c+= -Wno-enum-compare
.endif
.endif

View File

@@ -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;

View File

@@ -1,4 +1,4 @@
/* $NetBSD: softfloat.c,v 1.11 2012/03/24 00:06:20 matt Exp $ */
/* $NetBSD: softfloat.c,v 1.13 2013/11/22 17:04:24 martin Exp $ */
/*
* This version hacked for use with gcc -msoft-float by bjh21.
@@ -46,7 +46,7 @@ this code that are retained.
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: softfloat.c,v 1.11 2012/03/24 00:06:20 matt Exp $");
__RCSID("$NetBSD: softfloat.c,v 1.13 2013/11/22 17:04:24 martin Exp $");
#endif /* LIBC_SCCS and not lint */
#ifdef SOFTFLOAT_FOR_GCC
@@ -73,8 +73,14 @@ Floating-point rounding mode, extended double-precision rounding precision,
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
#ifdef FLOATX80
int8 floatx80_rounding_precision = 80;
#endif
@@ -146,7 +152,7 @@ static int32 roundAndPackInt32( flag zSign, bits64 absZ )
float_raise( float_flag_invalid );
return zSign ? (sbits32) 0x80000000 : 0x7FFFFFFF;
}
if ( roundBits ) float_exception_flags |= float_flag_inexact;
if ( roundBits ) set_float_exception_inexact_flag();
return z;
}
@@ -200,7 +206,7 @@ static int64 roundAndPackInt64( flag zSign, bits64 absZ0, bits64 absZ1 )
zSign ? (sbits64) LIT64( 0x8000000000000000 )
: LIT64( 0x7FFFFFFFFFFFFFFF );
}
if ( absZ1 ) float_exception_flags |= float_flag_inexact;
if ( absZ1 ) set_float_exception_inexact_flag();
return z;
}
@@ -347,7 +353,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;
@@ -519,7 +525,7 @@ static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 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 )>>10;
zSig &= ~ ( ( ( roundBits ^ 0x200 ) == 0 ) & roundNearestEven );
if ( zSig == 0 ) zExp = 0;
@@ -702,7 +708,7 @@ static floatx80
zExp = 0;
roundBits = zSig0 & roundMask;
if ( isTiny && roundBits ) float_raise( float_flag_underflow );
if ( roundBits ) float_exception_flags |= float_flag_inexact;
if ( roundBits ) set_float_exception_inexact_flag();
zSig0 += roundIncrement;
if ( (sbits64) zSig0 < 0 ) zExp = 1;
roundIncrement = roundMask + 1;
@@ -713,7 +719,7 @@ static floatx80
return packFloatx80( zSign, zExp, zSig0 );
}
}
if ( roundBits ) float_exception_flags |= float_flag_inexact;
if ( roundBits ) set_float_exception_inexact_flag();
zSig0 += roundIncrement;
if ( zSig0 < roundIncrement ) {
++zExp;
@@ -768,7 +774,7 @@ static floatx80
shift64ExtraRightJamming( zSig0, zSig1, 1 - zExp, &zSig0, &zSig1 );
zExp = 0;
if ( isTiny && zSig1 ) float_raise( float_flag_underflow );
if ( zSig1 ) float_exception_flags |= float_flag_inexact;
if ( zSig1 ) set_float_exception_inexact_flag();
if ( roundNearestEven ) {
increment = ( (sbits64) zSig1 < 0 );
}
@@ -789,7 +795,7 @@ static floatx80
return packFloatx80( zSign, zExp, zSig0 );
}
}
if ( zSig1 ) float_exception_flags |= float_flag_inexact;
if ( zSig1 ) set_float_exception_inexact_flag();
if ( increment ) {
++zSig0;
if ( zSig0 == 0 ) {
@@ -1059,7 +1065,7 @@ static float128
}
}
}
if ( zSig2 ) float_exception_flags |= float_flag_inexact;
if ( zSig2 ) set_float_exception_inexact_flag();
if ( increment ) {
add128( zSig0, zSig1, 0, 1, &zSig0, &zSig1 );
zSig1 &= ~ ( ( zSig2 + zSig2 == 0 ) & roundNearestEven );
@@ -1431,13 +1437,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;
@@ -1515,14 +1521,14 @@ int64 float32_to_int64_round_to_zero( float32 a )
return (sbits64) LIT64( 0x8000000000000000 );
}
else if ( aExp <= 0x7E ) {
if ( aExp | aSig ) float_exception_flags |= float_flag_inexact;
if ( aExp | aSig ) set_float_exception_inexact_flag();
return 0;
}
aSig64 = aSig | 0x00800000;
aSig64 <<= 40;
z = aSig64>>( - shiftCount );
if ( (bits64) ( aSig64<<( shiftCount & 63 ) ) ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
if ( aSign ) z = - z;
return z;
@@ -1654,7 +1660,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:
@@ -1686,7 +1692,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;
}
@@ -2372,7 +2378,7 @@ int32 float64_to_int32_round_to_zero( float64 a )
goto invalid;
}
else if ( aExp < 0x3FF ) {
if ( aExp || aSig ) float_exception_flags |= float_flag_inexact;
if ( aExp || aSig ) set_float_exception_inexact_flag();
return 0;
}
aSig |= LIT64( 0x0010000000000000 );
@@ -2387,7 +2393,7 @@ int32 float64_to_int32_round_to_zero( float64 a )
return aSign ? (sbits32) 0x80000000 : 0x7FFFFFFF;
}
if ( ( aSig<<shiftCount ) != savedASig ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
return z;
@@ -2477,12 +2483,12 @@ int64 float64_to_int64_round_to_zero( float64 a )
}
else {
if ( aExp < 0x3FE ) {
if ( aExp | aSig ) float_exception_flags |= float_flag_inexact;
if ( aExp | aSig ) set_float_exception_inexact_flag();
return 0;
}
z = aSig>>( - shiftCount );
if ( (bits64) ( aSig<<( shiftCount & 63 ) ) ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
}
if ( aSign ) z = - z;
@@ -2619,7 +2625,7 @@ float64 float64_round_to_int( float64 a )
}
if ( aExp < 0x3FF ) {
if ( (bits64) ( a<<1 ) == 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:
@@ -2652,7 +2658,7 @@ float64 float64_round_to_int( float64 a )
}
}
z &= ~ roundBitsMask;
if ( z != a ) float_exception_flags |= float_flag_inexact;
if ( z != a ) set_float_exception_inexact_flag();
return z;
}
@@ -3333,7 +3339,7 @@ int32 floatx80_to_int32_round_to_zero( floatx80 a )
goto invalid;
}
else if ( aExp < 0x3FFF ) {
if ( aExp || aSig ) float_exception_flags |= float_flag_inexact;
if ( aExp || aSig ) set_float_exception_inexact_flag();
return 0;
}
shiftCount = 0x403E - aExp;
@@ -3347,7 +3353,7 @@ int32 floatx80_to_int32_round_to_zero( floatx80 a )
return aSign ? (sbits32) 0x80000000 : 0x7FFFFFFF;
}
if ( ( aSig<<shiftCount ) != savedASig ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
return z;
@@ -3427,12 +3433,12 @@ int64 floatx80_to_int64_round_to_zero( floatx80 a )
return (sbits64) LIT64( 0x8000000000000000 );
}
else if ( aExp < 0x3FFF ) {
if ( aExp | aSig ) float_exception_flags |= float_flag_inexact;
if ( aExp | aSig ) set_float_exception_inexact_flag();
return 0;
}
z = aSig>>( - shiftCount );
if ( (bits64) ( aSig<<( shiftCount & 63 ) ) ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
if ( aSign ) z = - z;
return z;
@@ -3554,7 +3560,7 @@ floatx80 floatx80_round_to_int( floatx80 a )
&& ( (bits64) ( extractFloatx80Frac( a )<<1 ) == 0 ) ) {
return a;
}
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
aSign = extractFloatx80Sign( a );
switch ( float_rounding_mode ) {
case float_round_nearest_even:
@@ -3597,7 +3603,7 @@ floatx80 floatx80_round_to_int( floatx80 a )
++z.high;
z.low = LIT64( 0x8000000000000000 );
}
if ( z.low != a.low ) float_exception_flags |= float_flag_inexact;
if ( z.low != a.low ) set_float_exception_inexact_flag();
return z;
}
@@ -4355,7 +4361,7 @@ int32 float128_to_int32_round_to_zero( float128 a )
goto invalid;
}
else if ( aExp < 0x3FFF ) {
if ( aExp || aSig0 ) float_exception_flags |= float_flag_inexact;
if ( aExp || aSig0 ) set_float_exception_inexact_flag();
return 0;
}
aSig0 |= LIT64( 0x0001000000000000 );
@@ -4370,7 +4376,7 @@ int32 float128_to_int32_round_to_zero( float128 a )
return aSign ? (sbits32) 0x80000000 : 0x7FFFFFFF;
}
if ( ( aSig0<<shiftCount ) != savedASig ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
return z;
@@ -4449,7 +4455,7 @@ int64 float128_to_int64_round_to_zero( float128 a )
aSig0 &= LIT64( 0x0000FFFFFFFFFFFF );
if ( ( a.high == LIT64( 0xC03E000000000000 ) )
&& ( aSig1 < LIT64( 0x0002000000000000 ) ) ) {
if ( aSig1 ) float_exception_flags |= float_flag_inexact;
if ( aSig1 ) set_float_exception_inexact_flag();
}
else {
float_raise( float_flag_invalid );
@@ -4461,20 +4467,20 @@ int64 float128_to_int64_round_to_zero( float128 a )
}
z = ( aSig0<<shiftCount ) | ( aSig1>>( ( - shiftCount ) & 63 ) );
if ( (bits64) ( aSig1<<shiftCount ) ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
}
else {
if ( aExp < 0x3FFF ) {
if ( aExp | aSig0 | aSig1 ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
return 0;
}
z = aSig0>>( - shiftCount );
if ( aSig1
|| ( shiftCount && (bits64) ( aSig0<<( shiftCount & 63 ) ) ) ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
}
if ( aSign ) z = - z;
@@ -4505,7 +4511,7 @@ uint64 float128_to_uint64_round_to_zero( float128 a )
aSig0 &= LIT64( 0x0000FFFFFFFFFFFF );
if ( ( a.high == LIT64( 0xC03E000000000000 ) )
&& ( aSig1 < LIT64( 0x0002000000000000 ) ) ) {
if ( aSig1 ) float_exception_flags |= float_flag_inexact;
if ( aSig1 ) set_float_exception_inexact_flag();
}
else {
float_raise( float_flag_invalid );
@@ -4514,19 +4520,19 @@ uint64 float128_to_uint64_round_to_zero( float128 a )
}
z = ( aSig0<<shiftCount ) | ( aSig1>>( ( - shiftCount ) & 63 ) );
if ( (bits64) ( aSig1<<shiftCount ) ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
}
else {
if ( aExp < 0x3FFF ) {
if ( aExp | aSig0 | aSig1 ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
return 0;
}
z = aSig0>>( - shiftCount );
if (aSig1 || ( shiftCount && (bits64) ( aSig0<<( shiftCount & 63 ) ) ) ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
}
if ( aSign ) z = - z;
@@ -4699,7 +4705,7 @@ float128 float128_round_to_int( float128 a )
else {
if ( aExp < 0x3FFF ) {
if ( ( ( (bits64) ( a.high<<1 ) ) | a.low ) == 0 ) return a;
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
aSign = extractFloat128Sign( a );
switch ( float_rounding_mode ) {
case float_round_nearest_even:
@@ -4745,7 +4751,7 @@ float128 float128_round_to_int( float128 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;
@@ -5255,7 +5261,7 @@ float128 float128_sqrt( float128 a )
if ( ( aSig0 | aSig1 ) == 0 ) return packFloat128( 0, 0, 0, 0 );
normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 );
}
zExp = ( (unsigned int)(aExp - 0x3FFF) >> 1) + 0x3FFE;
zExp = (int32) ( (aExp - 0x3FFF) >> 1) + 0x3FFE;
aSig0 |= LIT64( 0x0001000000000000 );
zSig0 = estimateSqrt32((int16)aExp, (bits32)(aSig0>>17));
shortShift128Left( aSig0, aSig1, 13 - ( aExp & 1 ), &aSig0, &aSig1 );
@@ -5535,7 +5541,7 @@ uint32 float64_to_uint32_round_to_zero( float64 a )
return 0xffffffff;
}
else if ( aExp < 0x3FF ) {
if ( aExp || aSig ) float_exception_flags |= float_flag_inexact;
if ( aExp || aSig ) set_float_exception_inexact_flag();
return 0;
}
aSig |= LIT64( 0x0010000000000000 );
@@ -5544,7 +5550,7 @@ uint32 float64_to_uint32_round_to_zero( float64 a )
aSig >>= shiftCount;
z = (uint32)aSig;
if ( ( aSig<<shiftCount ) != savedASig ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
return z;
@@ -5581,13 +5587,13 @@ uint32 float32_to_uint32_round_to_zero( float32 a )
return 0xFFFFFFFF;
}
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 | 0x800000 )<<8;
z = aSig>>( - shiftCount );
if ( aSig<<( shiftCount & 31 ) ) {
float_exception_flags |= float_flag_inexact;
set_float_exception_inexact_flag();
}
return z;

View File

@@ -18,10 +18,11 @@ flag __eqdf2(float64, float64);
flag
__eqdf2(float64 a, float64 b)
{
#if defined(__minix) && defined(__arm__)
return float64_eq(a, b);
#else
/* libgcc1.c says !(a == b) */
return !float64_eq(a, b);
#endif
#endif /* defined(__minix) */
}

View File

@@ -24,5 +24,5 @@ __eqsf2(float32 a, float32 b)
#else
/* libgcc1.c says !(a == b) */
return !float32_eq(a, b);
#endif
#endif /* defined(__minix) */
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: fpsetmask.c,v 1.4 2008/04/28 20:23:00 martin Exp $ */
/* $NetBSD: fpsetmask.c,v 1.5 2013/01/10 08:16:10 matt Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetmask.c,v 1.4 2008/04/28 20:23:00 martin Exp $");
__RCSID("$NetBSD: fpsetmask.c,v 1.5 2013/01/10 08:16:10 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -50,9 +50,11 @@ __weak_alias(fpsetmask,_fpsetmask)
fp_except
fpsetmask(fp_except mask)
{
fp_except old;
old = float_exception_mask;
#ifdef set_float_exception_mask
return set_float_exception_mask(mask);
#else
const fp_except old = float_exception_mask;
float_exception_mask = mask;
return old;
#endif
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: fpsetround.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */
/* $NetBSD: fpsetround.c,v 1.4 2013/01/10 08:16:10 matt Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetround.c,v 1.3 2008/04/28 20:23:00 martin Exp $");
__RCSID("$NetBSD: fpsetround.c,v 1.4 2013/01/10 08:16:10 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -50,9 +50,11 @@ __weak_alias(fpsetround,_fpsetround)
fp_rnd
fpsetround(fp_rnd rnd_dir)
{
fp_rnd old;
old = float_rounding_mode;
#ifdef set_float_rounding_mode
return set_float_rounding_mode(rnd_dir);
#else
const fp_rnd old = float_rounding_mode;
float_rounding_mode = rnd_dir;
return old;
#endif
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: fpsetsticky.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */
/* $NetBSD: fpsetsticky.c,v 1.4 2013/01/10 08:16:10 matt Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: fpsetsticky.c,v 1.3 2008/04/28 20:23:00 martin Exp $");
__RCSID("$NetBSD: fpsetsticky.c,v 1.4 2013/01/10 08:16:10 matt Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -50,9 +50,11 @@ __weak_alias(fpsetsticky,_fpsetsticky)
fp_except
fpsetsticky(fp_except except)
{
fp_except old;
old = float_exception_flags;
#ifdef set_float_exception_flags
return set_float_exception_flags(except, 1);
#else
const fp_except old = float_exception_flags;
float_exception_flags = except;
return old;
#endif
}

View File

@@ -18,10 +18,11 @@ flag __gedf2(float64, float64);
flag
__gedf2(float64 a, float64 b)
{
#if defined(__minix) && defined(__arm__)
return float64_le(b, a);
#else
/* libgcc1.c says (a >= b) - 1 */
return float64_le(b, a) - 1;
#endif
#endif /* defined(__minix) */
}

View File

@@ -18,10 +18,11 @@ flag __gesf2(float32, float32);
flag
__gesf2(float32 a, float32 b)
{
#if defined(__minix) && defined(__arm__)
return float32_le(b, a);
#else
/* libgcc1.c says (a >= b) - 1 */
return float32_le(b, a) - 1;
#endif
#endif /* defined(__minix) */
}

View File

@@ -24,5 +24,5 @@ __ledf2(float64 a, float64 b)
#else
/* libgcc1.c says 1 - (a <= b) */
return 1 - float64_le(a, b);
#endif
#endif /* defined(__minix) */
}

View File

@@ -24,5 +24,5 @@ __lesf2(float32 a, float32 b)
#else
/* libgcc1.c says 1 - (a <= b) */
return 1 - float32_le(a, b);
#endif
#endif /* defined(__minix) */
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: softfloat-for-gcc.h,v 1.9 2012/08/05 04:27:42 matt Exp $ */
/* $NetBSD: softfloat-for-gcc.h,v 1.12 2013/08/01 23:21:19 matt Exp $ */
/*
* Move private identifiers with external linkage into implementation
@@ -169,6 +169,9 @@
#endif
#ifdef __ARM_EABI__
#ifdef __ARM_PCS_VFP
#include <arm/aeabi.h>
#endif
#define __addsf3 __aeabi_fadd
#define __adddf3 __aeabi_dadd
@@ -208,19 +211,4 @@
#define __extendsfdf2 __aeabi_f2d
#define __truncdfsf2 __aeabi_d2f
#define __eqsf2 __aeabi_fcmpeq
#define __eqdf2 __aeabi_dcmpeq
#define __ltsf2 __aeabi_fcmplt
#define __ltdf2 __aeabi_dcmplt
#define __lesf2 __aeabi_fcmple
#define __ledf2 __aeabi_dcmple
#define __gtsf2 __aeabi_fcmpgt
#define __gtdf2 __aeabi_dcmpgt
#define __gesf2 __aeabi_fcmpge
#define __gedf2 __aeabi_dcmpge
#endif /* __ARM_EABI__ */

View File

@@ -1,4 +1,4 @@
/* $NetBSD: softfloat-specialize,v 1.7 2012/03/21 02:32:26 christos Exp $ */
/* $NetBSD: softfloat-specialize,v 1.8 2013/01/10 08:16:10 matt Exp $ */
/* This is a derivative work. */
@@ -56,16 +56,28 @@ should be simply `float_exception_flags |= flags;'.
-------------------------------------------------------------------------------
*/
#ifdef SOFTFLOAT_FOR_GCC
#ifndef set_float_exception_mask
#define float_exception_mask _softfloat_float_exception_mask
#endif
#endif
#ifndef set_float_exception_mask
fp_except float_exception_mask = 0;
void float_raise( fp_except flags )
#endif
void
float_raise( fp_except flags )
{
siginfo_t info;
fp_except mask = float_exception_mask;
#ifdef set_float_exception_mask
flags |= set_float_exception_flags(flags, 0);
#else
float_exception_flags |= flags;
flags = float_exception_flags;
#endif
if ( flags & float_exception_mask ) {
flags &= mask;
if ( flags ) {
memset(&info, 0, sizeof info);
info.si_signo = SIGFPE;
info.si_pid = getpid();