Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
extF80_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 extF80_to_f64.c:

Go to the source code of this file.

Functions

float64_t extF80_to_f64 (extFloat80_t a)
 

Function Documentation

◆ extF80_to_f64()

float64_t extF80_to_f64 ( extFloat80_t a)

Definition at line 44 of file extF80_to_f64.c.

45{
46 union { struct extFloat80M s; extFloat80_t f; } uA;
47 uint_fast16_t uiA64;
48 uint_fast64_t uiA0;
49 bool sign;
50 int_fast32_t exp;
51 uint_fast64_t sig;
52 struct commonNaN commonNaN;
53 uint_fast64_t uiZ;
54 union ui64_f64 uZ;
55
56 /*------------------------------------------------------------------------
57 *------------------------------------------------------------------------*/
58 uA.f = a;
59 uiA64 = uA.s.signExp;
60 uiA0 = uA.s.signif;
61 sign = signExtF80UI64( uiA64 );
62 exp = expExtF80UI64( uiA64 );
63 sig = uiA0;
64 /*------------------------------------------------------------------------
65 *------------------------------------------------------------------------*/
66 if ( ! (exp | sig) ) {
67 uiZ = packToF64UI( sign, 0, 0 );
68 goto uiZ;
69 }
70 /*------------------------------------------------------------------------
71 *------------------------------------------------------------------------*/
72 if ( exp == 0x7FFF ) {
73 if ( sig & UINT64_C( 0x7FFFFFFFFFFFFFFF ) ) {
76 } else {
77 uiZ = packToF64UI( sign, 0x7FF, 0 );
78 }
79 goto uiZ;
80 }
81 /*------------------------------------------------------------------------
82 *------------------------------------------------------------------------*/
83 sig = softfloat_shortShiftRightJam64( sig, 1 );
84 exp -= 0x3C01;
85 if ( sizeof (int_fast16_t) < sizeof (int_fast32_t) ) {
86 if ( exp < -0x1000 ) exp = -0x1000;
87 }
88 return softfloat_roundPackToF64( sign, exp, sig );
89 /*------------------------------------------------------------------------
90 *------------------------------------------------------------------------*/
91 uiZ:
92 uZ.ui = uiZ;
93 return uZ.f;
94
95}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
void softfloat_extF80UIToCommonNaN(uint_fast16_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr)
#define softfloat_commonNaNToF64UI(aPtr)
Definition specialize.h:172
float64_t softfloat_roundPackToF64(bool, int_fast16_t, uint_fast64_t)
#define expExtF80UI64(a64)
Definition internals.h:147
#define packToF64UI(sign, exp, sig)
Definition internals.h:128
#define signExtF80UI64(a64)
Definition internals.h:146
uint64_t softfloat_shortShiftRightJam64(uint64_t a, uint_fast8_t dist)
uint16_t uint_fast16_t
Definition stdint.h:155
uint64_t uint_fast64_t
Definition stdint.h:157
#define UINT64_C(val)
Definition stdint.h:284
int32_t int_fast32_t
Definition stdint.h:152
int16_t int_fast16_t
Definition stdint.h:151
float64_t f
Definition internals.h:47
char * s
Here is the call graph for this function: