VirtualBox

Changeset 36140 in vbox for trunk/src/recompiler/fpu


Ignore:
Timestamp:
Mar 3, 2011 1:48:16 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70322
Message:

rem: Re-synced to svn://svn.savannah.nongnu.org/qemu/trunk@5495 (repo UUID c046a42c-6fe2-441c-8c8c-71466251a162).

Location:
trunk/src/recompiler/fpu
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/fpu/softfloat-macros.h

    r21292 r36140  
    718718
    719719}
     720
  • trunk/src/recompiler/fpu/softfloat-native.c

    r21292 r36140  
    77{
    88    STATUS(float_rounding_mode) = val;
    9 #if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && (HOST_SOLARIS < 10 || HOST_SOLARIS == 11))
     9#if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && (HOST_SOLARIS < 10 || HOST_SOLARIS == 11)) /* VBOX adds sol 11 */
    1010    fpsetround(val);
    1111#elif defined(__arm__)
     
    6161#endif
    6262
    63 #if defined(_ARCH_PPC)
     63#if defined(__powerpc__)
    6464
    6565/* correct (but slow) PowerPC rint() (glibc version is incorrect) */
    66 static double qemu_rint(double x)
     66double qemu_rint(double x)
    6767{
    6868    double y = 4503599627370496.0;
     
    230230{
    231231    if (a < b) {
    232         return float_relation_less;
     232        return -1;
    233233    } else if (a == b) {
    234         return float_relation_equal;
     234        return 0;
    235235    } else if (a > b) {
    236         return float_relation_greater;
    237     } else {
    238         return float_relation_unordered;
     236        return 1;
     237    } else {
     238        return 2;
    239239    }
    240240}
     
    242242{
    243243    if (isless(a, b)) {
    244         return float_relation_less;
     244        return -1;
    245245    } else if (a == b) {
    246         return float_relation_equal;
     246        return 0;
    247247    } else if (isgreater(a, b)) {
    248         return float_relation_greater;
    249     } else {
    250         return float_relation_unordered;
     248        return 1;
     249    } else {
     250        return 2;
    251251    }
    252252}
     
    258258    a = u.i;
    259259    return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF );
    260 }
    261 
    262 int float32_is_nan( float32 a1 )
    263 {
    264     float32u u;
    265     uint64_t a;
    266     u.f = a1;
    267     a = u.i;
    268     return ( 0xFF800000 < ( a<<1 ) );
    269260}
    270261
     
    401392{
    402393    if (a < b) {
    403         return float_relation_less;
     394        return -1;
    404395    } else if (a == b) {
    405         return float_relation_equal;
     396        return 0;
    406397    } else if (a > b) {
    407         return float_relation_greater;
    408     } else {
    409         return float_relation_unordered;
     398        return 1;
     399    } else {
     400        return 2;
    410401    }
    411402}
     
    413404{
    414405    if (isless(a, b)) {
    415         return float_relation_less;
     406        return -1;
    416407    } else if (a == b) {
    417         return float_relation_equal;
     408        return 0;
    418409    } else if (isgreater(a, b)) {
    419         return float_relation_greater;
    420     } else {
    421         return float_relation_unordered;
     410        return 1;
     411    } else {
     412        return 2;
    422413    }
    423414}
     
    441432    a = u.i;
    442433
    443     return ( LIT64( 0xFFF0000000000000 ) < (bits64) ( a<<1 ) );
     434    return ( LIT64( 0xFFE0000000000000 ) < (bits64) ( a<<1 ) );
    444435
    445436}
     
    493484{
    494485    if (a < b) {
    495         return float_relation_less;
     486        return -1;
    496487    } else if (a == b) {
    497         return float_relation_equal;
     488        return 0;
    498489    } else if (a > b) {
    499         return float_relation_greater;
    500     } else {
    501         return float_relation_unordered;
     490        return 1;
     491    } else {
     492        return 2;
    502493    }
    503494}
     
    505496{
    506497    if (isless(a, b)) {
    507         return float_relation_less;
     498        return -1;
    508499    } else if (a == b) {
    509         return float_relation_equal;
     500        return 0;
    510501    } else if (isgreater(a, b)) {
    511         return float_relation_greater;
    512     } else {
    513         return float_relation_unordered;
     502        return 1;
     503    } else {
     504        return 2;
    514505    }
    515506}
    516507int floatx80_is_signaling_nan( floatx80 a1)
    517 {
    518     floatx80u u;
    519     uint64_t aLow;
    520     u.f = a1;
    521 
    522     aLow = u.i.low & ~ LIT64( 0x4000000000000000 );
    523     return
    524            ( ( u.i.high & 0x7FFF ) == 0x7FFF )
    525         && (bits64) ( aLow<<1 )
    526         && ( u.i.low == aLow );
    527 }
    528 
    529 int floatx80_is_nan( floatx80 a1 )
    530508{
    531509    floatx80u u;
  • trunk/src/recompiler/fpu/softfloat-native.h

    r36125 r36140  
    44#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS)
    55#include <ieeefp.h>
    6 #elif defined(_MSC_VER)
    7 # include <fpieee.h>
    8 # ifndef fabsf
    9 #  define fabsf(f) ((float)fabs(f))
    10 # endif
     6#define fabsf(f) ((float)fabs(f))
    117#else
    128#include <fenv.h>
    139#endif
    1410
    15 #if defined(__OpenBSD__) || defined(__NetBSD__)
     11#ifdef __OpenBSD__
     12/* Get OpenBSD version number */
    1613#include <sys/param.h>
    1714#endif
     
    3936#endif
    4037
    41 #ifdef __NetBSD__
    42 #ifndef isgreater
    43 #define isgreater(x, y)         __builtin_isgreater(x, y)
    44 #endif
    45 #ifndef isgreaterequal
    46 #define isgreaterequal(x, y)    __builtin_isgreaterequal(x, y)
    47 #endif
    48 #ifndef isless
    49 #define isless(x, y)            __builtin_isless(x, y)
    50 #endif
    51 #ifndef islessequal
    52 #define islessequal(x, y)       __builtin_islessequal(x, y)
    53 #endif
    54 #ifndef isunordered
    55 #define isunordered(x, y)       __builtin_isunordered(x, y)
    56 #endif
    57 #endif
    58 
    59 
    6038#define isnormal(x)             (fpclass(x) >= FP_NZERO)
    6139#define isgreater(x, y)         ((!unordered(x, y)) && ((x) > (y)))
     
    145123
    146124typedef struct float_status {
    147     int float_rounding_mode;
    148 #ifdef FLOATX80
    149     int floatx80_rounding_precision;
     125    signed char float_rounding_mode;
     126#ifdef FLOATX80
     127    signed char floatx80_rounding_precision;
    150128#endif
    151129} float_status;
     
    251229int float32_compare_quiet( float32, float32 STATUS_PARAM );
    252230int float32_is_signaling_nan( float32 );
    253 int float32_is_nan( float32 );
    254231
    255232INLINE float32 float32_abs(float32 a)
     
    261238{
    262239    return -a;
    263 }
    264 
    265 INLINE float32 float32_is_infinity(float32 a)
    266 {
    267     return fpclassify(a) == FP_INFINITE;
    268 }
    269 
    270 INLINE float32 float32_is_neg(float32 a)
    271 {
    272     float32u u;
    273     u.f = a;
    274     return u.i >> 31;
    275 }
    276 
    277 INLINE float32 float32_is_zero(float32 a)
    278 {
    279     return fpclassify(a) == FP_ZERO;
    280240}
    281241
     
    372332}
    373333
    374 INLINE float64 float64_is_infinity(float64 a)
    375 {
    376     return fpclassify(a) == FP_INFINITE;
    377 }
    378 
    379 INLINE float64 float64_is_neg(float64 a)
    380 {
    381     float64u u;
    382     u.f = a;
    383     return u.i >> 63;
    384 }
    385 
    386 INLINE float64 float64_is_zero(float64 a)
    387 {
    388     return fpclassify(a) == FP_ZERO;
    389 }
    390 
    391334INLINE float64 float64_scalbn(float64 a, int n)
    392335{
     
    464407int floatx80_compare_quiet( floatx80, floatx80 STATUS_PARAM );
    465408int floatx80_is_signaling_nan( floatx80 );
    466 int floatx80_is_nan( floatx80 );
    467409
    468410INLINE floatx80 floatx80_abs(floatx80 a)
     
    476418}
    477419
    478 INLINE floatx80 floatx80_is_infinity(floatx80 a)
    479 {
    480     return fpclassify(a) == FP_INFINITE;
    481 }
    482 
    483 INLINE floatx80 floatx80_is_neg(floatx80 a)
    484 {
    485     floatx80u u;
    486     u.f = a;
    487     return u.i.high >> 15;
    488 }
    489 
    490 INLINE floatx80 floatx80_is_zero(floatx80 a)
    491 {
    492     return fpclassify(a) == FP_ZERO;
    493 }
    494 
    495420INLINE floatx80 floatx80_scalbn(floatx80 a, int n)
    496421{
  • trunk/src/recompiler/fpu/softfloat-specialize.h

    r21292 r36140  
    3838
    3939/*----------------------------------------------------------------------------
     40| Underflow tininess-detection mode, statically initialized to default value.
     41| (The declaration in `softfloat.h' must match the `int8' type here.)
     42*----------------------------------------------------------------------------*/
     43int8 float_detect_tininess = float_tininess_after_rounding;
     44
     45/*----------------------------------------------------------------------------
    4046| Raises the exceptions specified by `flags'.  Floating-point traps can be
    4147| defined here if desired.  It is currently not possible for such a trap
     
    6268#if defined(TARGET_SPARC)
    6369#define float32_default_nan make_float32(0x7FFFFFFF)
    64 #elif defined(TARGET_POWERPC) || defined(TARGET_ARM)
     70#elif defined(TARGET_POWERPC)
    6571#define float32_default_nan make_float32(0x7FC00000)
    6672#elif defined(TARGET_HPPA)
     
    144150    flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN;
    145151    bits32 av, bv, res;
    146 
    147     if ( STATUS(default_nan_mode) )
    148         return float32_default_nan;
    149152
    150153    aIsNaN = float32_is_nan( a );
     
    190193#if defined(TARGET_SPARC)
    191194#define float64_default_nan make_float64(LIT64( 0x7FFFFFFFFFFFFFFF ))
    192 #elif defined(TARGET_POWERPC) || defined(TARGET_ARM)
     195#elif defined(TARGET_POWERPC)
    193196#define float64_default_nan make_float64(LIT64( 0x7FF8000000000000 ))
    194197#elif defined(TARGET_HPPA)
     
    279282    flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN;
    280283    bits64 av, bv, res;
    281 
    282     if ( STATUS(default_nan_mode) )
    283         return float64_default_nan;
    284284
    285285    aIsNaN = float64_is_nan( a );
     
    419419    flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN;
    420420
    421     if ( STATUS(default_nan_mode) ) {
    422         a.low = floatx80_default_nan_low;
    423         a.high = floatx80_default_nan_high;
    424         return a;
    425     }
    426 
    427421    aIsNaN = floatx80_is_nan( a );
    428422    aIsSignalingNaN = floatx80_is_signaling_nan( a );
     
    545539    flag aIsNaN, aIsSignalingNaN, bIsNaN, bIsSignalingNaN;
    546540
    547     if ( STATUS(default_nan_mode) ) {
    548         a.low = float128_default_nan_low;
    549         a.high = float128_default_nan_high;
    550         return a;
    551     }
    552 
    553541    aIsNaN = float128_is_nan( a );
    554542    aIsSignalingNaN = float128_is_signaling_nan( a );
  • trunk/src/recompiler/fpu/softfloat.c

    r21292 r36140  
    3131=============================================================================*/
    3232
    33 /* FIXME: Flush-To-Zero only effects results.  Denormal inputs should also
    34    be flushed to zero.  */
    3533#include "softfloat.h"
    3634
     
    297295        }
    298296        if ( zExp < 0 ) {
    299             if ( STATUS(flush_to_zero) ) return packFloat32( zSign, 0, 0 );
    300297            isTiny =
    301298                   ( STATUS(float_detect_tininess) == float_tininess_before_rounding )
     
    461458        }
    462459        if ( zExp < 0 ) {
    463             if ( STATUS(flush_to_zero) ) return packFloat64( zSign, 0, 0 );
    464460            isTiny =
    465461                   ( STATUS(float_detect_tininess) == float_tininess_before_rounding )
     
    640636        }
    641637        if ( zExp <= 0 ) {
    642             if ( STATUS(flush_to_zero) ) return packFloatx80( zSign, 0, 0 );
    643638            isTiny =
    644639                   ( STATUS(float_detect_tininess) == float_tininess_before_rounding )
     
    971966        }
    972967        if ( zExp < 0 ) {
    973             if ( STATUS(flush_to_zero) ) return packFloat128( zSign, 0, 0, 0 );
    974968            isTiny =
    975969                   ( STATUS(float_detect_tininess) == float_tininess_before_rounding )
     
    16441638            return a;
    16451639        }
    1646         if ( aExp == 0 ) {
    1647             if ( STATUS(flush_to_zero) ) return packFloat32( zSign, 0, 0 );
    1648             return packFloat32( zSign, 0, ( aSig + bSig )>>6 );
    1649         }
     1640        if ( aExp == 0 ) return packFloat32( zSign, 0, ( aSig + bSig )>>6 );
    16501641        zSig = 0x40000000 + aSig + bSig;
    16511642        zExp = aExp;
     
    20552046    return roundAndPackFloat32( 0, zExp, zSig STATUS_VAR );
    20562047
    2057 }
    2058 
    2059 /*----------------------------------------------------------------------------
    2060 | Returns the binary log of the single-precision floating-point value `a'.
    2061 | The operation is performed according to the IEC/IEEE Standard for Binary
    2062 | Floating-Point Arithmetic.
    2063 *----------------------------------------------------------------------------*/
    2064 float32 float32_log2( float32 a STATUS_PARAM )
    2065 {
    2066     flag aSign, zSign;
    2067     int16 aExp;
    2068     bits32 aSig, zSig, i;
    2069 
    2070     aSig = extractFloat32Frac( a );
    2071     aExp = extractFloat32Exp( a );
    2072     aSign = extractFloat32Sign( a );
    2073 
    2074     if ( aExp == 0 ) {
    2075         if ( aSig == 0 ) return packFloat32( 1, 0xFF, 0 );
    2076         normalizeFloat32Subnormal( aSig, &aExp, &aSig );
    2077     }
    2078     if ( aSign ) {
    2079         float_raise( float_flag_invalid STATUS_VAR);
    2080         return float32_default_nan;
    2081     }
    2082     if ( aExp == 0xFF ) {
    2083         if ( aSig ) return propagateFloat32NaN( a, float32_zero STATUS_VAR );
    2084         return a;
    2085     }
    2086 
    2087     aExp -= 0x7F;
    2088     aSig |= 0x00800000;
    2089     zSign = aExp < 0;
    2090     zSig = aExp << 23;
    2091 
    2092     for (i = 1 << 22; i > 0; i >>= 1) {
    2093         aSig = ( (bits64)aSig * aSig ) >> 23;
    2094         if ( aSig & 0x01000000 ) {
    2095             aSig >>= 1;
    2096             zSig |= i;
    2097         }
    2098     }
    2099 
    2100     if ( zSign )
    2101         zSig = -zSig;
    2102 
    2103     return normalizeRoundAndPackFloat32( zSign, 0x85, zSig STATUS_VAR );
    21042048}
    21052049
     
    26522596            return a;
    26532597        }
    2654         if ( aExp == 0 ) {
    2655             if ( STATUS(flush_to_zero) ) return packFloat64( zSign, 0, 0 );
    2656             return packFloat64( zSign, 0, ( aSig + bSig )>>9 );
    2657         }
     2598        if ( aExp == 0 ) return packFloat64( zSign, 0, ( aSig + bSig )>>9 );
    26582599        zSig = LIT64( 0x4000000000000000 ) + aSig + bSig;
    26592600        zExp = aExp;
     
    30512992    return roundAndPackFloat64( 0, zExp, zSig STATUS_VAR );
    30522993
    3053 }
    3054 
    3055 /*----------------------------------------------------------------------------
    3056 | Returns the binary log of the double-precision floating-point value `a'.
    3057 | The operation is performed according to the IEC/IEEE Standard for Binary
    3058 | Floating-Point Arithmetic.
    3059 *----------------------------------------------------------------------------*/
    3060 float64 float64_log2( float64 a STATUS_PARAM )
    3061 {
    3062     flag aSign, zSign;
    3063     int16 aExp;
    3064     bits64 aSig, aSig0, aSig1, zSig, i;
    3065 
    3066     aSig = extractFloat64Frac( a );
    3067     aExp = extractFloat64Exp( a );
    3068     aSign = extractFloat64Sign( a );
    3069 
    3070     if ( aExp == 0 ) {
    3071         if ( aSig == 0 ) return packFloat64( 1, 0x7FF, 0 );
    3072         normalizeFloat64Subnormal( aSig, &aExp, &aSig );
    3073     }
    3074     if ( aSign ) {
    3075         float_raise( float_flag_invalid STATUS_VAR);
    3076         return float64_default_nan;
    3077     }
    3078     if ( aExp == 0x7FF ) {
    3079         if ( aSig ) return propagateFloat64NaN( a, float64_zero STATUS_VAR );
    3080         return a;
    3081     }
    3082 
    3083     aExp -= 0x3FF;
    3084     aSig |= LIT64( 0x0010000000000000 );
    3085     zSign = aExp < 0;
    3086     zSig = (bits64)aExp << 52;
    3087     for (i = 1LL << 51; i > 0; i >>= 1) {
    3088         mul64To128( aSig, aSig, &aSig0, &aSig1 );
    3089         aSig = ( aSig0 << 12 ) | ( aSig1 >> 52 );
    3090         if ( aSig & LIT64( 0x0020000000000000 ) ) {
    3091             aSig >>= 1;
    3092             zSig |= i;
    3093         }
    3094     }
    3095 
    3096     if ( zSign )
    3097         zSig = -zSig;
    3098     return normalizeRoundAndPackFloat64( zSign, 0x408, zSig STATUS_VAR );
    30992994}
    31002995
     
    47034598        }
    47044599        add128( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1 );
    4705         if ( aExp == 0 ) {
    4706             if ( STATUS(flush_to_zero) ) return packFloat128( zSign, 0, 0, 0 );
    4707             return packFloat128( zSign, 0, zSig0, zSig1 );
    4708         }
     4600        if ( aExp == 0 ) return packFloat128( zSign, 0, zSig0, zSig1 );
    47094601        zSig2 = 0;
    47104602        zSig0 |= LIT64( 0x0002000000000000 );
     
    55885480        return a;
    55895481    }
    5590     if ( aExp != 0 )
    5591         aSig |= 0x00800000;
    5592     else if ( aSig == 0 )
    5593         return a;
    5594 
    5595     aExp += n - 1;
    5596     aSig <<= 7;
    5597     return normalizeRoundAndPackFloat32( aSign, aExp, aSig STATUS_VAR );
     5482    aExp += n;
     5483    return roundAndPackFloat32( aSign, aExp, aSig STATUS_VAR );
    55985484}
    55995485
     
    56115497        return a;
    56125498    }
    5613     if ( aExp != 0 )
    5614         aSig |= LIT64( 0x0010000000000000 );
    5615     else if ( aSig == 0 )
    5616         return a;
    5617 
    5618     aExp += n - 1;
    5619     aSig <<= 10;
    5620     return normalizeRoundAndPackFloat64( aSign, aExp, aSig STATUS_VAR );
     5499    aExp += n;
     5500    return roundAndPackFloat64( aSign, aExp, aSig STATUS_VAR );
    56215501}
    56225502
     
    56355515        return a;
    56365516    }
    5637     if (aExp == 0 && aSig == 0)
    5638         return a;
    5639 
    56405517    aExp += n;
    5641     return normalizeRoundAndPackFloatx80( STATUS(floatx80_rounding_precision),
    5642                                           aSign, aExp, aSig, 0 STATUS_VAR );
     5518    return roundAndPackFloatx80( STATUS(floatx80_rounding_precision),
     5519                                 aSign, aExp, aSig, 0 STATUS_VAR );
    56435520}
    56445521#endif
     
    56585535        return a;
    56595536    }
    5660     if ( aExp != 0 )
    5661         aSig0 |= LIT64( 0x0001000000000000 );
    5662     else if ( aSig0 == 0 && aSig1 == 0 )
    5663         return a;
    5664 
    5665     aExp += n - 1;
    5666     return normalizeRoundAndPackFloat128( aSign, aExp, aSig0, aSig1
    5667                                           STATUS_VAR );
     5537    aExp += n;
     5538    return roundAndPackFloat128( aSign, aExp, aSig0, aSig1, 0 STATUS_VAR );
    56685539
    56695540}
  • trunk/src/recompiler/fpu/softfloat.h

    r26499 r36140  
    5555typedef uint8_t uint8;
    5656typedef int8_t int8;
    57 #ifndef _AIX
    5857typedef int uint16;
    5958typedef int int16;
    60 #endif
    6159typedef unsigned int uint32;
    6260typedef signed int int32;
     
    9593#else
    9694/* native float support */
    97 #if (defined(__i386__) || defined(__x86_64__)) && (!defined(_BSD) || defined(VBOX))
     95#if (defined(__i386__) || defined(__x86_64__)) && (!defined(_BSD) || defined(VBOX)) /** @todo VBOX: not correct on windows */
    9896#define FLOATX80
    9997#endif
     
    199197    signed char floatx80_rounding_precision;
    200198#endif
    201     flag flush_to_zero;
    202     flag default_nan_mode;
    203199} float_status;
    204200
    205201void set_float_rounding_mode(int val STATUS_PARAM);
    206202void set_float_exception_flags(int val STATUS_PARAM);
    207 INLINE void set_flush_to_zero(flag val STATUS_PARAM)
    208 {
    209     STATUS(flush_to_zero) = val;
    210 }
    211 INLINE void set_default_nan_mode(flag val STATUS_PARAM)
    212 {
    213     STATUS(default_nan_mode) = val;
    214 }
    215203INLINE int get_float_exception_flags(float_status *status)
    216204{
     
    278266float32 float32_rem( float32, float32 STATUS_PARAM );
    279267float32 float32_sqrt( float32 STATUS_PARAM );
    280 float32 float32_log2( float32 STATUS_PARAM );
    281268int float32_eq( float32, float32 STATUS_PARAM );
    282269int float32_le( float32, float32 STATUS_PARAM );
     
    301288}
    302289
    303 INLINE int float32_is_infinity(float32 a)
    304 {
    305     return (float32_val(a) & 0x7fffffff) == 0x7f800000;
    306 }
    307 
    308 INLINE int float32_is_neg(float32 a)
    309 {
    310     return float32_val(a) >> 31;
    311 }
    312 
    313 INLINE int float32_is_zero(float32 a)
    314 {
    315     return (float32_val(a) & 0x7fffffff) == 0;
    316 }
    317 
    318290#define float32_zero make_float32(0)
    319 #define float32_one make_float32(0x3f800000)
    320291
    321292/*----------------------------------------------------------------------------
     
    349320float64 float64_rem( float64, float64 STATUS_PARAM );
    350321float64 float64_sqrt( float64 STATUS_PARAM );
    351 float64 float64_log2( float64 STATUS_PARAM );
    352322int float64_eq( float64, float64 STATUS_PARAM );
    353323int float64_le( float64, float64 STATUS_PARAM );
     
    372342}
    373343
    374 INLINE int float64_is_infinity(float64 a)
    375 {
    376     return (float64_val(a) & 0x7fffffffffffffffLL ) == 0x7ff0000000000000LL;
    377 }
    378 
    379 INLINE int float64_is_neg(float64 a)
    380 {
    381     return float64_val(a) >> 63;
    382 }
    383 
    384 INLINE int float64_is_zero(float64 a)
    385 {
    386     return (float64_val(a) & 0x7fffffffffffffffLL) == 0;
    387 }
    388 
    389344#define float64_zero make_float64(0)
    390 #define float64_one make_float64(0x3ff0000000000000LL)
    391345
    392346#ifdef FLOATX80
     
    435389    a.high ^= 0x8000;
    436390    return a;
    437 }
    438 
    439 INLINE int floatx80_is_infinity(floatx80 a)
    440 {
    441     return (a.high & 0x7fff) == 0x7fff && a.low == 0;
    442 }
    443 
    444 INLINE int floatx80_is_neg(floatx80 a)
    445 {
    446     return a.high >> 15;
    447 }
    448 
    449 INLINE int floatx80_is_zero(floatx80 a)
    450 {
    451     return (a.high & 0x7fff) == 0 && a.low == 0;
    452391}
    453392
     
    503442}
    504443
    505 INLINE int float128_is_infinity(float128 a)
    506 {
    507     return (a.high & 0x7fffffffffffffffLL) == 0x7fff000000000000LL && a.low == 0;
    508 }
    509 
    510 INLINE int float128_is_neg(float128 a)
    511 {
    512     return a.high >> 63;
    513 }
    514 
    515 INLINE int float128_is_zero(float128 a)
    516 {
    517     return (a.high & 0x7fffffffffffffffLL) == 0 && a.low == 0;
    518 }
    519 
    520444#endif
    521445
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette