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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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 )
{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产91在线观看| 日韩欧美不卡在线观看视频| 国产一本一道久久香蕉| 美女高潮久久久| 国内精品久久久久影院色 | 国产精品麻豆久久久| www成人在线观看| 久久久久久久免费视频了| 久久久久久久久久久久久久久99 | 成人91在线观看| 成人短视频下载| 欧美日韩一区高清| 欧美猛男男办公室激情| 欧美一区二区精品久久911| 三级影片在线观看欧美日韩一区二区| 国产女人水真多18毛片18精品视频| 麻豆成人久久精品二区三区红 | 26uuu精品一区二区 | 不卡视频一二三| 在线亚洲人成电影网站色www| 欧美视频在线不卡| 日韩精品一区二区三区中文不卡 | 中文一区一区三区高中清不卡| 国产精品久久久久9999吃药| 亚洲一二三四久久| 美女国产一区二区三区| 国产成人av一区二区三区在线观看| 国产精品久久国产精麻豆99网站| 国产精品美女久久久久久| 亚洲乱码精品一二三四区日韩在线 | 婷婷开心激情综合| 国产乱码精品1区2区3区| 91麻豆免费看片| 日韩一区国产二区欧美三区| 国产精品乱人伦中文| 亚洲超碰97人人做人人爱| 狠狠色综合播放一区二区| 日本高清不卡aⅴ免费网站| 欧美xxxxxxxx| 亚洲一区二区三区国产| 国产一区二区免费在线| 色偷偷久久一区二区三区| 精品国产免费久久 | 激情六月婷婷综合| 99re热这里只有精品免费视频| 日韩片之四级片| 日韩一区在线播放| 国产毛片精品国产一区二区三区| 97se亚洲国产综合自在线| 欧美白人最猛性xxxxx69交| 一区二区三区国产精华| 国产精品自拍网站| 91精品国产色综合久久不卡电影| 国产精品国产三级国产有无不卡| 久久99久久久久| 在线亚洲人成电影网站色www| 欧美国产日韩一二三区| 激情综合一区二区三区| 日韩欧美在线综合网| 性欧美疯狂xxxxbbbb| 在线观看免费亚洲| 亚洲免费观看在线观看| jizz一区二区| 国产精品网友自拍| 国产精品456露脸| 国产成人在线观看| 国产精品久久午夜| 丁香婷婷深情五月亚洲| 天堂一区二区在线| 色悠久久久久综合欧美99| 亚洲国产成人自拍| 成人中文字幕电影| 国产欧美一区二区三区网站| 免费不卡在线观看| 日韩精品专区在线影院重磅| 亚洲大片精品永久免费| 欧美午夜一区二区| 亚洲电影一级片| 欧美日韩国产色站一区二区三区| 亚洲综合色区另类av| 欧美日韩一级二级| 亚洲va在线va天堂| 7777精品久久久大香线蕉| 日韩中文字幕不卡| 日韩欧美综合在线| 亚洲精品视频在线| 玉米视频成人免费看| 日本午夜一区二区| 最好看的中文字幕久久| 国产不卡在线播放| 国产欧美一二三区| 色婷婷av一区二区三区软件| 亚洲午夜久久久久| 日韩一区二区电影在线| 国产激情精品久久久第一区二区| 国产精品网站在线| 欧美视频精品在线观看| 日韩精品电影一区亚洲| 久久色在线观看| aaa欧美大片| 日韩电影网1区2区| 精品人在线二区三区| 国产成人精品1024| 亚洲电影中文字幕在线观看| 欧美一区二区三区视频免费| 丁香婷婷综合激情五月色| 亚洲精品高清在线| 欧美mv和日韩mv的网站| 99久久综合99久久综合网站| 日韩精品一二三四| 中文一区二区在线观看| 91.com在线观看| 国产精品系列在线观看| 亚洲伊人伊色伊影伊综合网| 日韩午夜电影在线观看| 色婷婷综合久久| 国产精品一区二区久久不卡 | 99久久伊人精品| 青青草97国产精品免费观看无弹窗版| 中文字幕精品一区二区三区精品 | 欧美一级二级在线观看| 不卡的av电影| 激情都市一区二区| 亚洲bdsm女犯bdsm网站| 亚洲第一狼人社区| 日本一区二区高清| 日韩一区二区电影| 欧美日韩高清一区二区| 91在线观看一区二区| 韩国三级在线一区| 日韩电影在线免费| 亚洲午夜一区二区| 1区2区3区欧美| 精品乱人伦小说| 4438x亚洲最大成人网| 91欧美激情一区二区三区成人| 国产一区二区免费视频| 久久精品国产精品亚洲红杏| 亚洲超碰97人人做人人爱| 亚洲视频在线一区观看| 国产精品情趣视频| 久久久久国产精品免费免费搜索 | 国产日韩欧美在线一区| 欧美精品免费视频| 三级影片在线观看欧美日韩一区二区 | 一区二区三区日韩欧美精品| 日本一区免费视频| 国产日本欧洲亚洲| 久久免费偷拍视频| 国产日韩成人精品| 亚洲国产精品99久久久久久久久| 日韩欧美一二三| 欧美成va人片在线观看| 欧美一级理论性理论a| 91精品在线一区二区| 欧美久久久久久久久久| 久久日韩精品一区二区五区| 欧美一区二区在线视频| 91精品国产一区二区| 日韩欧美区一区二| 国产亚洲一区字幕| 国产精品狼人久久影院观看方式| 国产精品三级在线观看| 椎名由奈av一区二区三区| 亚洲激情网站免费观看| 亚洲无人区一区| 日韩电影免费在线观看网站| 久久国产三级精品| 国产69精品久久久久777| 成人黄色国产精品网站大全在线免费观看| 国产999精品久久久久久| k8久久久一区二区三区| 欧美日韩国产成人在线免费| 欧美大片顶级少妇| 国产精品激情偷乱一区二区∴| 亚洲精品乱码久久久久| 肉色丝袜一区二区| 国产精品一区二区x88av| a在线播放不卡| 91精品国产品国语在线不卡| 精品国产乱码久久久久久闺蜜 | 亚洲已满18点击进入久久| 日韩精品一二区| 国产伦精品一区二区三区免费迷 | 国产91在线观看丝袜| 在线观看日产精品| 26uuu另类欧美亚洲曰本| 17c精品麻豆一区二区免费| 亚洲a一区二区| 成人激情小说乱人伦| 7777精品伊人久久久大香线蕉经典版下载 | 91精品国产美女浴室洗澡无遮挡| 欧美tk—视频vk| 亚洲欧美经典视频| 韩国av一区二区三区四区| 日本高清不卡视频| 国产亚洲女人久久久久毛片| 日韩一区精品视频| 91免费版在线| 精品国产三级a在线观看|