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

Go to the source code of this file.

Functions

uint_fast16_t softfloat_propagateNaNF16UI (uint_fast16_t uiA, uint_fast16_t uiB)
 

Function Documentation

◆ softfloat_propagateNaNF16UI()

uint_fast16_t softfloat_propagateNaNF16UI ( uint_fast16_t uiA,
uint_fast16_t uiB )

Definition at line 51 of file s_propagateNaNF16UI.c.

52{
53 bool isSigNaNA, isSigNaNB;
54 uint_fast16_t uiNonsigA, uiNonsigB, uiMagA, uiMagB;
55
56 /*------------------------------------------------------------------------
57 *------------------------------------------------------------------------*/
58 isSigNaNA = softfloat_isSigNaNF16UI( uiA );
59 isSigNaNB = softfloat_isSigNaNF16UI( uiB );
60 /*------------------------------------------------------------------------
61 | Make NaNs non-signaling.
62 *------------------------------------------------------------------------*/
63 uiNonsigA = uiA | 0x0200;
64 uiNonsigB = uiB | 0x0200;
65 /*------------------------------------------------------------------------
66 *------------------------------------------------------------------------*/
67 if ( isSigNaNA | isSigNaNB ) {
69 if ( isSigNaNA ) {
70 if ( isSigNaNB ) goto returnLargerMag;
71 return isNaNF16UI( uiB ) ? uiNonsigB : uiNonsigA;
72 } else {
73 return isNaNF16UI( uiA ) ? uiNonsigA : uiNonsigB;
74 }
75 }
76 returnLargerMag:
77 uiMagA = uiA & 0x7FFF;
78 uiMagB = uiB & 0x7FFF;
79 if ( uiMagA < uiMagB ) return uiNonsigB;
80 if ( uiMagB < uiMagA ) return uiNonsigA;
81 return (uiNonsigA < uiNonsigB) ? uiNonsigA : uiNonsigB;
82
83}
void softfloat_raiseFlags(uint_fast8_t flags)
#define softfloat_isSigNaNF16UI(uiA)
Definition specialize.h:95
#define isNaNF16UI(a)
Definition internals.h:88
@ softfloat_flag_invalid
Definition softfloat.h:89
uint16_t uint_fast16_t
Definition stdint.h:155
Here is the call graph for this function: