release/src/linux/linux/arch/arm/nwfpe/softfloat.c
/*
-------------------------------------------------------------------------------
Returns the result of converting the single-precision floating-point value
`a' to the 32-bit two's complement integer format.  The conversion is
performed according to the IEC/IEEE Standard for Binary Floating-point
Arithmetic---which means in particular that the conversion is rounded
according to the current rounding mode.  If `a' is a NaN, the largest
positive integer is returned.  Otherwise, if the conversion overflows, the
largest integer with the same sign as `a' is returned.
-------------------------------------------------------------------------------
*/
Returns the result of converting the single-precision floating-point value
`a' to the 32-bit two's complement integer format.  The conversion is
performed according to the IEC/IEEE Standard for Binary Floating-point
Arithmetic---which means in particular that the conversion is rounded
according to the current rounding mode.  If `a' is a NaN, the largest
positive integer is returned.  Otherwise, if the conversion overflows, the
largest integer with the same sign as `a' is returned.
Returns the result of converting the single - precision floating - point value ` a ' to the 32 - bit two ' s complement integer format . The conversion is performed according to the IEC / IEEE Standard for Binary Floating - point Arithmetic --- which means in particular that the conversion is rounded according to the current rounding mode . If ` a ' is a NaN the largest positive integer is returned . Otherwise if the conversion overflows the largest integer with the same sign as ` a ' is returned .
int32 float32_to_int32( float32 a )
{
    flag aSign;
    int16 aExp, shiftCount;
    bits32 aSig;
    bits64 zSig;
    aSig = extractFloat32Frac( a );
    aExp = extractFloat32Exp( a );
    aSign = extractFloat32Sign( a );
    if ( ( aExp == 0x7FF ) && aSig ) aSign = 0;
    if ( aExp ) aSig |= 0x00800000;
    shiftCount = 0xAF - aExp;
    zSig = aSig;
    zSig <<= 32;
    if ( 0 < shiftCount ) shift64RightJamming( zSig, shiftCount, &zSig );
    return roundAndPackInt32( aSign, zSig );
}
int32 float32_to_int32 ( float32 a ) { flag aSign ; int16 aExp , shiftCount ; bits32 aSig ; bits64 zSig ; aSig = extractFloat32Frac ( a ) ; aExp = extractFloat32Exp ( a ) ; aSign = extractFloat32Sign ( a ) ; if ( ( aExp == 0x7FF ) && aSig ) aSign = 0 ; if ( aExp ) aSig |= 0x00800000 ; shiftCount = 0xAF - aExp ; zSig = aSig ; zSig <<= 32 ; if ( 0 < shiftCount ) shift64RightJamming ( zSig , shiftCount , & zSig ) ; return roundAndPackInt32 ( aSign , zSig ) ; }
Returns the result of converting the single-precision floating-point value
`a' to the 32-bit two's complement integer format.
Returns the result of converting the single - precision floating - point value ` a ' to the 32 - bit two ' s complement integer format .