Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
cnv_float.h File Reference

Go to the source code of this file.

Macros

#define SGL_FX_MAX_EXP   30
 
#define DBL_FX_MAX_EXP   62
 
#define QUAD_FX_MAX_EXP   126
 
#define Dintp1(object)   (object)
 
#define Dintp2(object)   (object)
 
#define Duintp1(object)   (object)
 
#define Duintp2(object)   (object)
 
#define Qintp0(object)   (object)
 
#define Qintp1(object)   (object)
 
#define Qintp2(object)   (object)
 
#define Qintp3(object)   (object)
 
#define Sgl_to_dbl_exponent(src_exponent, dest)   Deposit_dexponent(dest,src_exponent+(DBL_BIAS-SGL_BIAS))
 
#define Sgl_to_dbl_mantissa(src_mantissa, destA, destB)
 
#define Sgl_isinexact_to_fix(sgl_value, exponent)
 
#define Int_isinexact_to_sgl(int_value)   (int_value << 33 - SGL_EXP_LENGTH)
 
#define Sgl_roundnearest_from_int(int_value, sgl_value)
 
#define Dint_isinexact_to_sgl(dint_valueA, dint_valueB)   ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB))
 
#define Sgl_roundnearest_from_dint(dint_valueA, dint_valueB, sgl_value)
 
#define Dint_isinexact_to_dbl(dint_value)   (Dintp2(dint_value) << 33 - DBL_EXP_LENGTH)
 
#define Dbl_roundnearest_from_dint(dint_opndB, dbl_opndA, dbl_opndB)
 
#define Sgl_isone_roundbit(sgl_value, exponent)   ((Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) >> 31)
 
#define Sgl_isone_stickybit(sgl_value, exponent)
 
#define Dbl_to_sgl_exponent(src_exponent, dest)   dest = src_exponent + (SGL_BIAS - DBL_BIAS)
 
#define Dbl_to_sgl_mantissa(srcA, srcB, dest, inexact, guard, sticky, odd)
 
#define Dbl_to_sgl_denormalized(srcA, srcB, exp, dest, inexact, guard, sticky, odd, tiny)
 
#define Dbl_isinexact_to_fix(dbl_valueA, dbl_valueB, exponent)
 
#define Dbl_isoverflow_to_int(exponent, dbl_valueA, dbl_valueB)
 
#define Dbl_isone_roundbit(dbl_valueA, dbl_valueB, exponent)
 
#define Dbl_isone_stickybit(dbl_valueA, dbl_valueB, exponent)
 
#define Int_from_sgl_mantissa(sgl_value, exponent)
 
#define Int_from_dbl_mantissa(dbl_valueA, dbl_valueB, exponent)
 
#define Int_negate(int_value)   int_value = -int_value
 
#define Dint_from_sgl_mantissa(sgl_value, exponent, dresultA, dresultB)
 
#define Dint_from_dbl_mantissa(dbl_valueA, dbl_valueB, exponent, destA, destB)
 
#define Dint_setzero(dresultA, dresultB)
 
#define Dint_setone_sign(dresultA, dresultB)
 
#define Dint_set_minint(dresultA, dresultB)
 
#define Dint_isone_lowp2(dresultB)   (Dintp2(dresultB) & 01)
 
#define Dint_increment(dresultA, dresultB)   if ((++Dintp2(dresultB))==0) Dintp1(dresultA)++
 
#define Dint_decrement(dresultA, dresultB)   if ((Dintp2(dresultB)--)==0) Dintp1(dresultA)--
 
#define Dint_negate(dresultA, dresultB)
 
#define Dint_copyfromptr(src, destA, destB)
 
#define Dint_copytoptr(srcA, srcB, dest)
 
#define Find_ms_one_bit(value, position)
 
#define Duint_copyfromptr(src, destA, destB)   Dint_copyfromptr(src,destA,destB)
 
#define Duint_copytoptr(srcA, srcB, dest)   Dint_copytoptr(srcA,srcB,dest)
 
#define Suint_isinexact_to_sgl(int_value)   (int_value << 32 - SGL_EXP_LENGTH)
 
#define Sgl_roundnearest_from_suint(suint_value, sgl_value)
 
#define Duint_isinexact_to_sgl(duint_valueA, duint_valueB)   ((Duintp1(duint_valueA) << 32 - SGL_EXP_LENGTH) || Duintp2(duint_valueB))
 
#define Sgl_roundnearest_from_duint(duint_valueA, duint_valueB, sgl_value)
 
