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

Go to the source code of this file.

Functions

float64_t extF80M_to_f64 (const extFloat80_t *aPtr)
 

Function Documentation

◆ extF80M_to_f64()

float64_t extF80M_to_f64 ( const extFloat80_t * aPtr)

Definition at line 55 of file extF80M_to_f64.c.

56{
57 const struct extFloat80M *aSPtr;
58 uint_fast16_t uiA64;
59 bool sign;
60 int32_t exp;
61 uint64_t sig;
62 struct commonNaN commonNaN;
63 uint64_t uiZ;
64 union ui64_f64 uZ;
65
66 /*------------------------------------------------------------------------
67 *------------------------------------------------------------------------*/
68 aSPtr = (const struct extFloat80M *) aPtr;
69 /*------------------------------------------------------------------------
70 *------------------------------------------------------------------------*/
71 uiA64 = aSPtr->signExp;
72 sign = signExtF80UI64( uiA64 );
73 exp = expExtF80UI64( uiA64 );
74 sig = aSPtr->signif;
75 /*------------------------------------------------------------------------
76 *------------------------------------------------------------------------*/
77 if ( exp == 0x7FFF ) {
78 if ( sig & UINT64_C( 0x7FFFFFFFFFFFFFFF ) ) {
81 } else {
82 uiZ = packToF64UI( sign, 0x7FF, 0 );
83 }
84 goto uiZ;
85 }
86 /*------------------------------------------------------------------------
87 *------------------------------------------------------------------------*/
88 if ( ! (sig & UINT64_C( 0x8000000000000000 )) ) {
89 if ( ! sig ) {
90 uiZ = packToF64UI( sign, 0, 0 );
91 goto uiZ;
92 }
93 exp += softfloat_normExtF80SigM( &sig );
94 }
95 /*------------------------------------------------------------------------
96 *------------------------------------------------------------------------*/
97 sig = softfloat_shortShiftRightJam64( sig, 1 );
98 exp -= 0x3C01;
99 if ( sizeof (int_fast16_t) < sizeof (int32_t) ) {
100 if ( exp < -0x1000 ) exp = -0x1000;
101 }
102 return softfloat_roundPackToF64( sign, exp, sig );
103 /*------------------------------------------------------------------------
104 *------------------------------------------------------------------------*/
105 uiZ:
106 uZ.ui = uiZ;
107 return uZ.f;
108
109}
#define softfloat_commonNaNToF64UI(aPtr)
Definition specialize.h:172
#define softfloat_extF80MToCommonNaN(aSPtr, zPtr)
Definition specialize.h:318
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
int softfloat_normExtF80SigM(uint64_t *)
uint64_t softfloat_shortShiftRightJam64(uint64_t a, uint_fast8_t dist)
uint16_t uint_fast16_t
Definition stdint.h:155
#define UINT64_C(val)
Definition stdint.h:284
int16_t int_fast16_t
Definition stdint.h:151
signed int int32_t
Definition stdint.h:123
unsigned __int64 uint64_t
Definition stdint.h:136
uint64_t signif
uint16_t signExp
Here is the call graph for this function: