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

Go to the source code of this file.

Functions

void extF80M_mul (const extFloat80_t *aPtr, const extFloat80_t *bPtr, extFloat80_t *zPtr)
 

Function Documentation

◆ extF80M_mul()

void extF80M_mul ( const extFloat80_t * aPtr,
const extFloat80_t * bPtr,
extFloat80_t * zPtr )

Definition at line 58 of file extF80M_mul.c.

60{
61 const struct extFloat80M *aSPtr, *bSPtr;
62 struct extFloat80M *zSPtr;
63 uint_fast16_t uiA64;
64 int32_t expA;
65 uint_fast16_t uiB64;
66 int32_t expB;
67 bool signZ;
68 uint_fast16_t exp, uiZ64;
69 uint64_t uiZ0, sigA, sigB;
70 int32_t expZ;
71 uint32_t sigProd[4], *extSigZPtr;
72
73 /*------------------------------------------------------------------------
74 *------------------------------------------------------------------------*/
75 aSPtr = (const struct extFloat80M *) aPtr;
76 bSPtr = (const struct extFloat80M *) bPtr;
77 zSPtr = (struct extFloat80M *) zPtr;
78 /*------------------------------------------------------------------------
79 *------------------------------------------------------------------------*/
80 uiA64 = aSPtr->signExp;
81 expA = expExtF80UI64( uiA64 );
82 uiB64 = bSPtr->signExp;
83 expB = expExtF80UI64( uiB64 );
84 signZ = signExtF80UI64( uiA64 ) ^ signExtF80UI64( uiB64 );
85 /*------------------------------------------------------------------------
86 *------------------------------------------------------------------------*/
87 if ( (expA == 0x7FFF) || (expB == 0x7FFF) ) {
88 if ( softfloat_tryPropagateNaNExtF80M( aSPtr, bSPtr, zSPtr ) ) return;
89 if (
90 (! aSPtr->signif && (expA != 0x7FFF))
91 || (! bSPtr->signif && (expB != 0x7FFF))
92 ) {
94 return;
95 }
96 uiZ64 = packToExtF80UI64( signZ, 0x7FFF );
97 uiZ0 = UINT64_C( 0x8000000000000000 );
98 goto uiZ;
99 }
100 /*------------------------------------------------------------------------
101 *------------------------------------------------------------------------*/
102 if ( ! expA ) expA = 1;
103 sigA = aSPtr->signif;
104 if ( ! (sigA & UINT64_C( 0x8000000000000000 )) ) {
105 if ( ! sigA ) goto zero;
106 expA += softfloat_normExtF80SigM( &sigA );
107 }
108 if ( ! expB ) expB = 1;
109 sigB = bSPtr->signif;
110 if ( ! (sigB & UINT64_C( 0x8000000000000000 )) ) {
111 if ( ! sigB ) goto zero;
112 expB += softfloat_normExtF80SigM( &sigB );
113 }
114 /*------------------------------------------------------------------------
115 *------------------------------------------------------------------------*/
116 expZ = expA + expB - 0x3FFE;
117 softfloat_mul64To128M( sigA, sigB, sigProd );
118 if ( sigProd[indexWordLo( 4 )] ) sigProd[indexWord( 4, 1 )] |= 1;
119 extSigZPtr = &sigProd[indexMultiwordHi( 4, 3 )];
120 if ( sigProd[indexWordHi( 4 )] < 0x80000000 ) {
121 --expZ;
122 softfloat_add96M( extSigZPtr, extSigZPtr, extSigZPtr );
123 }
125 signZ, expZ, extSigZPtr, extF80_roundingPrecision, zSPtr );
126 return;
127 /*------------------------------------------------------------------------
128 *------------------------------------------------------------------------*/
129 zero:
130 uiZ64 = packToExtF80UI64( signZ, 0 );
131 uiZ0 = 0;
132 uiZ:
133 zSPtr->signExp = uiZ64;
134 zSPtr->signif = uiZ0;
135
136}
#define packToExtF80UI64(sign, exp)
Definition internals.h:148
#define expExtF80UI64(a64)
Definition internals.h:147
void softfloat_invalidExtF80M(struct extFloat80M *)
void softfloat_roundPackMToExtF80M(bool, int32_t, uint32_t *, uint_fast8_t, struct extFloat80M *)
#define signExtF80UI64(a64)
Definition internals.h:146
bool softfloat_tryPropagateNaNExtF80M(const struct extFloat80M *, const struct extFloat80M *, struct extFloat80M *)
int softfloat_normExtF80SigM(uint64_t *)
#define indexMultiwordHi(total, n)
#define indexWordLo(total)
#define indexWord(total, n)
#define indexWordHi(total)
#define softfloat_add96M(aPtr, bPtr, zPtr)
Definition primitives.h:915
void softfloat_mul64To128M(uint64_t a, uint64_t b, uint32_t *zPtr)
THREAD_LOCAL uint_fast8_t extF80_roundingPrecision
unsigned int uint32_t
Definition stdint.h:126
uint16_t uint_fast16_t
Definition stdint.h:155
#define UINT64_C(val)
Definition stdint.h:284
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: