Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
specialize.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "primitiveTypes.h"
#include "softfloat.h"
Include dependency graph for specialize.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  commonNaN
 

Macros

#define init_detectTininess   softfloat_tininess_afterRounding
 
#define ui32_fromPosOverflow   0xFFFFFFFF
 
#define ui32_fromNegOverflow   0
 
#define ui32_fromNaN   0xFFFFFFFF
 
#define i32_fromPosOverflow   0x7FFFFFFF
 
#define i32_fromNegOverflow   (-0x7FFFFFFF - 1)
 
#define i32_fromNaN   0x7FFFFFFF
 
#define ui64_fromPosOverflow   UINT64_C( 0xFFFFFFFFFFFFFFFF )
 
#define ui64_fromNegOverflow   0
 
#define ui64_fromNaN   UINT64_C( 0xFFFFFFFFFFFFFFFF )
 
#define i64_fromPosOverflow   INT64_C( 0x7FFFFFFFFFFFFFFF )
 
#define i64_fromNegOverflow   (-INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1)
 
#define i64_fromNaN   INT64_C( 0x7FFFFFFFFFFFFFFF )
 
#define defaultNaNF16UI   0x7E00
 
#define softfloat_isSigNaNF16UI(uiA)
 
#define softfloat_f16UIToCommonNaN(uiA, zPtr)
 
#define softfloat_commonNaNToF16UI(aPtr)
 
#define defaultNaNF32UI   0x7FC00000
 
#define softfloat_isSigNaNF32UI(uiA)
 
#define softfloat_f32UIToCommonNaN(uiA, zPtr)
 
#define softfloat_commonNaNToF32UI(aPtr)
 
#define defaultNaNF64UI   UINT64_C( 0x7FF8000000000000 )
 
#define softfloat_isSigNaNF64UI(uiA)
 
#define softfloat_f64UIToCommonNaN(uiA, zPtr)
 
#define softfloat_commonNaNToF64UI(aPtr)
 
#define defaultNaNExtF80UI64   0x7FFF
 
#define defaultNaNExtF80UI0   UINT64_C( 0xC000000000000000 )
 
#define softfloat_isSigNaNExtF80UI(uiA64, uiA0)
 
#define softfloat_extF80MToCommonNaN(aSPtr, zPtr)
 
#define defaultNaNF128UI96   0x7FFF8000
 
#define defaultNaNF128UI64   0
 
#define defaultNaNF128UI32   0
 
#define defaultNaNF128UI0   0
 
#define softfloat_f128MToCommonNaN(aWPtr, zPtr)
 

Functions

uint_fast16_t softfloat_propagateNaNF16UI (uint_fast16_t uiA, uint_fast16_t uiB)
 
uint_fast32_t softfloat_propagateNaNF32UI (uint_fast32_t uiA, uint_fast32_t uiB)
 
uint_fast64_t softfloat_propagateNaNF64UI (uint_fast64_t uiA, uint_fast64_t uiB)
 
void softfloat_commonNaNToExtF80M (const struct commonNaN *aPtr, struct extFloat80M *zSPtr)
 
void softfloat_propagateNaNExtF80M (const struct extFloat80M *aSPtr, const struct extFloat80M *bSPtr, struct extFloat80M *zSPtr)
 
void softfloat_commonNaNToF128M (const struct commonNaN *aPtr, uint32_t *zWPtr)
 
void softfloat_propagateNaNF128M (const uint32_t *aWPtr, const uint32_t *bWPtr, uint32_t *zWPtr)
 

Macro Definition Documentation

◆ defaultNaNExtF80UI0

#define defaultNaNExtF80UI0   UINT64_C( 0xC000000000000000 )

Definition at line 187 of file specialize.h.

◆ defaultNaNExtF80UI64

#define defaultNaNExtF80UI64   0x7FFF

Definition at line 186 of file specialize.h.

◆ defaultNaNF128UI0

#define defaultNaNF128UI0   0

Definition at line 359 of file specialize.h.

◆ defaultNaNF128UI32

#define defaultNaNF128UI32   0

Definition at line 358 of file specialize.h.

◆ defaultNaNF128UI64

#define defaultNaNF128UI64   0

Definition at line 357 of file specialize.h.

◆ defaultNaNF128UI96

#define defaultNaNF128UI96   0x7FFF8000

Definition at line 356 of file specialize.h.

◆ defaultNaNF16UI

#define defaultNaNF16UI   0x7E00

Definition at line 81 of file specialize.h.

◆ defaultNaNF32UI

#define defaultNaNF32UI   0x7FC00000

Definition at line 116 of file specialize.h.