#define Duint_isinexact_to_dbl(duint_value)   (Duintp2(duint_value) << 32 - DBL_EXP_LENGTH)
 
#define Dbl_roundnearest_from_duint(duint_opndB, dbl_opndA, dbl_opndB)
 
#define Suint_from_sgl_mantissa(src, exponent, result)   Sall(result) = (unsigned)(Sall(src) << SGL_EXP_LENGTH)>>(31 - exponent)
 
#define Sgl_isinexact_to_unsigned(sgl_value, exponent)   Sgl_isinexact_to_fix(sgl_value,exponent)
 
#define Duint_from_sgl_mantissa(sgl_value, exponent, dresultA, dresultB)
 
#define Duint_setzero(dresultA, dresultB)   Dint_setzero(dresultA,dresultB)
 
#define Duint_increment(dresultA, dresultB)   Dint_increment(dresultA,dresultB)
 
#define Duint_isone_lowp2(dresultB)   Dint_isone_lowp2(dresultB)
 
#define Suint_from_dbl_mantissa(srcA, srcB, exponent, dest)
 
#define Dbl_isinexact_to_unsigned(dbl_valueA, dbl_valueB, exponent)   Dbl_isinexact_to_fix(dbl_valueA,dbl_valueB,exponent)
 
#define Duint_from_dbl_mantissa(dbl_valueA, dbl_valueB, exponent, destA, destB)   Dint_from_dbl_mantissa(dbl_valueA,dbl_valueB,exponent,destA,destB)
 

Macro Definition Documentation

#define DBL_FX_MAX_EXP   62

Definition at line 30 of file cnv_float.h.

#define Dbl_isinexact_to_fix (   dbl_valueA,
  dbl_valueB,
  exponent 
)
Value:
(exponent < (DBL_P-33) ? \
Dallp2(dbl_valueB) || Dallp1(dbl_valueA) << (DBL_EXP_LENGTH+1+exponent) : \
(exponent < (DBL_P-1) ? Dallp2(dbl_valueB) << (exponent + (33-DBL_P)) : \
FALSE))

Definition at line 191 of file cnv_float.h.

#define Dbl_isinexact_to_unsigned (   dbl_valueA,
  dbl_valueB,
  exponent 
)    Dbl_isinexact_to_fix(dbl_valueA,dbl_valueB,exponent)

Definition at line 373 of file cnv_float.h.

#define Dbl_isone_roundbit (   dbl_valueA,
  dbl_valueB,
  exponent 
)
Value:
((exponent < (DBL_P - 33) ? \
Dallp1(dbl_valueA) >> ((30 - DBL_EXP_LENGTH) - exponent) : \
Dallp2(dbl_valueB) >> ((DBL_P - 2) - exponent)) & 1)

Definition at line 201 of file cnv_float.h.

#define Dbl_isone_stickybit (   dbl_valueA,
  dbl_valueB,
  exponent 
)
Value:
(exponent < (DBL_P-34) ? \
(Dallp2(dbl_valueB) || Dallp1(dbl_valueA)<<(DBL_EXP_LENGTH+2+exponent)) : \
(exponent<(DBL_P-2) ? (Dallp2(dbl_valueB) << (exponent + (34-DBL_P))) : \

Definition at line 206 of file cnv_float.h.

#define Dbl_isoverflow_to_int (   exponent,
  dbl_valueA,
  dbl_valueB 
)
Value:
((exponent > SGL_FX_MAX_EXP + 1) || Dsign(dbl_valueA)==0 || \
Dmantissap1(dbl_valueA)!=0 || (Dallp2(dbl_valueB)>>21)!=0 )

Definition at line 197 of file cnv_float.h.

#define Dbl_roundnearest_from_dint (   dint_opndB,
  dbl_opndA,
  dbl_opndB 
)
Value:
if (Dintp2(dint_opndB) & 1<<(DBL_EXP_LENGTH - 2)) \
if ((Dintp2(dint_opndB) << 34 - DBL_EXP_LENGTH) || Dlowp2(dbl_opndB)) \
if ((++Dallp2(dbl_opndB))==0) Dallp1(dbl_opndA)++

Definition at line 81 of file cnv_float.h.

#define Dbl_roundnearest_from_duint (   duint_opndB,
  dbl_opndA,
  dbl_opndB 
)
Value:
if (Duintp2(duint_opndB) & 1<<(DBL_EXP_LENGTH - 1)) \
if ((Duintp2(duint_opndB) << 33 - DBL_EXP_LENGTH) || Dlowp2(dbl_opndB)) \
if ((++Dallp2(dbl_opndB))==0) Dallp1(dbl_opndA)++

