亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? softfloat.c

?? <Floating Point Unit Core> fpupack.vhd pre_norm_addsub.vhd addsub_28.vhd post_norm_addsub.
?? C
?? 第 1 頁 / 共 5 頁
字號:

/*============================================================================

This C source file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic
Package, Release 2b.

Written by John R. Hauser.  This work was made possible in part by the
International Computer Science Institute, located at Suite 600, 1947 Center
Street, Berkeley, California 94704.  Funding was partially provided by the
National Science Foundation under grant MIP-9311980.  The original version
of this code was written as part of a project to build a fixed-point vector
processor in collaboration with the University of California at Berkeley,
overseen by Profs. Nelson Morgan and John Wawrzynek.  More information
is available through the Web page `http://www.cs.berkeley.edu/~jhauser/
arithmetic/SoftFloat.html'.

THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE.  Although reasonable effort has
been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES
RESULT IN INCORRECT BEHAVIOR.  USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS
AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES,
COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE
EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE
INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR
OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE.

Derivative works are acceptable, even for commercial purposes, so long as
(1) the source code for the derivative work includes prominent notice that
the work is derivative, and (2) the source code includes prominent notice with
these four paragraphs for those parts of this code that are retained.

=============================================================================*/

#include "milieu.h"
#include "softfloat.h"

/*----------------------------------------------------------------------------
| Floating-point rounding mode, extended double-precision rounding precision,
| and exception flags.
*----------------------------------------------------------------------------*/
int8 float_rounding_mode = float_round_nearest_even;
int8 float_exception_flags = 0;
#ifdef FLOATX80
int8 floatx80_rounding_precision = 80;
#endif

/*----------------------------------------------------------------------------
| Primitive arithmetic functions, including multi-word arithmetic, and
| division and square root approximations.  (Can be specialized to target if
| desired.)
*----------------------------------------------------------------------------*/
#include "softfloat-macros"

/*----------------------------------------------------------------------------
| Functions and definitions to determine:  (1) whether tininess for underflow
| is detected before or after rounding by default, (2) what (if anything)
| happens when exceptions are raised, (3) how signaling NaNs are distinguished
| from quiet NaNs, (4) the default generated quiet NaNs, and (5) how NaNs
| are propagated from function inputs to output.  These details are target-
| specific.
*----------------------------------------------------------------------------*/
#include "softfloat-specialize"

/*----------------------------------------------------------------------------
| Takes a 64-bit fixed-point value `absZ' with binary point between bits 6
| and 7, and returns the properly rounded 32-bit integer corresponding to the
| input.  If `zSign' is 1, the input is negated before being converted to an
| integer.  Bit 63 of `absZ' must be zero.  Ordinarily, the fixed-point input
| is simply rounded to an integer, with the inexact exception raised if the
| input cannot be represented exactly as an integer.  However, if the fixed-
| point input is too large, the invalid exception is raised and the largest
| positive or negative integer is returned.
*----------------------------------------------------------------------------*/

static int32 roundAndPackInt32( flag zSign, bits64 absZ )
{
    int8 roundingMode;
    flag roundNearestEven;
    int8 roundIncrement, roundBits;
    int32 z;

    roundingMode = float_rounding_mode;
    roundNearestEven = ( roundingMode == float_round_nearest_even );
    roundIncrement = 0x40;
    if ( ! roundNearestEven ) {
        if ( roundingMode == float_round_to_zero ) {
            roundIncrement = 0;
        }
        else {
            roundIncrement = 0x7F;
            if ( zSign ) {
                if ( roundingMode == float_round_up ) roundIncrement = 0;
            }
            else {
                if ( roundingMode == float_round_down ) roundIncrement = 0;
            }
        }
    }
    roundBits = absZ & 0x7F;
    absZ = ( absZ + roundIncrement )>>7;
    absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
    z = absZ;
    if ( zSign ) z = - z;
    if ( ( absZ>>32 ) || ( z && ( ( z < 0 ) ^ zSign ) ) ) {
        float_raise( float_flag_invalid );
        return zSign ? (sbits32) 0x80000000 : 0x7FFFFFFF;
    }
    if ( roundBits ) float_exception_flags |= float_flag_inexact;
    return z;

}

