Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
|
#include "gd_qnan.h"
#include "gdtoa.h"
#include "stdlib.h"
#include "string.h"
#include "errno.h"
#include "float.h"
#include "math.h"
Go to the source code of this file.
Classes | |
union | U |
struct | Bigint |
Macros | |
#define | Char void |
#define | MALLOC malloc |
#define | word0(x) ((U*)&x)->L[0] |
#define | word1(x) ((U*)&x)->L[1] |
#define | dval(x) ((U*)&x)->d |
#define | Storeinc(a, b, c) (((unsigned short*)a)[0] = (unsigned short)b, ((unsigned short*)a)[1] = (unsigned short)c, a++) |
#define | Sudden_Underflow |
#define | Flt_Rounds 1 |
#define | Exp_shift 23 |
#define | Exp_shift1 7 |
#define | Exp_msk1 0x80 |
#define | Exp_msk11 0x800000 |
#define | Exp_mask 0x7f80 |
#define | P 56 |
#define | Bias 129 |
#define | Exp_1 0x40800000 |
#define | Exp_11 0x4080 |
#define | Ebits 8 |
#define | Frac_mask 0x7fffff |
#define | Frac_mask1 0xffff007f |
#define | Ten_pmax 24 |
#define | Bletch 2 |
#define | Bndry_mask 0xffff007f |
#define | Bndry_mask1 0xffff007f |
#define | LSB 0x10000 |
#define | Sign_bit 0x8000 |
#define | Log2P 1 |
#define | Tiny0 0x80 |
#define | Tiny1 0 |
#define | Quick_max 15 |
#define | Int_max 15 |
#define | ROUND_BIASED |
#define | rounded_product(a, b) a *= b |
#define | rounded_quotient(a, b) a /= b |
#define | Big0 (Frac_mask1 | Exp_msk1 * (DBL_MAX_EXP + Bias - 1)) |
#define | Big1 0xffffffff |
#define | Pack_32 |
#define | Llong long long |
#define | ULLong unsigned Llong |
#define | ULbits 32 |
#define | kshift 5 |
#define | kmask 31 |
#define | ALL_ON 0xffffffff |
#define | ACQUIRE_DTOA_LOCK(n) /*nothing*/ |
#define | FREE_DTOA_LOCK(n) /*nothing*/ |
#define | Kmax 15 |
#define | Bcopy(x, y) memcpy(&x->sign, &y->sign, (size_t)(y->wds) * sizeof(ULong) + 2 * sizeof(int)) |
#define | Balloc Balloc_D2A |
#define | Bfree Bfree_D2A |
#define | ULtoQ ULtoQ_D2A |
#define | ULtof ULtof_D2A |
#define | ULtod ULtod_D2A |
#define | ULtodd ULtodd_D2A |
#define | ULtox ULtox_D2A |
#define | ULtoxL ULtoxL_D2A |
#define | any_on any_on_D2A |
#define | b2d b2d_D2A |
#define | bigtens bigtens_D2A |
#define | cmp cmp_D2A |
#define | copybits copybits_D2A |
#define | d2b d2b_D2A |
#define | decrement decrement_D2A |
#define | diff diff_D2A |
#define | dtoa_result dtoa_result_D2A |
#define | g__fmt g__fmt_D2A |
#define | gethex gethex_D2A |
#define | hexdig hexdig_D2A |
#define | hexnan hexnan_D2A |
#define | hi0bits(x) hi0bits_D2A((ULong)(x)) |
#define | i2b i2b_D2A |
#define | increment increment_D2A |
#define | lo0bits lo0bits_D2A |
#define | lshift lshift_D2A |
#define | match match_D2A |
#define | mult mult_D2A |
#define | multadd multadd_D2A |
#define | nrv_alloc nrv_alloc_D2A |
#define | pow5mult pow5mult_D2A |
#define | quorem quorem_D2A |
#define | ratio ratio_D2A |
#define | rshift rshift_D2A |
#define | rv_alloc rv_alloc_D2A |
#define | s2b s2b_D2A |
#define | set_ones set_ones_D2A |
#define | strcp strcp_D2A |
#define | strtoIg strtoIg_D2A |
#define | sum sum_D2A |
#define | tens tens_D2A |
#define | tinytens tinytens_D2A |
#define | tinytens tinytens_D2A |
#define | trailz trailz_D2A |
#define | ulp ulp_D2A |
#define | SI 1 |
Typedefs | |
typedef struct Bigint | Bigint |
Functions | |
Bigint *Balloc | ANSI ((int)) |
void Bfree | ANSI ((Bigint *)) |
void ULtof | ANSI ((ULong *, const ULong *, Long, int)) |
void ULtodd | ANSI ((ULong *, ULong *, Long, int)) |
void ULtox | ANSI ((UShort *, const ULong *, Long, int)) |
ULong any_on | ANSI ((Bigint *, int)) |
double b2d | ANSI ((Bigint *, int *)) |
int cmp | ANSI ((Bigint *, Bigint *)) |
void copybits | ANSI ((ULong *, int, Bigint *)) |
Bigint *d2b | ANSI ((double, int *, int *)) |
char *dtoa | ANSI ((double d, int mode, int ndigits, int *decpt, int *sign, char **rve)) |
char *g__fmt | ANSI ((char *, char *, const char *, int, ULong)) |
int gethex | ANSI ((CONST char **, FPI *, Long *, Bigint **, int)) |
void | hexdig_init_D2A (Void) |
int hexnan | ANSI ((CONST char **, FPI *, ULong *)) |
int hi0bits_D2A | ANSI ((ULong)) |
int lo0bits | ANSI ((ULong *)) |
int match | ANSI ((CONST char **, char *)) |
Bigint *multadd | ANSI ((Bigint *, int, int)) |
char *nrv_alloc | ANSI ((char *, char **, int)) |
Bigint *s2b | ANSI ((CONST char *, int, int, ULong)) |
char *strcp | ANSI ((char *, const char *)) |
int strtoIg | ANSI ((CONST char *, char **, FPI *, Long *, Bigint **, int *)) |
double strtod | ANSI ((const char *s00, char **se)) |
double ulp | ANSI ((double)) |
Variables | |
Exactly one of | IEEE_8087 |
Exactly one of | IEEE_MC68k |
Exactly one of | VAX |
char * | dtoa_result |
CONST double | bigtens [] |
CONST double | tens [] |
CONST double | tinytens [] |
unsigned char | hexdig [] |
union U |
Definition at line 284 of file gdtoaimp.h.
Class Members | ||
---|---|---|
double | d | |
ULong | L[2] |
struct Bigint |
Definition at line 484 of file gdtoaimp.h.
Class Members | ||
---|---|---|
int | k | |
int | maxwds | |
struct Bigint * | next | |
int | sign | |
int | wds | |
ULong | x[1] |
#define ACQUIRE_DTOA_LOCK | ( | n | ) | /*nothing*/ |
Definition at line 478 of file gdtoaimp.h.
#define ALL_ON 0xffffffff |
Definition at line 469 of file gdtoaimp.h.
#define any_on any_on_D2A |
Definition at line 512 of file gdtoaimp.h.
#define b2d b2d_D2A |
Definition at line 513 of file gdtoaimp.h.
#define Balloc Balloc_D2A |
Definition at line 504 of file gdtoaimp.h.
#define Bcopy | ( | x, | |
y | |||
) | memcpy(&x->sign, &y->sign, (size_t)(y->wds) * sizeof(ULong) + 2 * sizeof(int)) |
Definition at line 501 of file gdtoaimp.h.
#define Bfree Bfree_D2A |
Definition at line 505 of file gdtoaimp.h.
#define Bias 129 |
Definition at line 400 of file gdtoaimp.h.
#define Big0 (Frac_mask1 | Exp_msk1 * (DBL_MAX_EXP + Bias - 1)) |
Definition at line 437 of file gdtoaimp.h.
#define Big1 0xffffffff |
Definition at line 438 of file gdtoaimp.h.
#define bigtens bigtens_D2A |
Definition at line 514 of file gdtoaimp.h.
#define Bletch 2 |
Definition at line 407 of file gdtoaimp.h.
#define Bndry_mask 0xffff007f |
Definition at line 408 of file gdtoaimp.h.
#define Bndry_mask1 0xffff007f |
Definition at line 409 of file gdtoaimp.h.
#define Char void |
Definition at line 200 of file gdtoaimp.h.
#define cmp cmp_D2A |
Definition at line 515 of file gdtoaimp.h.
#define copybits copybits_D2A |
Definition at line 516 of file gdtoaimp.h.
#define d2b d2b_D2A |
Definition at line 517 of file gdtoaimp.h.
#define decrement decrement_D2A |
Definition at line 518 of file gdtoaimp.h.
#define diff diff_D2A |
Definition at line 519 of file gdtoaimp.h.
#define dtoa_result dtoa_result_D2A |
Definition at line 520 of file gdtoaimp.h.
#define dval | ( | x | ) | ((U*)&x)->d |
Definition at line 307 of file gdtoaimp.h.
#define Ebits 8 |
Definition at line 403 of file gdtoaimp.h.
#define Exp_1 0x40800000 |
Definition at line 401 of file gdtoaimp.h.
#define Exp_11 0x4080 |
Definition at line 402 of file gdtoaimp.h.
#define Exp_mask 0x7f80 |
Definition at line 398 of file gdtoaimp.h.
#define Exp_msk1 0x80 |
Definition at line 396 of file gdtoaimp.h.
#define Exp_msk11 0x800000 |
Definition at line 397 of file gdtoaimp.h.
#define Exp_shift 23 |
Definition at line 394 of file gdtoaimp.h.
#define Exp_shift1 7 |
Definition at line 395 of file gdtoaimp.h.
#define Flt_Rounds 1 |
Definition at line 393 of file gdtoaimp.h.
#define Frac_mask 0x7fffff |
Definition at line 404 of file gdtoaimp.h.
#define Frac_mask1 0xffff007f |
Definition at line 405 of file gdtoaimp.h.
#define FREE_DTOA_LOCK | ( | n | ) | /*nothing*/ |
Definition at line 479 of file gdtoaimp.h.
#define g__fmt g__fmt_D2A |
Definition at line 521 of file gdtoaimp.h.
#define gethex gethex_D2A |
Definition at line 522 of file gdtoaimp.h.
#define hexdig hexdig_D2A |
Definition at line 523 of file gdtoaimp.h.
#define hexnan hexnan_D2A |
Definition at line 524 of file gdtoaimp.h.
#define hi0bits | ( | x | ) | hi0bits_D2A((ULong)(x)) |
Definition at line 525 of file gdtoaimp.h.
#define i2b i2b_D2A |
Definition at line 526 of file gdtoaimp.h.
#define increment increment_D2A |
Definition at line 527 of file gdtoaimp.h.
#define Int_max 15 |
Definition at line 416 of file gdtoaimp.h.
#define kmask 31 |
Definition at line 468 of file gdtoaimp.h.
#define Kmax 15 |
Definition at line 482 of file gdtoaimp.h.
#define kshift 5 |
Definition at line 467 of file gdtoaimp.h.
#define Llong long long |
Definition at line 458 of file gdtoaimp.h.
#define lo0bits lo0bits_D2A |
Definition at line 528 of file gdtoaimp.h.
#define Log2P 1 |
Definition at line 412 of file gdtoaimp.h.
#define LSB 0x10000 |
Definition at line 410 of file gdtoaimp.h.
#define lshift lshift_D2A |
Definition at line 529 of file gdtoaimp.h.
#define MALLOC malloc |
Definition at line 206 of file gdtoaimp.h.
#define match match_D2A |
Definition at line 530 of file gdtoaimp.h.
#define mult mult_D2A |
Definition at line 531 of file gdtoaimp.h.
#define multadd multadd_D2A |
Definition at line 532 of file gdtoaimp.h.
#define nrv_alloc nrv_alloc_D2A |
Definition at line 533 of file gdtoaimp.h.
#define P 56 |
Definition at line 399 of file gdtoaimp.h.
#define Pack_32 |
Definition at line 442 of file gdtoaimp.h.
#define pow5mult pow5mult_D2A |
Definition at line 534 of file gdtoaimp.h.
#define Quick_max 15 |
Definition at line 415 of file gdtoaimp.h.
#define quorem quorem_D2A |
Definition at line 535 of file gdtoaimp.h.
#define ratio ratio_D2A |
Definition at line 536 of file gdtoaimp.h.
#define ROUND_BIASED |
Definition at line 421 of file gdtoaimp.h.
#define rounded_product | ( | a, | |
b | |||
) | a *= b |
Definition at line 433 of file gdtoaimp.h.
#define rounded_quotient | ( | a, | |
b | |||
) | a /= b |
Definition at line 434 of file gdtoaimp.h.
#define rshift rshift_D2A |
Definition at line 537 of file gdtoaimp.h.
#define rv_alloc rv_alloc_D2A |
Definition at line 538 of file gdtoaimp.h.
#define s2b s2b_D2A |
Definition at line 539 of file gdtoaimp.h.
#define set_ones set_ones_D2A |
Definition at line 540 of file gdtoaimp.h.
#define SI 1 |
Definition at line 635 of file gdtoaimp.h.
#define Sign_bit 0x8000 |
Definition at line 411 of file gdtoaimp.h.
#define Storeinc | ( | a, | |
b, | |||
c | |||
) | (((unsigned short*)a)[0] = (unsigned short)b, ((unsigned short*)a)[1] = (unsigned short)c, a++) |
Definition at line 318 of file gdtoaimp.h.
#define strcp strcp_D2A |
Definition at line 541 of file gdtoaimp.h.
#define strtoIg strtoIg_D2A |
Definition at line 542 of file gdtoaimp.h.
#define Sudden_Underflow |
Definition at line 364 of file gdtoaimp.h.
#define sum sum_D2A |
Definition at line 543 of file gdtoaimp.h.
#define Ten_pmax 24 |
Definition at line 406 of file gdtoaimp.h.
#define tens tens_D2A |
Definition at line 544 of file gdtoaimp.h.
#define Tiny0 0x80 |
Definition at line 413 of file gdtoaimp.h.
#define Tiny1 0 |
Definition at line 414 of file gdtoaimp.h.
#define tinytens tinytens_D2A |
Definition at line 546 of file gdtoaimp.h.
#define tinytens tinytens_D2A |
Definition at line 546 of file gdtoaimp.h.
#define trailz trailz_D2A |
Definition at line 547 of file gdtoaimp.h.
#define ULbits 32 |
Definition at line 466 of file gdtoaimp.h.
#define ULLong unsigned Llong |
Definition at line 461 of file gdtoaimp.h.
#define ulp ulp_D2A |
Definition at line 548 of file gdtoaimp.h.
#define ULtod ULtod_D2A |
Definition at line 508 of file gdtoaimp.h.
#define ULtodd ULtodd_D2A |
Definition at line 509 of file gdtoaimp.h.
#define ULtof ULtof_D2A |
Definition at line 507 of file gdtoaimp.h.
#define ULtoQ ULtoQ_D2A |
Definition at line 506 of file gdtoaimp.h.
#define ULtox ULtox_D2A |
Definition at line 510 of file gdtoaimp.h.
#define ULtoxL ULtoxL_D2A |
Definition at line 511 of file gdtoaimp.h.
#define word0 | ( | x | ) | ((U*)&x)->L[0] |
Definition at line 304 of file gdtoaimp.h.
#define word1 | ( | x | ) | ((U*)&x)->L[1] |
Definition at line 305 of file gdtoaimp.h.
Definition at line 491 of file gdtoaimp.h.
char *rv_alloc ANSI | ( | (int) | ) |
char* dtoa ANSI | ( | (double d, int mode, int ndigits, int *decpt, int *sign, char **rve) | ) |
int hi0bits_D2A ANSI | ( | (ULong) | ) |
char* nrv_alloc ANSI | ( | (char *, char **, int) | ) |
char* strcp ANSI | ( | (char *, const char *) | ) |
double strtod ANSI | ( | (const char *s00, char **se) | ) |
double ulp ANSI | ( | (double) | ) |
void hexdig_init_D2A | ( | Void | ) |
char* dtoa_result |
Definition at line 35 of file dmisc.c.
Referenced by freedtoa(), and rv_alloc().
unsigned char hexdig[] |
Definition at line 34 of file hd_init.c.
Referenced by hexdig_init_D2A().
Exactly one of IEEE_8087 |
Definition at line 281 of file gdtoaimp.h.
Exactly one of IEEE_MC68k |
Definition at line 281 of file gdtoaimp.h.
Exactly one of VAX |
Definition at line 281 of file gdtoaimp.h.