Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/softfloat/common.c

    ra35b458 r1b20da0  
    7878                /* TODO: fix underflow */
    7979        }
    80 
     80       
    8181        if ((cexp < 0) || (cexp == 0 &&
    8282            (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1)))))) {
     
    8787                        return result;
    8888                }
    89 
     89               
    9090                while (cexp < 0) {
    9191                        cexp++;
    9292                        cfrac >>= 1;
    9393                }
    94 
     94       
    9595                cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3));
    96 
     96               
    9797                if (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1)))) {
    9898                        result.parts.fraction =
     
    103103                cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3));
    104104        }
    105 
     105       
    106106        ++cexp;
    107107
     
    120120
    121121        result.parts.exp = (uint32_t) cexp;
    122 
     122       
    123123        result.parts.fraction =
    124124            ((cfrac >> (64 - FLOAT64_FRACTION_SIZE - 2)) & (~FLOAT64_HIDDEN_BIT_MASK));
    125 
     125       
    126126        return result;
    127127}
     
    289289        /* rounding - if first bit after fraction is set then round up */
    290290        (*fraction) += (0x1 << (32 - FLOAT32_FRACTION_SIZE - 3));
    291 
     291       
    292292        if ((*fraction) &
    293293            (FLOAT32_HIDDEN_BIT_MASK << (32 - FLOAT32_FRACTION_SIZE - 1))) {
     
    296296                (*fraction) >>= 1;
    297297        }
    298 
     298       
    299299        if (((*exp) >= FLOAT32_MAX_EXPONENT) || ((*exp) < 0)) {
    300300                /* overflow - set infinity as result */
     
    322322         */
    323323        (*fraction) += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3));
    324 
     324       
    325325        /* See if there was a carry to bit 63. */
    326326        if ((*fraction) &
     
    330330                (*fraction) >>= 1;
    331331        }
    332 
     332       
    333333        if (((*exp) >= FLOAT64_MAX_EXPONENT) || ((*exp) < 0)) {
    334334                /* overflow - set infinity as result */
     
    677677        mul64(b, result, &tmp_hi, &tmp_lo);
    678678        sub128(a_hi, a_lo, tmp_hi, tmp_lo, &rem_hi, &rem_lo);
    679 
     679       
    680680        while ((int64_t) rem_hi < 0) {
    681681                result -= 0x1ll << 32;
Note: See TracChangeset for help on using the changeset viewer.