Definition at line 338 of file cnv_float.h.

#define Dbl_to_sgl_denormalized (   srcA,
  srcB,
  exp,
  dest,
  inexact,
  guard,
  sticky,
  odd,
  tiny 
)

Definition at line 108 of file cnv_float.h.

#define Dbl_to_sgl_exponent (   src_exponent,
  dest 
)    dest = src_exponent + (SGL_BIAS - DBL_BIAS)

Definition at line 98 of file cnv_float.h.

#define Dbl_to_sgl_mantissa (   srcA,
  srcB,
  dest,
  inexact,
  guard,
  sticky,
  odd 
)
Value:
guard = Dbit3p2(srcB); \
sticky = Dallp2(srcB)<<4; \
inexact = guard | sticky; \
odd = Dbit2p2(srcB)

Definition at line 101 of file cnv_float.h.

#define Dint_copyfromptr (   src,
  destA,
  destB 
)
Value:
Dintp1(destA) = src->wd0; \
Dintp2(destB) = src->wd1

Definition at line 287 of file cnv_float.h.

#define Dint_copytoptr (   srcA,
  srcB,
  dest 
)
Value:
dest->wd0 = Dintp1(srcA); \
dest->wd1 = Dintp2(srcB)

Definition at line 290 of file cnv_float.h.

#define Dint_decrement (   dresultA,
  dresultB 
)    if ((Dintp2(dresultB)--)==0) Dintp1(dresultA)--

Definition at line 280 of file cnv_float.h.

#define Dint_from_dbl_mantissa (   dbl_valueA,
  dbl_valueB,
  exponent,
  destA,
  destB 
)
Value:
{if (exponent < 32) { \
Dintp1(destA) = 0; \
if (exponent <= 20) \
Dintp2(destB) = Dallp1(dbl_valueA) >> 20-exponent; \
else Variable_shift_double(Dallp1(dbl_valueA),Dallp2(dbl_valueB), \
52-exponent,Dintp2(destB)); \
} \
else { \
if (exponent <= 52) { \
Dintp1(destA) = Dallp1(dbl_valueA) >> 52-exponent; \
if (exponent == 52) Dintp2(destB) = Dallp2(dbl_valueB); \
else Variable_shift_double(Dallp1(dbl_valueA),Dallp2(dbl_valueB), \
52-exponent,Dintp2(destB)); \
} \
else { \
Variable_shift_double(Dallp1(dbl_valueA),Dallp2(dbl_valueB), \
84-exponent,Dintp1(destA)); \
Dintp2(destB) = Dallp2(dbl_valueB) << exponent-52; \
} \
}}

Definition at line 241 of file cnv_float.h.

#define Dint_from_sgl_mantissa (   sgl_value,
  exponent,
  dresultA,
  dresultB 
)
Value:
{Sall(sgl_value) <<= SGL_EXP_LENGTH; /* left-justify */ \
if (exponent <= 31) { \
Dintp1(dresultA) = 0; \
Dintp2(dresultB) = (unsigned)Sall(sgl_value) >> (31 - exponent); \
} \
else { \
Dintp1(dresultA) = Sall(sgl_value) >> (63 - exponent); \
Dintp2(dresultB) = Sall(sgl_value) << (exponent - 31); \
}}

Definition at line 229 of file cnv_float.h.

#define Dint_increment (   dresultA,
  dresultB 
)    if ((++Dintp2(dresultB))==0) Dintp1(dresultA)++

Definition at line 277 of file cnv_float.h.

#define Dint_isinexact_to_dbl (   dint_value)    (Dintp2(dint_value) << 33 - DBL_EXP_LENGTH)

Definition at line 78 of file cnv_float.h.

#define Dint_isinexact_to_sgl (   dint_valueA,
  dint_valueB 
)    ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB))

Definition at line 70 of file cnv_float.h.

#define Dint_isone_lowp2 (   dresultB)    (Dintp2(dresultB) & 01)

Definition at line 275 of file cnv_float.h.

#define Dint_negate (   dresultA,
  dresultB 
)
Value:
Dintp1(dresultA) = ~Dintp1(dresultA); \
if ((Dintp2(dresultB) = -Dintp2(dresultB))==0) Dintp1(dresultA)++

Definition at line 283 of file cnv_float.h.