◆ defaultNaNF64UI

#define defaultNaNF64UI   UINT64_C( 0x7FF8000000000000 )

Definition at line 151 of file specialize.h.

◆ i32_fromNaN

#define i32_fromNaN   0x7FFFFFFF

Definition at line 59 of file specialize.h.

◆ i32_fromNegOverflow

#define i32_fromNegOverflow   (-0x7FFFFFFF - 1)

Definition at line 58 of file specialize.h.

◆ i32_fromPosOverflow

#define i32_fromPosOverflow   0x7FFFFFFF

Definition at line 57 of file specialize.h.

◆ i64_fromNaN

#define i64_fromNaN   INT64_C( 0x7FFFFFFFFFFFFFFF )

Definition at line 70 of file specialize.h.

◆ i64_fromNegOverflow

#define i64_fromNegOverflow   (-INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1)

Definition at line 69 of file specialize.h.

◆ i64_fromPosOverflow

#define i64_fromPosOverflow   INT64_C( 0x7FFFFFFFFFFFFFFF )

Definition at line 68 of file specialize.h.

◆ init_detectTininess

#define init_detectTininess   softfloat_tininess_afterRounding

Definition at line 48 of file specialize.h.

◆ softfloat_commonNaNToF16UI

#define softfloat_commonNaNToF16UI ( aPtr)
Value:
#define defaultNaNF16UI
Definition specialize.h:81
uint16_t uint_fast16_t
Definition stdint.h:155

Definition at line 102 of file specialize.h.

◆ softfloat_commonNaNToF32UI

#define softfloat_commonNaNToF32UI ( aPtr)
Value:
#define defaultNaNF32UI
Definition specialize.h:116
uint32_t uint_fast32_t
Definition stdint.h:156

Definition at line 137 of file specialize.h.

◆ softfloat_commonNaNToF64UI

#define softfloat_commonNaNToF64UI ( aPtr)
Value:
#define defaultNaNF64UI
Definition specialize.h:151
uint64_t uint_fast64_t
Definition stdint.h:157

Definition at line 172 of file specialize.h.

◆ softfloat_extF80MToCommonNaN

#define softfloat_extF80MToCommonNaN ( aSPtr,
zPtr )
Value:
if ( ! ((aSPtr)->signif & UINT64_C( 0x4000000000000000 )) ) softfloat_raiseFlags( softfloat_flag_invalid )
void softfloat_raiseFlags(uint_fast8_t flags)
@ softfloat_flag_invalid
Definition softfloat.h:89
#define UINT64_C(val)
Definition stdint.h:284

Definition at line 318 of file specialize.h.

◆ softfloat_f128MToCommonNaN

#define softfloat_f128MToCommonNaN ( aWPtr,
zPtr )
Value:
if ( ! ((aWPtr)[indexWordHi( 4 )] & UINT64_C( 0x0000800000000000 )) ) softfloat_raiseFlags( softfloat_flag_invalid )
#define indexWordHi(total)

Definition at line 369 of file specialize.h.

◆ softfloat_f16UIToCommonNaN

#define softfloat_f16UIToCommonNaN ( uiA,
zPtr )
Value:
if ( ! ((uiA) & 0x0200) ) softfloat_raiseFlags( softfloat_flag_invalid )

Definition at line 96 of file specialize.h.

◆ softfloat_f32UIToCommonNaN

#define softfloat_f32UIToCommonNaN ( uiA,
zPtr )
Value:
if ( ! ((uiA) & 0x00400000) ) softfloat_raiseFlags( softfloat_flag_invalid )

Definition at line 131 of file specialize.h.

◆ softfloat_f64UIToCommonNaN

#define softfloat_f64UIToCommonNaN ( uiA,
zPtr )
Value:
if ( ! ((uiA) & UINT64_C( 0x0008000000000000 )) ) softfloat_raiseFlags( softfloat_flag_invalid )

Definition at line 166 of file specialize.h.

◆ softfloat_isSigNaNExtF80UI

#define softfloat_isSigNaNExtF80UI ( uiA64,
uiA0 )
Value:
((((uiA64) & 0x7FFF) == 0x7FFF) && ! ((uiA0) & UINT64_C( 0x4000000000000000 )) && ((uiA0) & UINT64_C( 0x3FFFFFFFFFFFFFFF )))

Definition at line 195 of file specialize.h.

◆ softfloat_isSigNaNF16UI

#define softfloat_isSigNaNF16UI ( uiA)
Value:
((((uiA) & 0x7E00) == 0x7C00) && ((uiA) & 0x01FF))

Definition at line 88 of file specialize.h.

