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


Ignore:
Timestamp:
2012-11-06T21:03:44Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
338810f
Parents:
de73242 (diff), 94795812 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 moved

Legend:

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

    rde73242 refdfebc  
    3434 */
    3535
    36 #include <sftypes.h>
    37 #include <add.h>
    38 #include <comparison.h>
    39 #include <common.h>
     36#include "sftypes.h"
     37#include "add.h"
     38#include "comparison.h"
     39#include "common.h"
    4040
    4141/** Add two single-precision floats with the same sign.
     
    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.