#define Dint_set_minint (   dresultA,
  dresultB 
)
Value:
Dintp1(dresultA) = (unsigned int)1<<31; \
Dintp2(dresultB) = 0

Definition at line 271 of file cnv_float.h.

#define Dint_setone_sign (   dresultA,
  dresultB 
)
Value:
Dintp1(dresultA) = ~Dintp1(dresultA); \
if ((Dintp2(dresultB) = -Dintp2(dresultB)) == 0) Dintp1(dresultA)++

Definition at line 267 of file cnv_float.h.

#define Dint_setzero (   dresultA,
  dresultB 
)
Value:
Dintp1(dresultA) = 0; \
Dintp2(dresultB) = 0

Definition at line 263 of file cnv_float.h.

#define Dintp1 (   object)    (object)

Definition at line 33 of file cnv_float.h.

#define Dintp2 (   object)    (object)

Definition at line 34 of file cnv_float.h.

#define Duint_copyfromptr (   src,
  destA,
  destB 
)    Dint_copyfromptr(src,destA,destB)

Definition at line 314 of file cnv_float.h.

#define Duint_copytoptr (   srcA,
  srcB,
  dest 
)    Dint_copytoptr(srcA,srcB,dest)

Definition at line 316 of file cnv_float.h.

#define Duint_from_dbl_mantissa (   dbl_valueA,
  dbl_valueB,
  exponent,
  destA,
  destB 
)    Dint_from_dbl_mantissa(dbl_valueA,dbl_valueB,exponent,destA,destB)

Definition at line 376 of file cnv_float.h.

#define Duint_from_sgl_mantissa (   sgl_value,
  exponent,
  dresultA,
  dresultB 
)
Value:
{Sall(sgl_value) <<= SGL_EXP_LENGTH; /* left-justify */ \
if (exponent <= 31) { \
Dintp1(dresultA) = 0; \
Dintp2(dresultB) = (unsigned)Sall(sgl_value) >> (31 - exponent); \
} \
else { \
Dintp1(dresultA) = Sall(sgl_value) >> (63 - exponent); \
Dintp2(dresultB) = Sall(sgl_value) << (exponent - 31); \
} \
Sall(sgl_value) >>= SGL_EXP_LENGTH; /* return to original */ \
}

Definition at line 349 of file cnv_float.h.

#define Duint_increment (   dresultA,
  dresultB 
)    Dint_increment(dresultA,dresultB)

Definition at line 365 of file cnv_float.h.

#define Duint_isinexact_to_dbl (   duint_value)    (Duintp2(duint_value) << 32 - DBL_EXP_LENGTH)

Definition at line 335 of file cnv_float.h.

#define Duint_isinexact_to_sgl (   duint_valueA,
  duint_valueB 
)    ((Duintp1(duint_valueA) << 32 - SGL_EXP_LENGTH) || Duintp2(duint_valueB))

Definition at line 327 of file cnv_float.h.

#define Duint_isone_lowp2 (   dresultB)    Dint_isone_lowp2(dresultB)

Definition at line 367 of file cnv_float.h.

#define Duint_setzero (   dresultA,
  dresultB 
)    Dint_setzero(dresultA,dresultB)

Definition at line 362 of file cnv_float.h.

#define Duintp1 (   object)    (object)

Definition at line 36 of file cnv_float.h.

#define Duintp2 (   object)    (object)

Definition at line 37 of file cnv_float.h.

#define Find_ms_one_bit (   value,
  position 
)
Value:
{ \
int var; \
for (var=8; var >=1; var >>= 1) { \
if (value >> 32 - position) \
position -= var; \
else position += var; \
} \
if ((value >> 32 - position) == 0) \
position--; \
else position -= 2; \
}

Definition at line 297 of file cnv_float.h.

#define Int_from_dbl_mantissa (   dbl_valueA,
  dbl_valueB,
  exponent 
)
Value:
Shiftdouble(Dallp1(dbl_valueA),Dallp2(dbl_valueB),22,Dallp1(dbl_valueA)); \
if (exponent < 31) Dallp1(dbl_valueA) >>= 30 - exponent; \
else Dallp1(dbl_valueA) <<= 1

Definition at line 219 of file cnv_float.h.

#define Int_from_sgl_mantissa (   sgl_value,
  exponent 
)
Value:
Sall(sgl_value) = \
(unsigned)(Sall(sgl_value) << SGL_EXP_LENGTH)>>(31 - exponent)

