Exemplo n.º 1
0
struct exp8_sig16 softfloat_normSubnormalF16Sig( uint_fast16_t sig )
{
    int_fast8_t shiftDist;
    struct exp8_sig16 z;

    shiftDist = softfloat_countLeadingZeros16( sig ) - 5;
    z.exp = 1 - shiftDist;
    z.sig = sig<<shiftDist;
    return z;

}
Exemplo n.º 2
0
float16_t
 softfloat_normRoundPackToF16( bool sign, int_fast16_t exp, uint_fast16_t sig )
{
    int_fast8_t shiftDist;
    union ui16_f16 uZ;

    shiftDist = softfloat_countLeadingZeros16( sig ) - 1;
    exp -= shiftDist;
    if ( (4 <= shiftDist) && ((unsigned int) exp < 0x1D) ) {
        uZ.ui = packToF16UI( sign, sig ? exp : 0, sig<<(shiftDist - 4) );
        return uZ.f;
    } else {
        return softfloat_roundPackToF16( sign, exp, sig<<shiftDist );
    }

}