Libraries updates and cleanup
* Updating common/lib * Updating lib/csu * Updating lib/libc * Updating libexec/ld.elf_so * Corrected test on __minix in featuretest to actually follow the meaning of the comment. * Cleaned up _REENTRANT-related defintions. * Disabled -D_REENTRANT for libfetch * Removing some unneeded __NBSD_LIBC defines and tests Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: softfloat-specialize,v 1.4 2004/09/26 21:13:27 jmmv Exp $ */
|
||||
/* $NetBSD: softfloat-specialize,v 1.7 2012/03/21 02:32:26 christos Exp $ */
|
||||
|
||||
/* This is a derivative work. */
|
||||
|
||||
@@ -33,6 +33,8 @@ this code that are retained.
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/*
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -53,16 +55,35 @@ substitute a result value. If traps are not implemented, this routine
|
||||
should be simply `float_exception_flags |= flags;'.
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
#ifdef SOFTFLOAT_FOR_GCC
|
||||
#define float_exception_mask _softfloat_float_exception_mask
|
||||
#endif
|
||||
fp_except float_exception_mask = 0;
|
||||
void float_raise( fp_except flags )
|
||||
{
|
||||
siginfo_t info;
|
||||
|
||||
float_exception_flags |= flags;
|
||||
|
||||
if ( flags & float_exception_mask ) {
|
||||
raise( SIGFPE );
|
||||
memset(&info, 0, sizeof info);
|
||||
info.si_signo = SIGFPE;
|
||||
info.si_pid = getpid();
|
||||
info.si_uid = geteuid();
|
||||
if (flags & float_flag_underflow)
|
||||
info.si_code = FPE_FLTUND;
|
||||
else if (flags & float_flag_overflow)
|
||||
info.si_code = FPE_FLTOVF;
|
||||
else if (flags & float_flag_divbyzero)
|
||||
info.si_code = FPE_FLTDIV;
|
||||
else if (flags & float_flag_invalid)
|
||||
info.si_code = FPE_FLTINV;
|
||||
else if (flags & float_flag_inexact)
|
||||
info.si_code = FPE_FLTRES;
|
||||
sigqueueinfo(getpid(), &info);
|
||||
}
|
||||
}
|
||||
#undef float_exception_mask
|
||||
|
||||
/*
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -93,7 +114,7 @@ static
|
||||
flag float32_is_nan( float32 a )
|
||||
{
|
||||
|
||||
return ( 0xFF000000 < (bits32) ( a<<1 ) );
|
||||
return ( (bits32)0xFF000000 < (bits32) ( a<<1 ) );
|
||||
|
||||
}
|
||||
|
||||
@@ -142,7 +163,7 @@ precision floating-point format.
|
||||
static float32 commonNaNToFloat32( commonNaNT a )
|
||||
{
|
||||
|
||||
return ( ( (bits32) a.sign )<<31 ) | 0x7FC00000 | ( a.high>>41 );
|
||||
return ( ( (bits32) a.sign )<<31 ) | 0x7FC00000 | (bits32)( a.high>>41 );
|
||||
|
||||
}
|
||||
|
||||
@@ -192,7 +213,7 @@ static
|
||||
flag float64_is_nan( float64 a )
|
||||
{
|
||||
|
||||
return ( LIT64( 0xFFE0000000000000 ) <
|
||||
return ( (bits64)LIT64( 0xFFE0000000000000 ) <
|
||||
(bits64) ( FLOAT64_DEMANGLE(a)<<1 ) );
|
||||
|
||||
}
|
||||
@@ -228,7 +249,7 @@ static commonNaNT float64ToCommonNaN( float64 a )
|
||||
commonNaNT z;
|
||||
|
||||
if ( float64_is_signaling_nan( a ) ) float_raise( float_flag_invalid );
|
||||
z.sign = FLOAT64_DEMANGLE(a)>>63;
|
||||
z.sign = (flag)(FLOAT64_DEMANGLE(a)>>63);
|
||||
z.low = 0;
|
||||
z.high = FLOAT64_DEMANGLE(a)<<12;
|
||||
return z;
|
||||
@@ -406,7 +427,7 @@ flag float128_is_nan( float128 a )
|
||||
{
|
||||
|
||||
return
|
||||
( LIT64( 0xFFFE000000000000 ) <= (bits64) ( a.high<<1 ) )
|
||||
( (bits64)LIT64( 0xFFFE000000000000 ) <= (bits64) ( a.high<<1 ) )
|
||||
&& ( a.low || ( a.high & LIT64( 0x0000FFFFFFFFFFFF ) ) );
|
||||
|
||||
}
|
||||
@@ -438,7 +459,7 @@ static commonNaNT float128ToCommonNaN( float128 a )
|
||||
commonNaNT z;
|
||||
|
||||
if ( float128_is_signaling_nan( a ) ) float_raise( float_flag_invalid );
|
||||
z.sign = a.high>>63;
|
||||
z.sign = (flag)(a.high>>63);
|
||||
shortShift128Left( a.high, a.low, 16, &z.high, &z.low );
|
||||
return z;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user