/*----------------------------------------------------------------------------
| Takes the 128-bit fixed-point value formed by concatenating `absZ0' and
| `absZ1', with binary point between bits 63 and 64 (between the input words),
| and returns the properly rounded 64-bit integer corresponding to the input.
| If `zSign' is 1, the input is negated before being converted to an integer.
| Ordinarily, the fixed-point input is simply rounded to an integer, with
| the inexact exception raised if the input cannot be represented exactly as
| an integer.  However, if the fixed-point input is too large, the invalid
| exception is raised and the largest positive or negative integer is
| returned.
*----------------------------------------------------------------------------*/

static int64 roundAndPackInt64( flag zSign, bits64 absZ0, bits64 absZ1 )
{
    int8 roundingMode;
    flag roundNearestEven, increment;
    int64 z;

    roundingMode = float_rounding_mode;
    roundNearestEven = ( roundingMode == float_round_nearest_even );
    increment = ( (sbits64) absZ1 < 0 );
    if ( ! roundNearestEven ) {
        if ( roundingMode == float_round_to_zero ) {
            increment = 0;
        }
        else {
            if ( zSign ) {
                increment = ( roundingMode == float_round_down ) && absZ1;
            }
            else {
                increment = ( roundingMode == float_round_up ) && absZ1;
            }
        }
    }
    if ( increment ) {
        ++absZ0;
        if ( absZ0 == 0 ) goto overflow;
        absZ0 &= ~ ( ( (bits64) ( absZ1<<1 ) == 0 ) & roundNearestEven );
    }
    z = absZ0;
    if ( zSign ) z = - z;
    if ( z && ( ( z < 0 ) ^ zSign ) ) {
 overflow:
        float_raise( float_flag_invalid );
        return
              zSign ? (sbits64) LIT64( 0x8000000000000000 )
            : LIT64( 0x7FFFFFFFFFFFFFFF );
    }
    if ( absZ1 ) float_exception_flags |= float_flag_inexact;
    return z;

}

/*----------------------------------------------------------------------------
| Returns the fraction bits of the single-precision floating-point value `a'.
*----------------------------------------------------------------------------*/

INLINE bits32 extractFloat32Frac( float32 a )
{

    return a & 0x007FFFFF;

}

/*----------------------------------------------------------------------------
| Returns the exponent bits of the single-precision floating-point value `a'.
*----------------------------------------------------------------------------*/

INLINE int16 extractFloat32Exp( float32 a )
{

    return ( a>>23 ) & 0xFF;

}

/*----------------------------------------------------------------------------
| Returns the sign bit of the single-precision floating-point value `a'.
*----------------------------------------------------------------------------*/

INLINE flag extractFloat32Sign( float32 a )
{

    return a>>31;

}

/*----------------------------------------------------------------------------
| Normalizes the subnormal single-precision floating-point value represented
| by the denormalized significand `aSig'.  The normalized exponent and
| significand are stored at the locations pointed to by `zExpPtr' and
| `zSigPtr', respectively.
*----------------------------------------------------------------------------*/

static void
 normalizeFloat32Subnormal( bits32 aSig, int16 *zExpPtr, bits32 *zSigPtr )
{
    int8 shiftCount;

    shiftCount = countLeadingZeros32( aSig ) - 8;
    *zSigPtr = aSig<<shiftCount;
    *zExpPtr = 1 - shiftCount;

}

