Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
strtopxL.c File Reference
#include "gdtoaimp.h"
Include dependency graph for strtopxL.c:

Go to the source code of this file.

Functions

int strtopxL (CONST char *s, char **sp, void *V)
 

Function Documentation

◆ strtopxL()

int strtopxL ( CONST char *  s,
char **  sp,
void *  V 
)

Definition at line 56 of file strtopxL.c.

58 {
59  static FPI fpi = {64, 1 - 16383 - 64 + 1, 32766 - 16383 - 64 + 1, 1, SI};
60  ULong bits[2];
61  Long exp;
62  int k;
63  ULong* L = (ULong*)V;
64 
65  k = strtodg(s, sp, &fpi, &exp, bits);
66  switch(k & STRTOG_Retmask)
67  {
68  case STRTOG_NoNumber:
69  case STRTOG_Zero:
70  L[0] = L[1] = L[2] = 0;
71  break;
72 
73  case STRTOG_Normal:
74  case STRTOG_Denormal:
75  case STRTOG_NaNbits:
76  L[_2] = bits[0];
77  L[_1] = bits[1];
78  L[_0] = (unsigned)((exp + 0x3fff + 63) << 16);
79  break;
80 
81  case STRTOG_Infinite:
82  L[_0] = 0x7fff << 16;
83  L[_1] = L[_2] = 0;
84  break;
85 
86  case STRTOG_NaN:
87  L[0] = ld_QNAN0;
88  L[1] = ld_QNAN1;
89  L[2] = ld_QNAN2;
90  }
91  if(k & STRTOG_Neg)
92  {
93  {
94  L[_0] |= 0x80000000L;
95  }
96  }
97  return k;
98 }
#define SI
Definition: gdtoaimp.h:635
unsigned Long ULong
Definition: gdtoa.h:41
Definition: gdtoa.h:86
#define Long
Definition: gdtoa.h:38
int strtodg(CONST char *s00, char **se, FPI *fpi, Long *exp, ULong *bits)
Definition: strtodg.c:443

References Long, SI, strtodg(), STRTOG_Denormal, STRTOG_Infinite, STRTOG_NaN, STRTOG_NaNbits, STRTOG_Neg, STRTOG_NoNumber, STRTOG_Normal, STRTOG_Retmask, and STRTOG_Zero.