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

Go to the source code of this file.

Functions

bool extF80M_le (const extFloat80_t *aPtr, const extFloat80_t *bPtr)
 

Function Documentation

◆ extF80M_le()

bool extF80M_le ( const extFloat80_t * aPtr,
const extFloat80_t * bPtr )

Definition at line 54 of file extF80M_le.c.

55{
56 const struct extFloat80M *aSPtr, *bSPtr;
57 uint_fast16_t uiA64;
58 uint64_t uiA0;
59 uint_fast16_t uiB64;
60 uint64_t uiB0;
61 bool signA, ltMags;
62
63 /*------------------------------------------------------------------------
64 *------------------------------------------------------------------------*/
65 aSPtr = (const struct extFloat80M *) aPtr;
66 bSPtr = (const struct extFloat80M *) bPtr;
67 /*------------------------------------------------------------------------
68 *------------------------------------------------------------------------*/
69 uiA64 = aSPtr->signExp;
70 uiA0 = aSPtr->signif;
71 uiB64 = bSPtr->signExp;
72 uiB0 = bSPtr->signif;
73 /*------------------------------------------------------------------------
74 *------------------------------------------------------------------------*/
75 if ( isNaNExtF80UI( uiA64, uiA0 ) || isNaNExtF80UI( uiB64, uiB0 ) ) {
77 return false;
78 }
79 /*------------------------------------------------------------------------
80 *------------------------------------------------------------------------*/
81 signA = signExtF80UI64( uiA64 );
82 if ( (uiA64 ^ uiB64) & 0x8000 ) {
83 /*--------------------------------------------------------------------
84 | Signs are different.
85 *--------------------------------------------------------------------*/
86 return signA || ! (uiA0 | uiB0);
87 } else {
88 /*--------------------------------------------------------------------
89 | Signs are the same.
90 *--------------------------------------------------------------------*/
91 if ( ! ((uiA0 & uiB0) & UINT64_C( 0x8000000000000000 )) ) {
92 return (softfloat_compareNonnormExtF80M( aSPtr, bSPtr ) <= 0);
93 }
94 if ( uiA64 == uiB64 ) {
95 if ( uiA0 == uiB0 ) return true;
96 ltMags = (uiA0 < uiB0);
97 } else {
98 ltMags = (uiA64 < uiB64);
99 }
100 return signA ^ ltMags;
101 }
102
103}
void softfloat_raiseFlags(uint_fast8_t flags)
int softfloat_compareNonnormExtF80M(const struct extFloat80M *, const struct extFloat80M *)
#define isNaNExtF80UI(a64, a0)
Definition internals.h:150
#define signExtF80UI64(a64)
Definition internals.h:146
@ softfloat_flag_invalid
Definition softfloat.h:89
uint16_t uint_fast16_t
Definition stdint.h:155
#define UINT64_C(val)
Definition stdint.h:284
unsigned __int64 uint64_t
Definition stdint.h:136
uint64_t signif
uint16_t signExp
Here is the call graph for this function: