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

Go to the source code of this file.

Functions

void f128M_to_extF80M (const float128_t *aPtr, extFloat80_t *zPtr)
 

Function Documentation

◆ f128M_to_extF80M()

void f128M_to_extF80M ( const float128_t * aPtr,
extFloat80_t * zPtr )

Definition at line 55 of file f128M_to_extF80M.c.

56{
57 const uint32_t *aWPtr;
58 struct extFloat80M *zSPtr;
59 uint32_t uiA96;
60 bool sign;
61 int32_t exp;
62 struct commonNaN commonNaN;
63 uint32_t sig[4];
64
65 /*------------------------------------------------------------------------
66 *------------------------------------------------------------------------*/
67 aWPtr = (const uint32_t *) aPtr;
68 zSPtr = (struct extFloat80M *) zPtr;
69 /*------------------------------------------------------------------------
70 *------------------------------------------------------------------------*/
71 uiA96 = aWPtr[indexWordHi( 4 )];
72 sign = signF128UI96( uiA96 );
73 exp = expF128UI96( uiA96 );
74 /*------------------------------------------------------------------------
75 *------------------------------------------------------------------------*/
76 if ( exp == 0x7FFF ) {
77 if ( softfloat_isNaNF128M( aWPtr ) ) {
80 return;
81 }
82 zSPtr->signExp = packToExtF80UI64( sign, 0x7FFF );
83 zSPtr->signif = UINT64_C( 0x8000000000000000 );
84 return;
85 }
86 /*------------------------------------------------------------------------
87 *------------------------------------------------------------------------*/
88 exp = softfloat_shiftNormSigF128M( aWPtr, 15, sig );
89 if ( exp == -128 ) {
90 zSPtr->signExp = packToExtF80UI64( sign, 0 );
91 zSPtr->signif = 0;
92 return;
93 }
94 if ( sig[indexWord( 4, 0 )] ) sig[indexWord( 4, 1 )] |= 1;
96 sign, exp, &sig[indexMultiwordHi( 4, 3 )], 80, zSPtr );
97
98}
#define softfloat_commonNaNToExtF80M
#define softfloat_f128MToCommonNaN(aWPtr, zPtr)
Definition specialize.h:369
bool softfloat_isNaNF128M(const uint32_t *)
int softfloat_shiftNormSigF128M(const uint32_t *, uint_fast8_t, uint32_t *)
#define packToExtF80UI64(sign, exp)
Definition internals.h:148
void softfloat_roundPackMToExtF80M(bool, int32_t, uint32_t *, uint_fast8_t, struct extFloat80M *)
#define signF128UI96(a96)
Definition internals.h:247
#define expF128UI96(a96)
Definition internals.h:248
#define indexMultiwordHi(total, n)
#define indexWord(total, n)
#define indexWordHi(total)
unsigned int uint32_t
Definition stdint.h:126
#define UINT64_C(val)
Definition stdint.h:284
signed int int32_t
Definition stdint.h:123
uint64_t signif
uint16_t signExp
Here is the call graph for this function: