Changeset 1266543 in mainline for softfloat/generic/comparison.c


Ignore:
Timestamp:
2006-02-07T00:41:18Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1a030b8
Parents:
b7e65d4
Message:

32 bit float division added.
Some small bugs fixed.
Code cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified softfloat/generic/comparison.c

    rb7e65d4 r1266543  
    3131
    3232inline int isFloat32NaN(float32 f)
    33 {       /* NaN : exp = 0xff and nonzero mantisa */
    34         return ((f.parts.exp==0xFF)&&(f.parts.mantisa));
     33{       /* NaN : exp = 0xff and nonzero fraction */
     34        return ((f.parts.exp==0xFF)&&(f.parts.fraction));
    3535};
    3636
    3737inline int isFloat64NaN(float64 d)
    38 {       /* NaN : exp = 0x7ff and nonzero mantisa */
    39         return ((d.parts.exp==0x7FF)&&(d.parts.mantisa));
     38{       /* NaN : exp = 0x7ff and nonzero fraction */
     39        return ((d.parts.exp==0x7FF)&&(d.parts.fraction));
    4040};
    4141
    4242inline int isFloat32SigNaN(float32 f)
    43 {       /* SigNaN : exp = 0xff mantisa = 0xxxxx..x (binary), where at least one x is nonzero */
    44         return ((f.parts.exp==0xFF)&&(f.parts.mantisa<0x400000)&&(f.parts.mantisa));
     43{       /* SigNaN : exp = 0xff fraction = 0xxxxx..x (binary), where at least one x is nonzero */
     44        return ((f.parts.exp==0xFF)&&(f.parts.fraction<0x400000)&&(f.parts.fraction));
    4545};
    4646
    4747inline int isFloat64SigNaN(float64 d)
    48 {       /* SigNaN : exp = 0x7ff mantisa = 0xxxxx..x (binary), where at least one x is nonzero */
    49         return ((d.parts.exp==0x7FF)&&(d.parts.mantisa)&&(d.parts.mantisa<0x8000000000000ll));
     48{       /* SigNaN : exp = 0x7ff fraction = 0xxxxx..x (binary), where at least one x is nonzero */
     49        return ((d.parts.exp==0x7FF)&&(d.parts.fraction)&&(d.parts.fraction<0x8000000000000ll));
    5050};
    5151
    5252inline int isFloat32Infinity(float32 f)
    5353{
    54         return ((f.parts.exp==0xFF)&&(f.parts.mantisa==0x0));
     54        return ((f.parts.exp==0xFF)&&(f.parts.fraction==0x0));
    5555};
    5656
    5757inline int isFloat64Infinity(float64 d)
    5858{
    59         return ((d.parts.exp==0x7FF)&&(d.parts.mantisa==0x0));
     59        return ((d.parts.exp==0x7FF)&&(d.parts.fraction==0x0));
    6060};
    6161
Note: See TracChangeset for help on using the changeset viewer.