Changeset f1f95f2 in mainline for softfloat/generic/div.c


Ignore:
Timestamp:
2006-02-13T23:06:04Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d9f51ccc
Parents:
d3ca210
Message:

Fixed bugs in 64bit float division.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • softfloat/generic/div.c

    rd3ca210 rf1f95f2  
    192192{
    193193        float64 result;
    194         __s32 aexp, bexp, cexp;
     194        __s64 aexp, bexp, cexp;
    195195        __u64 afrac, bfrac, cfrac;
    196196        __u64 remlo, remhi;
     
    199199       
    200200        if (isFloat64NaN(a)) {
     201               
     202                if (isFloat64SigNaN(b)) {
     203                        /*FIXME: SigNaN*/
     204                        return b;
     205                }
     206               
    201207                if (isFloat64SigNaN(a)) {
    202208                        /*FIXME: SigNaN*/
     
    215221       
    216222        if (isFloat64Infinity(a)) {
    217                 if (isFloat64Infinity(b)) {
     223                if (isFloat64Infinity(b) || isFloat64Zero(b)) {
    218224                        /*FIXME: inf / inf */
    219225                        result.binary = FLOAT64_NAN;
     
    260266        if (aexp == 0) {
    261267                if (afrac == 0) {
    262                 result.parts.exp = 0;
    263                 result.parts.fraction = 0;
    264                 return result;
     268                        result.parts.exp = 0;
     269                        result.parts.fraction = 0;
     270                        return result;
    265271                }
    266272                /* normalize it*/
    267273               
    268                 afrac <<= 1;
     274                aexp++;
    269275                        /* afrac is nonzero => it must stop */ 
    270276                while (! (afrac & FLOAT64_HIDDEN_BIT_MASK) ) {
     
    275281
    276282        if (bexp == 0) {
    277                 bfrac <<= 1;
     283                bexp++;
    278284                        /* bfrac is nonzero => it must stop */ 
    279285                while (! (bfrac & FLOAT64_HIDDEN_BIT_MASK) ) {
Note: See TracChangeset for help on using the changeset viewer.