◆ softfloat_isSigNaNF32UI

#define softfloat_isSigNaNF32UI ( uiA)
Value:
((((uiA) & 0x7FC00000) == 0x7F800000) && ((uiA) & 0x003FFFFF))

Definition at line 123 of file specialize.h.

◆ softfloat_isSigNaNF64UI

#define softfloat_isSigNaNF64UI ( uiA)
Value:
((((uiA) & UINT64_C( 0x7FF8000000000000 )) == UINT64_C( 0x7FF0000000000000 )) && ((uiA) & UINT64_C( 0x0007FFFFFFFFFFFF )))

Definition at line 158 of file specialize.h.

◆ ui32_fromNaN

#define ui32_fromNaN   0xFFFFFFFF

Definition at line 56 of file specialize.h.

◆ ui32_fromNegOverflow

#define ui32_fromNegOverflow   0

Definition at line 55 of file specialize.h.

◆ ui32_fromPosOverflow

#define ui32_fromPosOverflow   0xFFFFFFFF

Definition at line 54 of file specialize.h.

◆ ui64_fromNaN

#define ui64_fromNaN   UINT64_C( 0xFFFFFFFFFFFFFFFF )

Definition at line 67 of file specialize.h.

◆ ui64_fromNegOverflow

#define ui64_fromNegOverflow   0

Definition at line 66 of file specialize.h.

◆ ui64_fromPosOverflow

#define ui64_fromPosOverflow   UINT64_C( 0xFFFFFFFFFFFFFFFF )

Definition at line 65 of file specialize.h.

Function Documentation

◆ softfloat_commonNaNToExtF80M()

void softfloat_commonNaNToExtF80M ( const struct commonNaN * aPtr,
struct extFloat80M * zSPtr )

Definition at line 48 of file s_commonNaNToExtF80M.c.

50{
51
52 zSPtr->signExp = packToExtF80UI64( aPtr->sign, 0x7FFF );
53 zSPtr->signif = UINT64_C( 0xC000000000000000 ) | aPtr->v64>>1;
54
55}
#define packToExtF80UI64(sign, exp)
Definition internals.h:148
uint64_t v64
Definition specialize.h:81
bool sign
Definition specialize.h:77
uint64_t signif
uint16_t signExp

◆ softfloat_commonNaNToF128M()

void softfloat_commonNaNToF128M ( const struct commonNaN * aPtr,
uint32_t * zWPtr )

Definition at line 49 of file s_commonNaNToF128M.c.

50{
51
52 softfloat_shortShiftRight128M( (const uint32_t *) &aPtr->v0, 16, zWPtr );
53 zWPtr[indexWordHi( 4 )] |= (uint32_t) aPtr->sign<<31 | 0x7FFF8000;
54
55}
#define softfloat_shortShiftRight128M(aPtr, dist, zPtr)
Definition primitives.h:782
unsigned int uint32_t
Definition stdint.h:126
uint64_t v0
Definition specialize.h:81

◆ softfloat_propagateNaNExtF80M()

void softfloat_propagateNaNExtF80M ( const struct extFloat80M * aSPtr,
const struct extFloat80M * bSPtr,
struct extFloat80M * zSPtr )

Definition at line 51 of file s_propagateNaNExtF80M.c.

56{
57 bool isSigNaNA;
58 const struct extFloat80M *sPtr;
59 bool isSigNaNB;
60 uint_fast16_t uiB64;
61 uint64_t uiB0;
62 uint_fast16_t uiA64;
63 uint64_t uiA0;
64 uint_fast16_t uiMagA64, uiMagB64;
65
66 isSigNaNA = extF80M_isSignalingNaN( (const extFloat80_t *) aSPtr );
67 sPtr = aSPtr;
68 if ( ! bSPtr ) {
70 goto copy;
71 }
72 isSigNaNB = extF80M_isSignalingNaN( (const extFloat80_t *) bSPtr );
73 if ( isSigNaNA | isSigNaNB ) {
75 if ( isSigNaNA ) {
76 uiB64 = bSPtr->signExp;
77 if ( isSigNaNB ) goto returnLargerUIMag;
78 uiB0 = bSPtr->signif;
79 if ( isNaNExtF80UI( uiB64, uiB0 ) ) goto copyB;
80 goto copy;
81 } else {
82 uiA64 = aSPtr->signExp;
83 uiA0 = aSPtr->signif;
84 if ( isNaNExtF80UI( uiA64, uiA0 ) ) goto copy;
85 goto copyB;
86 }
87 }
88 uiB64 = bSPtr->signExp;
89 returnLargerUIMag:
90 uiA64 = aSPtr->signExp;
91 uiMagA64 = uiA64 & 0x7FFF;
92 uiMagB64 = uiB64 & 0x7FFF;
93 if ( uiMagA64 < uiMagB64 ) goto copyB;
94 if ( uiMagB64 < uiMagA64 ) goto copy;
95 uiA0 = aSPtr->signif;
96 uiB0 = bSPtr->signif;
97 if ( uiA0 < uiB0 ) goto copyB;
98 if ( uiB0 < uiA0 ) goto copy;
99 if ( uiA64 < uiB64 ) goto copy;
100 copyB:
101 sPtr = bSPtr;
102 copy:
103 zSPtr->signExp = sPtr->signExp;
104 zSPtr->signif = sPtr->signif | UINT64_C( 0xC000000000000000 );
105
106}
void copy(const path &from, const path &to)
bool extF80M_isSignalingNaN(const extFloat80_t *aPtr)
#define isNaNExtF80UI(a64, a0)
Definition internals.h:150
unsigned __int64 uint64_t
Definition stdint.h:136

