Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
f32_to_f64.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#include "internals.h"
#include "specialize.h"
#include "softfloat.h"
Include dependency graph for f32_to_f64.c:

Go to the source code of this file.

Functions

float64_t f32_to_f64 (float32_t a)
 

Function Documentation

◆ f32_to_f64()

float64_t f32_to_f64 ( float32_t a)

Definition at line 44 of file f32_to_f64.c.

45{
46 union ui32_f32 uA;
47 uint_fast32_t uiA;
48 bool sign;
49 int_fast16_t exp;
50 uint_fast32_t frac;
51 struct commonNaN commonNaN;
52 uint_fast64_t uiZ;
53 struct exp16_sig32 normExpSig;
54 union ui64_f64 uZ;
55
56 /*------------------------------------------------------------------------
57 *------------------------------------------------------------------------*/
58 uA.f = a;
59 uiA = uA.ui;
60 sign = signF32UI( uiA );
61 exp = expF32UI( uiA );
62 frac = fracF32UI( uiA );
63 /*------------------------------------------------------------------------
64 *------------------------------------------------------------------------*/
65 if ( exp == 0xFF ) {
66 if ( frac ) {
69 } else {
70 uiZ = packToF64UI( sign, 0x7FF, 0 );
71 }
72 goto uiZ;
73 }
74 /*------------------------------------------------------------------------
75 *------------------------------------------------------------------------*/
76 if ( ! exp ) {
77 if ( ! frac ) {
78 uiZ = packToF64UI( sign, 0, 0 );
79 goto uiZ;
80 }
81 normExpSig = softfloat_normSubnormalF32Sig( frac );
82 exp = normExpSig.exp - 1;
83 frac = normExpSig.sig;
84 }
85 /*------------------------------------------------------------------------
86 *------------------------------------------------------------------------*/
87 uiZ = packToF64UI( sign, exp + 0x380, (uint_fast64_t) frac<<29 );
88 uiZ:
89 uZ.ui = uiZ;
90 return uZ.f;
91
92}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
#define softfloat_f32UIToCommonNaN(uiA, zPtr)
Definition specialize.h:131
#define softfloat_commonNaNToF64UI(aPtr)
Definition specialize.h:172
#define expF32UI(a)
Definition internals.h:105
struct exp16_sig32 softfloat_normSubnormalF32Sig(uint_fast32_t)
#define fracF32UI(a)
Definition internals.h:106
#define packToF64UI(sign, exp, sig)
Definition internals.h:128
#define signF32UI(a)
Definition internals.h:104
uint64_t uint_fast64_t
Definition stdint.h:157
uint32_t uint_fast32_t
Definition stdint.h:156
int16_t int_fast16_t
Definition stdint.h:151
float64_t f
Definition internals.h:47
Here is the call graph for this function:
Here is the caller graph for this function: