Go to the documentation of this file.
21 #ifndef AVUTIL_SOFTFLOAT_IEEE754_H
22 #define AVUTIL_SOFTFLOAT_IEEE754_H
42 while( sf.
mant >= 0x1000000UL ) {
46 sf.
mant &= 0x007fffffUL;
67 return ((
SoftFloat_IEEE754) { (n & 0x80000000UL) >> 31, (n & 0x7FFFFFUL), (int8_t)((n & 0x7F800000UL) >> 23)});
73 if(
a.exp >= 0)
return a.mant <<
a.exp ;
74 else return a.mant >>(-
a.exp);
84 sign =
a.sign ^
b.sign;
85 mant = ((((uint64_t) (
a.mant | 0x00800000UL)) <<
MANT_BITS) / (
b.mant| 0x00800000UL));
97 sign =
a.sign ^
b.sign;
98 mant = (((uint64_t)(
a.mant|0x00800000UL) * (uint64_t)(
b.mant|0x00800000UL))>>
MANT_BITS);
109 if (
a.sign !=
b.sign)
return 0;
110 if (
a.mant !=
b.mant)
return 0;
111 if (
a.exp !=
b.exp )
return 0;
static SoftFloat_IEEE754 av_mul_sf_ieee754(SoftFloat_IEEE754 a, SoftFloat_IEEE754 b)
Multiply a with b return normalized result.
static SoftFloat_IEEE754 av_bits2sf_ieee754(uint32_t n)
Make a softfloat out of the bitstream.
static SoftFloat_IEEE754 av_int2sf_ieee754(int64_t n, int e)
Convert integer to softfloat.
static int av_cmp_sf_ieee754(SoftFloat_IEEE754 a, SoftFloat_IEEE754 b)
Compare a with b strictly.
static const SoftFloat_IEEE754 FLOAT_1
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static const SoftFloat_IEEE754 FLOAT_0
static SoftFloat_IEEE754 av_div_sf_ieee754(SoftFloat_IEEE754 a, SoftFloat_IEEE754 b)
Divide a by b.
static int av_sf2int_ieee754(SoftFloat_IEEE754 a)
Convert the softfloat to integer.
static SoftFloat_IEEE754 av_normalize_sf_ieee754(SoftFloat_IEEE754 sf)
Normalize the softfloat as defined by IEEE 754 single-recision floating point specification.