Ignore:
Timestamp:
2011-08-17T18:04:50Z (13 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0cf27ee
Parents:
e898296d (diff), e6165be (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge libposix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/softfloat/include/sftypes.h

    re898296d r3e01316f  
    11/*
    22 * Copyright (c) 2005 Josef Cejka
     3 * Copyright (c) 2011 Petr Koupy
    34 * All rights reserved.
    45 *
     
    3031 * @{
    3132 */
    32 /** @file
     33/** @file Floating point types and constants.
    3334 */
    3435
     
    7778} float64;
    7879
    79 #define FLOAT32_MAX  0x7f800000
    80 #define FLOAT32_MIN  0xff800000
    81 #define FLOAT64_MAX
    82 #define FLOAT64_MIN
     80typedef union {
     81        long double ld;
     82        struct {
     83#if defined(__BE__)
     84                uint64_t hi;
     85                uint64_t lo;
     86#elif defined(__LE__)
     87                uint64_t lo;
     88                uint64_t hi;
     89#else
     90        #error Unknown endianess
     91#endif
     92        } binary;
     93
     94        struct {
     95#if defined(__BE__)
     96                uint64_t sign : 1;
     97                uint64_t exp : 15;
     98                uint64_t frac_hi : 48;
     99                uint64_t frac_lo : 64;
     100#elif defined(__LE__)
     101                uint64_t frac_lo : 64;
     102                uint64_t frac_hi : 48;
     103                uint64_t exp : 15;
     104                uint64_t sign : 1;
     105#else
     106        #error Unknown endianess
     107#endif
     108        } parts __attribute__ ((packed));
     109} float128;
    83110
    84111/*
    85  * For recognizing NaNs or infinity use isFloat32NaN and is Float32Inf,
     112 * For recognizing NaNs or infinity use specialized comparison functions,
    86113 * comparing with these constants is not sufficient.
    87114 */
     
    95122#define FLOAT64_INF     0x7FF0000000000000ll
    96123
    97 #define FLOAT32_FRACTION_SIZE  23
    98 #define FLOAT64_FRACTION_SIZE  52
     124#define FLOAT128_NAN_HI     0x7FFF800000000000ll
     125#define FLOAT128_NAN_LO     0x0000000000000001ll
     126#define FLOAT128_SIGNAN_HI  0x7FFF000000000000ll
     127#define FLOAT128_SIGNAN_LO  0x0000000000000001ll
     128#define FLOAT128_INF_HI     0x7FFF000000000000ll
     129#define FLOAT128_INF_LO     0x0000000000000000ll
    99130
    100 #define FLOAT32_HIDDEN_BIT_MASK  0x800000
    101 #define FLOAT64_HIDDEN_BIT_MASK  0x10000000000000ll
     131#define FLOAT32_FRACTION_SIZE   23
     132#define FLOAT64_FRACTION_SIZE   52
     133#define FLOAT128_FRACTION_SIZE 112
     134#define FLOAT128_FRAC_HI_SIZE   48
     135#define FLOAT128_FRAC_LO_SIZE   64
     136
     137#define FLOAT32_HIDDEN_BIT_MASK      0x800000
     138#define FLOAT64_HIDDEN_BIT_MASK      0x10000000000000ll
     139#define FLOAT128_HIDDEN_BIT_MASK_HI  0x1000000000000ll
     140#define FLOAT128_HIDDEN_BIT_MASK_LO  0x0000000000000000ll
    102141
    103142#define FLOAT32_MAX_EXPONENT  0xFF
    104143#define FLOAT64_MAX_EXPONENT  0x7FF
     144#define FLOAT128_MAX_EXPONENT 0x7FFF
    105145
    106146#define FLOAT32_BIAS  0x7F
    107147#define FLOAT64_BIAS  0x3FF
    108148#define FLOAT80_BIAS  0x3FFF
     149#define FLOAT128_BIAS 0x3FFF
    109150
    110151#endif
Note: See TracChangeset for help on using the changeset viewer.