kernels/linux-2.4.0/arch/arm/nwfpe/softfloat.c
/*
-------------------------------------------------------------------------------
Returns the result of dividing the single-precision floating-point value `a'
by the corresponding value `b'.  The operation is performed according to the
IEC/IEEE Standard for Binary Floating-point Arithmetic.
-------------------------------------------------------------------------------
*/
Returns the result of dividing the single-precision floating-point value `a'
by the corresponding value `b'.  The operation is performed according to the
IEC/IEEE Standard for Binary Floating-point Arithmetic.
Returns the result of dividing the single - precision floating - point value ` a ' by the corresponding value ` b ' . The operation is performed according to the IEC / IEEE Standard for Binary Floating - point Arithmetic .
float32 float32_div( float32 a, float32 b )
{
    flag aSign, bSign, zSign;
    int16 aExp, bExp, zExp;
    bits32 aSig, bSig, zSig;
    aSig = extractFloat32Frac( a );
    aExp = extractFloat32Exp( a );
    aSign = extractFloat32Sign( a );
    bSig = extractFloat32Frac( b );
    bExp = extractFloat32Exp( b );
    bSign = extractFloat32Sign( b );
    zSign = aSign ^ bSign;
    if ( aExp == 0xFF ) {
        if ( aSig ) return propagateFloat32NaN( a, b );
        if ( bExp == 0xFF ) {
            if ( bSig ) return propagateFloat32NaN( a, b );
            float_raise( float_flag_invalid );
            return float32_default_nan;
        }
        return packFloat32( zSign, 0xFF, 0 );
    }
    if ( bExp == 0xFF ) {
        if ( bSig ) return propagateFloat32NaN( a, b );
        return packFloat32( zSign, 0, 0 );
    }
    if ( bExp == 0 ) {
        if ( bSig == 0 ) {
            if ( ( aExp | aSig ) == 0 ) {
                float_raise( float_flag_invalid );
                return float32_default_nan;
            }
            float_raise( float_flag_divbyzero );
            return packFloat32( zSign, 0xFF, 0 );
        }
        normalizeFloat32Subnormal( bSig, &bExp, &bSig );
    }
    if ( aExp == 0 ) {
        if ( aSig == 0 ) return packFloat32( zSign, 0, 0 );
        normalizeFloat32Subnormal( aSig, &aExp, &aSig );
    }
    zExp = aExp - bExp + 0x7D;
    aSig = ( aSig | 0x00800000 )<<7;
    bSig = ( bSig | 0x00800000 )<<8;
    if ( bSig <= ( aSig + aSig ) ) {
        aSig >>= 1;
        ++zExp;
    }
    zSig = ( ( (bits64) aSig )<<32 ) / bSig;
    if ( ( zSig & 0x3F ) == 0 ) {
        zSig |= ( ( (bits64) bSig ) * zSig != ( (bits64) aSig )<<32 );
    }
    return roundAndPackFloat32( zSign, zExp, zSig );
}
float32 float32_div ( float32 a , float32 b ) { flag aSign , bSign , zSign ; int16 aExp , bExp , zExp ; bits32 aSig , bSig , zSig ; aSig = extractFloat32Frac ( a ) ; aExp = extractFloat32Exp ( a ) ; aSign = extractFloat32Sign ( a ) ; bSig = extractFloat32Frac ( b ) ; bExp = extractFloat32Exp ( b ) ; bSign = extractFloat32Sign ( b ) ; zSign = aSign ^ bSign ; if ( aExp == 0xFF ) { if ( aSig ) return propagateFloat32NaN ( a , b ) ; if ( bExp == 0xFF ) { if ( bSig ) return propagateFloat32NaN ( a , b ) ; float_raise ( float_flag_invalid ) ; return float32_default_nan ; } return packFloat32 ( zSign , 0xFF , 0 ) ; } if ( bExp == 0xFF ) { if ( bSig ) return propagateFloat32NaN ( a , b ) ; return packFloat32 ( zSign , 0 , 0 ) ; } if ( bExp == 0 ) { if ( bSig == 0 ) { if ( ( aExp | aSig ) == 0 ) { float_raise ( float_flag_invalid ) ; return float32_default_nan ; } float_raise ( float_flag_divbyzero ) ; return packFloat32 ( zSign , 0xFF , 0 ) ; } normalizeFloat32Subnormal ( bSig , & bExp , & bSig ) ; } if ( aExp == 0 ) { if ( aSig == 0 ) return packFloat32 ( zSign , 0 , 0 ) ; normalizeFloat32Subnormal ( aSig , & aExp , & aSig ) ; } zExp = aExp - bExp + 0x7D ; aSig = ( aSig | 0x00800000 ) << 7 ; bSig = ( bSig | 0x00800000 ) << 8 ; if ( bSig <= ( aSig + aSig ) ) { aSig >>= 1 ; ++ zExp ; } zSig = ( ( ( bits64 ) aSig ) << 32 ) / bSig ; if ( ( zSig & 0x3F ) == 0 ) { zSig |= ( ( ( bits64 ) bSig ) * zSig != ( ( bits64 ) aSig ) << 32 ) ; } return roundAndPackFloat32 ( zSign , zExp , zSig ) ; }
Returns the result of dividing the single-precision floating-point value `a'
by the corresponding value `b'.
Returns the result of dividing the single - precision floating - point value ` a ' by the corresponding value ` b ' .