Changeset faa45c17 in mainline for uspace/lib/softfloat/add.c


Ignore:
Timestamp:
2012-10-04T22:14:00Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
be1dcc26
Parents:
466e95f7
Message:

Fix a wrong index in softfloat1 test and a couple of cstyle softfloat fixes.

File:
1 edited

Legend:

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

    r466e95f7 rfaa45c17  
    9090                /* both are denormalized */
    9191                frac1 += frac2;
    92                 if (frac1 & FLOAT32_HIDDEN_BIT_MASK ) {
     92                if (frac1 & FLOAT32_HIDDEN_BIT_MASK) {
    9393                        /* result is not denormalized */
    9494                        a.parts.exp = 1;
     
    112112        frac2 <<= 6;
    113113       
    114         if (expdiff < (FLOAT32_FRACTION_SIZE + 2) ) {
     114        if (expdiff < (FLOAT32_FRACTION_SIZE + 2)) {
    115115                frac2 >>= expdiff;
    116116                frac1 += frac2;
     
    121121        }
    122122       
    123         if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7) ) {
     123        if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) {
    124124                ++exp1;
    125125                frac1 >>= 1;
     
    135135        }
    136136       
    137         if ((exp1 == FLOAT32_MAX_EXPONENT ) || (exp2 > exp1)) {
     137        if ((exp1 == FLOAT32_MAX_EXPONENT) || (exp2 > exp1)) {
    138138                /* overflow - set infinity as result */
    139139                a.parts.exp = FLOAT32_MAX_EXPONENT;
     
    250250        }
    251251       
    252         if ((exp1 == FLOAT64_MAX_EXPONENT ) || (exp2 > exp1)) {
     252        if ((exp1 == FLOAT64_MAX_EXPONENT) || (exp2 > exp1)) {
    253253                /* overflow - set infinity as result */
    254254                a.parts.exp = FLOAT64_MAX_EXPONENT;
     
    259259        a.parts.exp = exp1;
    260260        /* Clear hidden bit and shift */
    261         a.parts.fraction = ((frac1 >> 6 ) & (~FLOAT64_HIDDEN_BIT_MASK));
     261        a.parts.fraction = ((frac1 >> 6) & (~FLOAT64_HIDDEN_BIT_MASK));
    262262        return a;
    263263}
Note: See TracChangeset for help on using the changeset viewer.