Changeset 1b20da0 in mainline for uspace/lib/softfloat


Ignore:
Timestamp:
2018-02-28T17:52:03Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3061bc1
Parents:
df6ded8
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
Message:

style: Remove trailing whitespace on non-empty lines, in certain file types.

Command used: tools/srepl '\([^[:space:]]\)\s\+$' '\1' -- *.c *.h *.py *.sh *.s *.S *.ag

Location:
uspace/lib/softfloat
Files:
6 edited

Legend:

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

    rdf6ded8 r1b20da0  
    6060                }
    6161               
    62                 if (b.parts.exp == FLOAT32_MAX_EXPONENT) { 
     62                if (b.parts.exp == FLOAT32_MAX_EXPONENT) {
    6363                        return b;
    6464                }
     
    7777                }
    7878               
    79                 if (a.parts.exp == FLOAT32_MAX_EXPONENT) { 
     79                if (a.parts.exp == FLOAT32_MAX_EXPONENT) {
    8080                        return a;
    8181                }
     
    105105        } else {
    106106                /* add hidden bit to second operand */
    107                 frac2 |= FLOAT32_HIDDEN_BIT_MASK; 
     107                frac2 |= FLOAT32_HIDDEN_BIT_MASK;
    108108        }
    109109       
     
    129129        frac1 += (0x1 << 5);
    130130       
    131         if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) { 
     131        if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) {
    132132                /* rounding overflow */
    133133                ++exp1;
     
    145145       
    146146        /* Clear hidden bit and shift */
    147         a.parts.fraction = ((frac1 >> 6) & (~FLOAT32_HIDDEN_BIT_MASK)); 
     147        a.parts.fraction = ((frac1 >> 6) & (~FLOAT32_HIDDEN_BIT_MASK));
    148148        return a;
    149149}
     
    190190               
    191191                /* a is infinity and b not */
    192                 if (a.parts.exp == FLOAT64_MAX_EXPONENT) { 
     192                if (a.parts.exp == FLOAT64_MAX_EXPONENT) {
    193193                        return a;
    194194                }
     
    203203                /* both are denormalized */
    204204                frac1 += frac2;
    205                 if (frac1 & FLOAT64_HIDDEN_BIT_MASK) { 
     205                if (frac1 & FLOAT64_HIDDEN_BIT_MASK) {
    206206                        /* result is not denormalized */
    207207                        a.parts.exp = 1;
     
    217217        if (exp2 == 0) {
    218218                /* ... is denormalized */
    219                 --expdiff;     
     219                --expdiff;
    220220        } else {
    221221                /* is not denormalized */
     
    242242       
    243243        /* rounding - if first bit after fraction is set then round up */
    244         frac1 += (0x1 << 5); 
    245        
    246         if (frac1 & (FLOAT64_HIDDEN_BIT_MASK << 7)) { 
     244        frac1 += (0x1 << 5);
     245       
     246        if (frac1 & (FLOAT64_HIDDEN_BIT_MASK << 7)) {
    247247                /* rounding overflow */
    248248                ++exp1;
  • uspace/lib/softfloat/common.c

    rdf6ded8 r1b20da0  
    5959 * Take fraction shifted by 10 bits to the left, round it, normalize it
    6060 * and detect exceptions
    61  * 
     61 *
    6262 * @param cexp Exponent with bias.
    6363 * @param cfrac Fraction shifted 10 bits to the left with added hidden bit.
     
    9393                }
    9494       
    95                 cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3)); 
     95                cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3));
    9696               
    9797                if (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1)))) {
     
    9999                            ((cfrac >> (64 - FLOAT64_FRACTION_SIZE - 2)) & (~FLOAT64_HIDDEN_BIT_MASK));
    100100                        return result;
    101                 }       
     101                }
    102102        } else {
    103                 cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3)); 
     103                cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3));
    104104        }
    105105       
     
    121121        result.parts.exp = (uint32_t) cexp;
    122122       
    123         result.parts.fraction = 
     123        result.parts.fraction =
    124124            ((cfrac >> (64 - FLOAT64_FRACTION_SIZE - 2)) & (~FLOAT64_HIDDEN_BIT_MASK));
    125125       
    126         return result; 
     126        return result;
    127127}
    128128
    129129/**
    130130 * Take fraction, round it, normalize it and detect exceptions
    131  * 
     131 *
    132132 * @param cexp Exponent with bias.
    133133 * @param cfrac_hi High part of the fraction shifted 14 bits to the left
     
    139139 * @return Finished quadruple-precision float.
    140140 */
    141 float128 finish_float128(int32_t cexp, uint64_t cfrac_hi, uint64_t cfrac_lo, 
     141float128 finish_float128(int32_t cexp, uint64_t cfrac_hi, uint64_t cfrac_lo,
    142142    char sign, uint64_t shift_out)
    143143{
     
    228228        result.parts.frac_lo = tmp_lo;
    229229
    230         return result; 
     230        return result;
    231231}
    232232
     
    242242}
    243243
    244 /** 
     244/**
    245245 * Counts leading zeroes in 32bit unsigned integer.
    246246 *
     
    290290        (*fraction) += (0x1 << (32 - FLOAT32_FRACTION_SIZE - 3));
    291291       
    292         if ((*fraction) & 
     292        if ((*fraction) &
    293293            (FLOAT32_HIDDEN_BIT_MASK << (32 - FLOAT32_FRACTION_SIZE - 1))) {
    294294                /* rounding overflow */
     
    324324       
    325325        /* See if there was a carry to bit 63. */
    326         if ((*fraction) & 
     326        if ((*fraction) &
    327327            (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1))) {
    328328                /* rounding overflow */
     
    589589/**
    590590 * Multiplication of two 64-bit unsigned integers.
    591  * 
     591 *
    592592 * @param a First input operand.
    593593 * @param b Second input operand.
     
    622622/**
    623623 * Multiplication of two 128-bit unsigned integers.
    624  * 
     624 *
    625625 * @param a_hi High part of the first input operand.
    626626 * @param a_lo Low part of the first input operand.
     
    656656 * Estimate the quotient of 128-bit unsigned divident and 64-bit unsigned
    657657 * divisor.
    658  * 
     658 *
    659659 * @param a_hi High part of the divident.
    660660 * @param a_lo Low part of the divident.
  • uspace/lib/softfloat/comparison.c

    rdf6ded8 r1b20da0  
    257257 * @return 1 if a is lower than b, 0 otherwise.
    258258 */
    259 int is_float32_lt(float32 a, float32 b) 
     259int is_float32_lt(float32 a, float32 b)
    260260{
    261261        if (((a.bin | b.bin) & 0x7FFFFFFF) == 0) {
     
    351351 * @return 1 if a is greater than b, 0 otherwise.
    352352 */
    353 int is_float32_gt(float32 a, float32 b) 
     353int is_float32_gt(float32 a, float32 b)
    354354{
    355355        if (((a.bin | b.bin) & 0x7FFFFFFF) == 0) {
  • uspace/lib/softfloat/conversion.c

    rdf6ded8 r1b20da0  
    225225                /* denormalized */
    226226               
    227                 frac = a.parts.fraction; 
     227                frac = a.parts.fraction;
    228228                frac |= FLOAT64_HIDDEN_BIT_MASK; /* denormalize and set hidden bit */
    229229               
     
    420420        frac |= FLOAT32_HIDDEN_BIT_MASK;
    421421        /* shift fraction to left so hidden bit will be the most significant bit */
    422         frac <<= 32 - FLOAT32_FRACTION_SIZE - 1; 
     422        frac <<= 32 - FLOAT32_FRACTION_SIZE - 1;
    423423       
    424424        frac >>= 32 - (a.parts.exp - FLOAT32_BIAS) - 1;
     
    606606
    607607/*
    608  * FIXME: Im not sure what to return if overflow/underflow happens 
     608 * FIXME: Im not sure what to return if overflow/underflow happens
    609609 *  - now its the biggest or the smallest int
    610610 */
     
    625625
    626626/*
    627  * FIXME: Im not sure what to return if overflow/underflow happens 
     627 * FIXME: Im not sure what to return if overflow/underflow happens
    628628 *  - now its the biggest or the smallest int
    629629 */
  • uspace/lib/softfloat/div.c

    rdf6ded8 r1b20da0  
    151151       
    152152        cfrac = (afrac << 32) / bfrac;
    153         if ((cfrac & 0x3F) == 0) { 
     153        if ((cfrac & 0x3F) == 0) {
    154154                cfrac |= (bfrac * cfrac != afrac << 32);
    155155        }
     
    195195        }
    196196       
    197         result.parts.fraction = ((cfrac >> 6) & (~FLOAT32_HIDDEN_BIT_MASK)); 
     197        result.parts.fraction = ((cfrac >> 6) & (~FLOAT32_HIDDEN_BIT_MASK));
    198198       
    199199        return result;
     
    208208 *
    209209 */
    210 float64 div_float64(float64 a, float64 b) 
     210float64 div_float64(float64 a, float64 b)
    211211{
    212212        float64 result;
    213213        int64_t aexp, bexp, cexp;
    214         uint64_t afrac, bfrac, cfrac; 
     214        uint64_t afrac, bfrac, cfrac;
    215215        uint64_t remlo, remhi;
    216216        uint64_t tmplo, tmphi;
     
    291291                /* normalize it*/
    292292                aexp++;
    293                 /* afrac is nonzero => it must stop */ 
     293                /* afrac is nonzero => it must stop */
    294294                while (!(afrac & FLOAT64_HIDDEN_BIT_MASK)) {
    295295                        afrac <<= 1;
     
    300300        if (bexp == 0) {
    301301                bexp++;
    302                 /* bfrac is nonzero => it must stop */ 
     302                /* bfrac is nonzero => it must stop */
    303303                while (!(bfrac & FLOAT64_HIDDEN_BIT_MASK)) {
    304304                        bfrac <<= 1;
     
    315315        }
    316316       
    317         cexp = aexp - bexp + FLOAT64_BIAS - 2; 
     317        cexp = aexp - bexp + FLOAT64_BIAS - 2;
    318318       
    319319        cfrac = div128est(afrac, 0x0ll, bfrac);
  • uspace/lib/softfloat/mul.c

    rdf6ded8 r1b20da0  
    181181        }
    182182       
    183         result.parts.exp = exp; 
     183        result.parts.exp = exp;
    184184        result.parts.fraction = frac1 & ((1 << FLOAT32_FRACTION_SIZE) - 1);
    185185       
Note: See TracChangeset for help on using the changeset viewer.