Changeset 7e557805 in mainline for softfloat/generic/comparison.c


Ignore:
Timestamp:
2005-12-20T12:48:15Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e649dfa
Parents:
b5440cf
Message:

Some new functions implemented in softfloat lib.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • softfloat/generic/comparison.c

    rb5440cf r7e557805  
    4040};
    4141
     42inline int isFloat32Infinity(float32 f)
     43{
     44        return ((f.parts.exp==0xFF)&&(f.parts.mantisa==0x0));
     45};
     46
     47/**
     48 * @return 1, if both floats are equal - but NaNs are not recognized
     49 */
     50inline int isFloat32eq(float32 a, float32 b)
     51{
     52        return ((a==b)||(((a.binary| b.binary)&0x7FFFFFFF)==0)); /* a equals to b or both are zeros (with any sign) */
     53}
     54
     55/**
     56 * @return 1, if a>b - but NaNs are not recognized
     57 */
     58inline int isFloat32lt(float32 a, float32 b)
     59{
     60        if (((a.binary| b.binary)&0x7FFFFFFF)==0) {
     61                return 0;
     62        };
     63        a.parts.sign^=a.parts.sign;
     64        b.parts.sign^=b.parts.sign;
     65        return (a.binary<b.binary);
     66                       
     67}
     68
     69
Note: See TracChangeset for help on using the changeset viewer.