kernels/linux-2.4.0/arch/arm/nwfpe/softfloat.c
/*
-------------------------------------------------------------------------------
Returns the result of adding the absolute values of the extended double-
precision floating-point values `a' and `b'.  If `zSign' is true, the sum is
negated before being returned.  `zSign' is ignored if the result is a NaN.
The addition is performed according to the IEC/IEEE Standard for Binary
Floating-point Arithmetic.
-------------------------------------------------------------------------------
*/
Returns the result of adding the absolute values of the extended double
precision floating-point values `a' and `b'.  If `zSign' is true, the sum is
negated before being returned.  `zSign' is ignored if the result is a NaN.
The addition is performed according to the IEC/IEEE Standard for Binary
Floating-point Arithmetic.
Returns the result of adding the absolute values of the extended double precision floating - point values ` a ' and ` b ' . If ` zSign ' is true the sum is negated before being returned . ` zSign ' is ignored if the result is a NaN . The addition is performed according to the IEC / IEEE Standard for Binary Floating - point Arithmetic .
static floatx80 addFloatx80Sigs( floatx80 a, floatx80 b, flag zSign )
{
    int32 aExp, bExp, zExp;
    bits64 aSig, bSig, zSig0, zSig1;
    int32 expDiff;
    aSig = extractFloatx80Frac( a );
    aExp = extractFloatx80Exp( a );
    bSig = extractFloatx80Frac( b );
    bExp = extractFloatx80Exp( b );
    expDiff = aExp - bExp;
    if ( 0 < expDiff ) {
        if ( aExp == 0x7FFF ) {
            if ( (bits64) ( aSig<<1 ) ) return propagateFloatx80NaN( a, b );
            return a;
        }
        if ( bExp == 0 ) --expDiff;
        shift64ExtraRightJamming( bSig, 0, expDiff, &bSig, &zSig1 );
        zExp = aExp;
    }
    else if ( expDiff < 0 ) {
        if ( bExp == 0x7FFF ) {
            if ( (bits64) ( bSig<<1 ) ) return propagateFloatx80NaN( a, b );
            return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
        }
        if ( aExp == 0 ) ++expDiff;
        shift64ExtraRightJamming( aSig, 0, - expDiff, &aSig, &zSig1 );
        zExp = bExp;
    }
    else {
        if ( aExp == 0x7FFF ) {
            if ( (bits64) ( ( aSig | bSig )<<1 ) ) {
                return propagateFloatx80NaN( a, b );
            }
            return a;
        }
        zSig1 = 0;
        zSig0 = aSig + bSig;
        if ( aExp == 0 ) {
            normalizeFloatx80Subnormal( zSig0, &zExp, &zSig0 );
            goto roundAndPack;
        }
        zExp = aExp;
        goto shiftRight1;
    }
    zSig0 = aSig + bSig;
    if ( (sbits64) zSig0 < 0 ) goto roundAndPack; 
 shiftRight1:
    shift64ExtraRightJamming( zSig0, zSig1, 1, &zSig0, &zSig1 );
    zSig0 |= LIT64( 0x8000000000000000 );
    ++zExp;
 roundAndPack:
    return
        roundAndPackFloatx80(
            floatx80_rounding_precision, zSign, zExp, zSig0, zSig1 );
}
static floatx80 addFloatx80Sigs ( floatx80 a , floatx80 b , flag zSign ) { int32 aExp , bExp , zExp ; bits64 aSig , bSig , zSig0 , zSig1 ; int32 expDiff ; aSig = extractFloatx80Frac ( a ) ; aExp = extractFloatx80Exp ( a ) ; bSig = extractFloatx80Frac ( b ) ; bExp = extractFloatx80Exp ( b ) ; expDiff = aExp - bExp ; if ( 0 < expDiff ) { if ( aExp == 0x7FFF ) { if ( ( bits64 ) ( aSig << 1 ) ) return propagateFloatx80NaN ( a , b ) ; return a ; } if ( bExp == 0 ) -- expDiff ; shift64ExtraRightJamming ( bSig , 0 , expDiff , & bSig , & zSig1 ) ; zExp = aExp ; } else if ( expDiff < 0 ) { if ( bExp == 0x7FFF ) { if ( ( bits64 ) ( bSig << 1 ) ) return propagateFloatx80NaN ( a , b ) ; return packFloatx80 ( zSign , 0x7FFF , LIT64 ( 0x8000000000000000 ) ) ; } if ( aExp == 0 ) ++ expDiff ; shift64ExtraRightJamming ( aSig , 0 , - expDiff , & aSig , & zSig1 ) ; zExp = bExp ; } else { if ( aExp == 0x7FFF ) { if ( ( bits64 ) ( ( aSig | bSig ) << 1 ) ) { return propagateFloatx80NaN ( a , b ) ; } return a ; } zSig1 = 0 ; zSig0 = aSig + bSig ; if ( aExp == 0 ) { normalizeFloatx80Subnormal ( zSig0 , & zExp , & zSig0 ) ; goto roundAndPack ; } zExp = aExp ; goto shiftRight1 ; } zSig0 = aSig + bSig ; if ( ( sbits64 ) zSig0 < 0 ) goto roundAndPack ; shiftRight1 : shift64ExtraRightJamming ( zSig0 , zSig1 , 1 , & zSig0 , & zSig1 ) ; zSig0 |= LIT64 ( 0x8000000000000000 ) ; ++ zExp ; roundAndPack : return roundAndPackFloatx80 ( floatx80_rounding_precision , zSign , zExp , zSig0 , zSig1 ) ; }
Returns the result of adding the absolute values of the extended double
precision floating-point values `a' and `b'.
Returns the result of adding the absolute values of the extended double precision floating - point values ` a ' and ` b ' .