/*----------------------------------------------------------------------------
| Packs the sign `zSign', exponent `zExp', and significand `zSig' into a
| single-precision floating-point value, returning the result.  After being
| shifted into the proper positions, the three fields are simply added
| together to form the result.  This means that any integer portion of `zSig'
| will be added into the exponent.  Since a properly normalized significand
| will have an integer portion equal to 1, the `zExp' input should be 1 less
| than the desired result exponent whenever `zSig' is a complete, normalized
| significand.
*----------------------------------------------------------------------------*/

INLINE float32 packFloat32( flag zSign, int16 zExp, bits32 zSig )
{

    return ( ( (bits32) zSign )<<31 ) + ( ( (bits32) zExp )<<23 ) + zSig;

}

/*----------------------------------------------------------------------------
| Takes an abstract floating-point value having sign `zSign', exponent `zExp',
| and significand `zSig', and returns the proper single-precision floating-
| point value corresponding to the abstract input.  Ordinarily, the abstract
| value is simply rounded and packed into the single-precision format, with
| the inexact exception raised if the abstract input cannot be represented
| exactly.  However, if the abstract value is too large, the overflow and
| inexact exceptions are raised and an infinity or maximal finite value is
| returned.  If the abstract value is too small, the input value is rounded to
| a subnormal number, and the underflow and inexact exceptions are raised if
| the abstract input cannot be represented exactly as a subnormal single-
| precision floating-point number.
|     The input significand `zSig' has its binary point between bits 30
| and 29, which is 7 bits to the left of the usual location.  This shifted
| significand must be normalized or smaller.  If `zSig' is not normalized,
| `zExp' must be 0; in that case, the result returned is a subnormal number,
| and it must not require rounding.  In the usual case that `zSig' is
| normalized, `zExp' must be 1 less than the ``true'' floating-point exponent.
| The handling of underflow and overflow follows the IEC/IEEE Standard for
| Binary Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/

static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig )
{
    int8 roundingMode;
    flag roundNearestEven;
    int8 roundIncrement, roundBits;
    flag isTiny;

    roundingMode = float_rounding_mode;
    roundNearestEven = ( roundingMode == float_round_nearest_even );
    roundIncrement = 0x40;
    if ( ! roundNearestEven ) {
        if ( roundingMode == float_round_to_zero ) {
            roundIncrement = 0;
        }
        else {
            roundIncrement = 0x7F;
            if ( zSign ) {
                if ( roundingMode == float_round_up ) roundIncrement = 0;
            }
            else {
                if ( roundingMode == float_round_down ) roundIncrement = 0;
            }
        }
    }
    roundBits = zSig & 0x7F;
    if ( 0xFD <= (bits16) zExp ) {
        if (    ( 0xFD < zExp )
             || (    ( zExp == 0xFD )
                  && ( (sbits32) ( zSig + roundIncrement ) < 0 ) )
           ) {
            float_raise( float_flag_overflow | float_flag_inexact );
            return packFloat32( zSign, 0xFF, 0 ) - ( roundIncrement == 0 );
        }
        if ( zExp < 0 ) {
            isTiny =
                   ( float_detect_tininess == float_tininess_before_rounding )
                || ( zExp < -1 )
                || ( zSig + roundIncrement < 0x80000000 );
            shift32RightJamming( zSig, - zExp, &zSig );
            zExp = 0;
            roundBits = zSig & 0x7F;
            if ( isTiny && roundBits ) float_raise( float_flag_underflow );
        }
    }
    if ( roundBits ) float_exception_flags |= float_flag_inexact;
    zSig = ( zSig + roundIncrement )>>7;
    zSig &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven );
    if ( zSig == 0 ) zExp = 0;
    return packFloat32( zSign, zExp, zSig );

}

/*----------------------------------------------------------------------------
| Takes an abstract floating-point value having sign `zSign', exponent `zExp',
| and significand `zSig', and returns the proper single-precision floating-
| point value corresponding to the abstract input.  This routine is just like
| `roundAndPackFloat32' except that `zSig' does not have to be normalized.
| Bit 31 of `zSig' must be zero, and `zExp' must be 1 less than the ``true''
| floating-point exponent.
*----------------------------------------------------------------------------*/