Definition at line 215 of file cnv_float.h.

#define Int_isinexact_to_sgl (   int_value)    (int_value << 33 - SGL_EXP_LENGTH)

Definition at line 63 of file cnv_float.h.

#define Int_negate (   int_value)    int_value = -int_value

Definition at line 224 of file cnv_float.h.

#define Qintp0 (   object)    (object)

Definition at line 39 of file cnv_float.h.

#define Qintp1 (   object)    (object)

Definition at line 40 of file cnv_float.h.

#define Qintp2 (   object)    (object)

Definition at line 41 of file cnv_float.h.

#define Qintp3 (   object)    (object)

Definition at line 42 of file cnv_float.h.

#define QUAD_FX_MAX_EXP   126

Definition at line 31 of file cnv_float.h.

#define SGL_FX_MAX_EXP   30

Definition at line 29 of file cnv_float.h.

#define Sgl_isinexact_to_fix (   sgl_value,
  exponent 
)
Value:
((exponent < (SGL_P - 1)) ? \
(Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) : FALSE)

Definition at line 59 of file cnv_float.h.

#define Sgl_isinexact_to_unsigned (   sgl_value,
  exponent 
)    Sgl_isinexact_to_fix(sgl_value,exponent)

Definition at line 346 of file cnv_float.h.

#define Sgl_isone_roundbit (   sgl_value,
  exponent 
)    ((Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) >> 31)

Definition at line 86 of file cnv_float.h.

#define Sgl_isone_stickybit (   sgl_value,
  exponent 
)
Value:
(exponent < (SGL_P - 2) ? \
Sall(sgl_value) << (SGL_EXP_LENGTH + 2 + exponent) : FALSE)

Definition at line 89 of file cnv_float.h.

#define Sgl_roundnearest_from_dint (   dint_valueA,
  dint_valueB,
  sgl_value 
)
Value:
if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) \
if ((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) || \
Dintp2(dint_valueB) || Slow(sgl_value)) Sall(sgl_value)++

Definition at line 73 of file cnv_float.h.

#define Sgl_roundnearest_from_duint (   duint_valueA,
  duint_valueB,
  sgl_value 
)
Value:
if (Duintp1(duint_valueA) & 1<<(SGL_EXP_LENGTH - 1)) \
if ((Duintp1(duint_valueA) << 33 - SGL_EXP_LENGTH) || \
Duintp2(duint_valueB) || Slow(sgl_value)) Sall(sgl_value)++

Definition at line 330 of file cnv_float.h.

#define Sgl_roundnearest_from_int (   int_value,
  sgl_value 
)
Value:
if (int_value & 1<<(SGL_EXP_LENGTH - 2)) /* round bit */ \
if ((int_value << 34 - SGL_EXP_LENGTH) || Slow(sgl_value)) \
Sall(sgl_value)++

Definition at line 65 of file cnv_float.h.

#define Sgl_roundnearest_from_suint (   suint_value,
  sgl_value 
)
Value:
if (suint_value & 1<<(SGL_EXP_LENGTH - 1)) /* round bit */ \
if ((suint_value << 33 - SGL_EXP_LENGTH) || Slow(sgl_value)) \
Sall(sgl_value)++

Definition at line 322 of file cnv_float.h.

#define Sgl_to_dbl_exponent (   src_exponent,
  dest 
)    Deposit_dexponent(dest,src_exponent+(DBL_BIAS-SGL_BIAS))

Definition at line 52 of file cnv_float.h.

#define Sgl_to_dbl_mantissa (   src_mantissa,
  destA,
  destB 
)
Value:
Deposit_dmantissap1(destA,src_mantissa>>3); \
Dmantissap2(destB) = src_mantissa << 29

Definition at line 55 of file cnv_float.h.

#define Suint_from_dbl_mantissa (   srcA,
  srcB,
  exponent,
  dest 
)
Value:
Shiftdouble(Dallp1(srcA),Dallp2(srcB),21,dest); \
dest = (unsigned)dest >> 31 - exponent

Definition at line 369 of file cnv_float.h.

#define Suint_from_sgl_mantissa (   src,
  exponent,
  result 
)    Sall(result) = (unsigned)(Sall(src) << SGL_EXP_LENGTH)>>(31 - exponent)

Definition at line 343 of file cnv_float.h.

#define Suint_isinexact_to_sgl (   int_value)    (int_value << 32 - SGL_EXP_LENGTH)

Definition at line 319 of file cnv_float.h.