◆ softfloat_propagateNaNF128M()

void softfloat_propagateNaNF128M ( const uint32_t * aWPtr,
const uint32_t * bWPtr,
uint32_t * zWPtr )

Definition at line 53 of file s_propagateNaNF128M.c.

55{
56 bool isSigNaNA;
57 const uint32_t *ptr;
58
59 ptr = aWPtr;
60 isSigNaNA = f128M_isSignalingNaN( (const float128_t *) aWPtr );
61 if (
62 isSigNaNA
63 || (bWPtr && f128M_isSignalingNaN( (const float128_t *) bWPtr ))
64 ) {
66 if ( isSigNaNA ) goto copy;
67 }
68 if ( ! softfloat_isNaNF128M( aWPtr ) ) ptr = bWPtr;
69 copy:
70 zWPtr[indexWordHi( 4 )] = ptr[indexWordHi( 4 )] | 0x00008000;
71 zWPtr[indexWord( 4, 2 )] = ptr[indexWord( 4, 2 )];
72 zWPtr[indexWord( 4, 1 )] = ptr[indexWord( 4, 1 )];
73 zWPtr[indexWord( 4, 0 )] = ptr[indexWord( 4, 0 )];
74
75}
bool f128M_isSignalingNaN(const float128_t *aPtr)
bool softfloat_isNaNF128M(const uint32_t *)
#define indexWord(total, n)

◆ 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;
54
55 isSigNaNA = softfloat_isSigNaNF16UI( uiA );
56 if ( isSigNaNA || softfloat_isSigNaNF16UI( uiB ) ) {
58 if ( isSigNaNA ) return uiA | 0x0200;
59 }
60 return (isNaNF16UI( uiA ) ? uiA : uiB) | 0x0200;
61
62}
#define softfloat_isSigNaNF16UI(uiA)
Definition specialize.h:95
#define isNaNF16UI(a)
Definition internals.h:88

◆ softfloat_propagateNaNF32UI()

uint_fast32_t softfloat_propagateNaNF32UI ( uint_fast32_t uiA,
uint_fast32_t uiB )

Definition at line 51 of file s_propagateNaNF32UI.c.

52{
53 bool isSigNaNA;
54
55 isSigNaNA = softfloat_isSigNaNF32UI( uiA );
56 if ( isSigNaNA || softfloat_isSigNaNF32UI( uiB ) ) {
58 if ( isSigNaNA ) return uiA | 0x00400000;
59 }
60 return (isNaNF32UI( uiA ) ? uiA : uiB) | 0x00400000;
61
62}
#define softfloat_isSigNaNF32UI(uiA)
Definition specialize.h:130
#define isNaNF32UI(a)
Definition internals.h:109

◆ softfloat_propagateNaNF64UI()

uint_fast64_t softfloat_propagateNaNF64UI ( uint_fast64_t uiA,
uint_fast64_t uiB )

Definition at line 51 of file s_propagateNaNF64UI.c.

52{
53 bool isSigNaNA;
54
55 isSigNaNA = softfloat_isSigNaNF64UI( uiA );
56 if ( isSigNaNA || softfloat_isSigNaNF64UI( uiB ) ) {
58 if ( isSigNaNA ) return uiA | UINT64_C( 0x0008000000000000 );
59 }
60 return (isNaNF64UI( uiA ) ? uiA : uiB) | UINT64_C( 0x0008000000000000 );
61
62}
#define softfloat_isSigNaNF64UI(uiA)
Definition specialize.h:165
#define isNaNF64UI(a)
Definition internals.h:130