static float32
 normalizeRoundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig )
{
    int8 shiftCount;

    shiftCount = countLeadingZeros32( zSig ) - 1;
    return roundAndPackFloat32( zSign, zExp - shiftCount, zSig<<shiftCount );

}

/*----------------------------------------------------------------------------
| Returns the fraction bits of the double-precision floating-point value `a'.
*----------------------------------------------------------------------------*/

INLINE bits64 extractFloat64Frac( float64 a )
{

    return a & LIT64( 0x000FFFFFFFFFFFFF );

}

/*----------------------------------------------------------------------------
| Returns the exponent bits of the double-precision floating-point value `a'.
*----------------------------------------------------------------------------*/

INLINE int16 extractFloat64Exp( float64 a )
{

    return ( a>>52 ) & 0x7FF;

}

/*----------------------------------------------------------------------------
| Returns the sign bit of the double-precision floating-point value `a'.
*----------------------------------------------------------------------------*/

INLINE flag extractFloat64Sign( float64 a )
{

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内精品写真在线观看| 日韩一区二区三区在线| 色就色 综合激情| 99re热这里只有精品免费视频| 国产一区二区三区四| 韩日av一区二区| 精品一区二区三区免费观看| 黑人巨大精品欧美黑白配亚洲| 日本网站在线观看一区二区三区| 日本强好片久久久久久aaa| 五月激情综合色| 亚洲国产美女搞黄色| 亚洲国产成人tv| 日本亚洲最大的色成网站www| 日韩黄色一级片| 精品夜夜嗨av一区二区三区| 极品销魂美女一区二区三区| 国产精品一二三| 不卡的av网站| 欧洲另类一二三四区| 欧美日韩情趣电影| 亚洲综合视频在线观看| 亚洲sss视频在线视频| 美国欧美日韩国产在线播放| 久久99国内精品| 成人精品gif动图一区| bt7086福利一区国产| 欧美亚洲一区三区| 日韩一级大片在线| 久久精品这里都是精品| 一区视频在线播放| 午夜精品免费在线| 国产在线精品不卡| 91在线国产福利| 欧美一区二区免费| 久久久精品2019中文字幕之3| 日韩美女视频一区二区| 亚洲福利一区二区| 国产精华液一区二区三区| 色婷婷综合视频在线观看| 欧美日韩国产成人在线免费| 久久香蕉国产线看观看99| 亚洲三级在线观看| 蜜臀av一级做a爰片久久| 粉嫩绯色av一区二区在线观看 | 精品一区二区在线看| 成人午夜视频免费看| 欧美中文字幕一区| 久久久五月婷婷| 亚洲人成在线播放网站岛国| 免费观看在线色综合| 成人动漫一区二区在线| 91麻豆精品国产91久久久使用方法 | 日韩欧美精品在线视频| 韩国一区二区视频| 色婷婷亚洲精品| 精品久久国产老人久久综合| 伊人婷婷欧美激情| 国产高清久久久| 欧美性猛交一区二区三区精品| 久久久久久影视| 五月天久久比比资源色| 不卡视频一二三| 久久综合九色综合97婷婷女人| 亚洲一区二区三区视频在线| 国产成人福利片| 欧美一区二区三区性视频| 亚洲女人****多毛耸耸8| 久久成人免费网站| 欧美午夜在线一二页| 国产精品电影一区二区| 精品一区二区三区在线观看国产| 欧美性大战久久久久久久| 国产精品嫩草影院com| 韩国欧美国产一区| 欧美女孩性生活视频| 日韩一区在线看| 国产91丝袜在线播放| 欧美一区二区三区免费| 亚洲成在线观看| 91蜜桃在线免费视频| 欧美经典三级视频一区二区三区| 极品少妇xxxx偷拍精品少妇| 欧美精品第一页| 一区二区高清视频在线观看| 99久久er热在这里只有精品15 | 精品在线视频一区| 91精品国产综合久久久蜜臀粉嫩 | 91精品国产一区二区| 一区二区高清在线| 色综合色狠狠综合色| 国产精品全国免费观看高清| 高清成人免费视频| 久久久99免费| 国产一区久久久| 久久免费偷拍视频| 国产永久精品大片wwwapp | 天堂成人免费av电影一区| 欧洲中文字幕精品| 亚洲伊人色欲综合网| 欧美影院一区二区| 亚洲一区自拍偷拍| 欧洲av一区二区嗯嗯嗯啊| 亚洲一区二区视频在线观看| 色女孩综合影院| 一区二区欧美在线观看| 欧美在线观看你懂的| 亚洲高清视频在线| 3d动漫精品啪啪1区2区免费| 亚洲成人手机在线| 日韩视频在线你懂得| 美女久久久精品| 久久久亚洲精品石原莉奈| 国产成人综合在线观看| 最新日韩av在线| 一道本成人在线| 午夜欧美视频在线观看| 亚洲成av人片在线观看无码| 亚洲成人在线网站| 日韩精品中文字幕一区| 欧美一区二区福利在线| 亚洲一区免费在线观看| 欧美日韩另类一区| 蜜桃视频在线观看一区二区| 亚洲精品在线网站| 懂色av一区二区三区蜜臀| 亚洲人一二三区| 欧美丝袜丝交足nylons图片| 免费看日韩a级影片| 久久久久久久久岛国免费| 99久精品国产| 婷婷六月综合亚洲| 精品久久99ma| 99re8在线精品视频免费播放| 亚洲国产一区二区视频| 日韩精品一区二区三区视频在线观看| 黄网站免费久久| 亚洲欧洲日韩在线| 678五月天丁香亚洲综合网| 国产精品一区二区黑丝| 国产精品丝袜在线| 99久久免费国产| 五月天精品一区二区三区| 久久久另类综合| 日本精品裸体写真集在线观看 | 在线亚洲免费视频| 美女网站色91| 亚洲欧美一区二区久久| 日韩欧美在线一区二区三区| 成人av在线影院| 日韩不卡手机在线v区| 欧美国产成人精品| 欧美丰满少妇xxxxx高潮对白 | 欧美电影免费观看完整版| www.av精品| 男女男精品视频| 18成人在线观看| 日韩精品自拍偷拍| 91国产福利在线| 国产老肥熟一区二区三区| 午夜影院久久久| 国产精品美女久久久久av爽李琼 | 亚洲精品自拍动漫在线| 久久综合九色综合97婷婷女人| 欧美性猛交xxxx乱大交退制版| 国产精品中文字幕日韩精品 | 亚洲国产毛片aaaaa无费看 | 久久福利资源站| 亚洲成人精品一区| 中文在线一区二区| 欧美一个色资源| 欧美日韩久久不卡| kk眼镜猥琐国模调教系列一区二区| 日韩黄色小视频| 亚洲自拍与偷拍| 国产精品久久久久久久久晋中| 日韩精品中文字幕一区| 欧美日韩在线播放| www.成人网.com| 国产激情视频一区二区在线观看| 视频一区视频二区中文| 一区二区三区四区在线播放| 国产精品美女久久久久aⅴ| 久久综合九色欧美综合狠狠 | 中文字幕中文乱码欧美一区二区 | 精品一二线国产| 日韩成人免费电影| 亚洲已满18点击进入久久| 亚洲欧洲国产日韩| 欧美国产成人在线| 久久精品一二三| 26uuu成人网一区二区三区| 欧美一级片免费看| 欧美一区二区视频在线观看2022 | 亚洲成av人影院在线观看网| 一区二区三区高清| 亚洲精品乱码久久久久久 | 国产成人8x视频一区二区| 国产一区在线不卡| 国产精品一区二区久久精品爱涩|