38 #define primitives_h 1 44 #ifndef softfloat_shortShiftRightJam64 51 #if defined INLINE_LEVEL && (2 <= INLINE_LEVEL) 54 {
return a>>dist | ((a & (((
uint_fast64_t) 1<<dist) - 1)) != 0); }
60 #ifndef softfloat_shiftRightJam32 70 #if defined INLINE_LEVEL && (2 <= INLINE_LEVEL) 74 (dist < 31) ? a>>dist | ((
uint32_t) (a<<(-dist & 31)) != 0) : (a != 0);
81 #ifndef softfloat_shiftRightJam64 91 #if defined INLINE_LEVEL && (3 <= INLINE_LEVEL) 95 (dist < 63) ? a>>dist | ((
uint64_t) (a<<(-dist & 63)) != 0) : (a != 0);
109 #ifndef softfloat_countLeadingZeros16 114 #if defined INLINE_LEVEL && (2 <= INLINE_LEVEL) 130 #ifndef softfloat_countLeadingZeros32 135 #if defined INLINE_LEVEL && (3 <= INLINE_LEVEL) 143 if ( a < 0x1000000 ) {
155 #ifndef softfloat_countLeadingZeros64 166 #ifndef softfloat_approxRecip32_1 178 #ifdef SOFTFLOAT_FAST_DIV64TO32 179 #define softfloat_approxRecip32_1( a ) ((uint32_t) (UINT64_C( 0x7FFFFFFFFFFFFFFF ) / (uint32_t) (a))) 188 #ifndef softfloat_approxRecipSqrt32_1 210 #ifdef SOFTFLOAT_FAST_INT64 217 #ifndef softfloat_eq128 223 #if defined INLINE_LEVEL && (1 <= INLINE_LEVEL) 226 {
return (a64 == b64) && (a0 == b0); }
232 #ifndef softfloat_le128 238 #if defined INLINE_LEVEL && (2 <= INLINE_LEVEL) 241 {
return (a64 < b64) || ((a64 == b64) && (a0 <= b0)); }
247 #ifndef softfloat_lt128 253 #if defined INLINE_LEVEL && (2 <= INLINE_LEVEL) 256 {
return (a64 < b64) || ((a64 == b64) && (a0 < b0)); }
262 #ifndef softfloat_shortShiftLeft128 267 #if defined INLINE_LEVEL && (2 <= INLINE_LEVEL) 273 z.v64 = a64<<dist | a0>>(-dist & 63);
283 #ifndef softfloat_shortShiftRight128 288 #if defined INLINE_LEVEL && (2 <= INLINE_LEVEL) 295 z.v0 = a64<<(-dist & 63) | a0>>dist;
304 #ifndef softfloat_shortShiftRightJam64Extra 309 #if defined INLINE_LEVEL && (2 <= INLINE_LEVEL) 312 softfloat_shortShiftRightJam64Extra(
315 struct uint64_extra z;
317 z.extra = a<<(-dist & 63) | (extra != 0);
322 softfloat_shortShiftRightJam64Extra(
327 #ifndef softfloat_shortShiftRightJam128 335 #if defined INLINE_LEVEL && (3 <= INLINE_LEVEL) 338 softfloat_shortShiftRightJam128(
345 a64<<(negDist & 63) | a0>>dist
346 | ((
uint64_t) (a0<<(negDist & 63)) != 0);
351 softfloat_shortShiftRightJam128(
356 #ifndef softfloat_shortShiftRightJam128Extra 361 #if defined INLINE_LEVEL && (3 <= INLINE_LEVEL) 364 softfloat_shortShiftRightJam128Extra(
368 struct uint128_extra z;
370 z.v.v0 = a64<<(negDist & 63) | a0>>dist;
371 z.extra = a0<<(negDist & 63) | (extra != 0);
376 softfloat_shortShiftRightJam128Extra(
381 #ifndef softfloat_shiftRightJam64Extra 398 #if defined INLINE_LEVEL && (4 <= INLINE_LEVEL) 401 softfloat_shiftRightJam64Extra(
404 struct uint64_extra z;
407 z.extra = a<<(-dist & 63);
410 z.extra = (dist == 64) ? a : (a != 0);
412 z.extra |= (extra != 0);
417 softfloat_shiftRightJam64Extra(
422 #ifndef softfloat_shiftRightJam128 437 #ifndef softfloat_shiftRightJam128Extra 456 softfloat_shiftRightJam128Extra(
460 #ifndef softfloat_shiftRightJam256M 474 softfloat_shiftRightJam256M(
478 #ifndef softfloat_add128 484 #if defined INLINE_LEVEL && (2 <= INLINE_LEVEL) 491 z.v64 = a64 + b64 + (z.v0 < a0);
500 #ifndef softfloat_add256M 513 #ifndef softfloat_sub128 519 #if defined INLINE_LEVEL && (2 <= INLINE_LEVEL) 536 #ifndef softfloat_sub256M 550 #ifndef softfloat_mul64ByShifted32To128 554 #if defined INLINE_LEVEL && (3 <= INLINE_LEVEL) 569 #ifndef softfloat_mul64To128 576 #ifndef softfloat_mul128By32 582 #if defined INLINE_LEVEL && (4 <= INLINE_LEVEL) 600 #ifndef softfloat_mul128To256M 609 softfloat_mul128To256M(
620 #ifndef softfloat_compare96M 632 #ifndef softfloat_compare128M 645 #ifndef softfloat_shortShiftLeft64To96M 653 #if defined INLINE_LEVEL && (2 <= INLINE_LEVEL) 671 #ifndef softfloat_shortShiftLeftM 690 #ifndef softfloat_shortShiftLeft96M 695 #define softfloat_shortShiftLeft96M( aPtr, dist, zPtr ) softfloat_shortShiftLeftM( 3, aPtr, dist, zPtr ) 698 #ifndef softfloat_shortShiftLeft128M 703 #define softfloat_shortShiftLeft128M( aPtr, dist, zPtr ) softfloat_shortShiftLeftM( 4, aPtr, dist, zPtr ) 706 #ifndef softfloat_shortShiftLeft160M 711 #define softfloat_shortShiftLeft160M( aPtr, dist, zPtr ) softfloat_shortShiftLeftM( 5, aPtr, dist, zPtr ) 714 #ifndef softfloat_shiftLeftM 734 #ifndef softfloat_shiftLeft96M 739 #define softfloat_shiftLeft96M( aPtr, dist, zPtr ) softfloat_shiftLeftM( 3, aPtr, dist, zPtr ) 742 #ifndef softfloat_shiftLeft128M 747 #define softfloat_shiftLeft128M( aPtr, dist, zPtr ) softfloat_shiftLeftM( 4, aPtr, dist, zPtr ) 750 #ifndef softfloat_shiftLeft160M 755 #define softfloat_shiftLeft160M( aPtr, dist, zPtr ) softfloat_shiftLeftM( 5, aPtr, dist, zPtr ) 758 #ifndef softfloat_shortShiftRightM 777 #ifndef softfloat_shortShiftRight128M 782 #define softfloat_shortShiftRight128M( aPtr, dist, zPtr ) softfloat_shortShiftRightM( 4, aPtr, dist, zPtr ) 785 #ifndef softfloat_shortShiftRight160M 790 #define softfloat_shortShiftRight160M( aPtr, dist, zPtr ) softfloat_shortShiftRightM( 5, aPtr, dist, zPtr ) 793 #ifndef softfloat_shortShiftRightJamM 809 #ifndef softfloat_shortShiftRightJam160M 814 #define softfloat_shortShiftRightJam160M( aPtr, dist, zPtr ) softfloat_shortShiftRightJamM( 5, aPtr, dist, zPtr ) 817 #ifndef softfloat_shiftRightM 837 #ifndef softfloat_shiftRight96M 842 #define softfloat_shiftRight96M( aPtr, dist, zPtr ) softfloat_shiftRightM( 3, aPtr, dist, zPtr ) 845 #ifndef softfloat_shiftRightJamM 868 #ifndef softfloat_shiftRightJam96M 873 #define softfloat_shiftRightJam96M( aPtr, dist, zPtr ) softfloat_shiftRightJamM( 3, aPtr, dist, zPtr ) 876 #ifndef softfloat_shiftRightJam128M 881 #define softfloat_shiftRightJam128M( aPtr, dist, zPtr ) softfloat_shiftRightJamM( 4, aPtr, dist, zPtr ) 884 #ifndef softfloat_shiftRightJam160M 889 #define softfloat_shiftRightJam160M( aPtr, dist, zPtr ) softfloat_shiftRightJamM( 5, aPtr, dist, zPtr ) 892 #ifndef softfloat_addM 910 #ifndef softfloat_add96M 915 #define softfloat_add96M( aPtr, bPtr, zPtr ) softfloat_addM( 3, aPtr, bPtr, zPtr ) 918 #ifndef softfloat_add128M 923 #define softfloat_add128M( aPtr, bPtr, zPtr ) softfloat_addM( 4, aPtr, bPtr, zPtr ) 926 #ifndef softfloat_add160M 931 #define softfloat_add160M( aPtr, bPtr, zPtr ) softfloat_addM( 5, aPtr, bPtr, zPtr ) 934 #ifndef softfloat_addCarryM 953 #ifndef softfloat_addComplCarryM 969 #ifndef softfloat_addComplCarry96M 974 #define softfloat_addComplCarry96M( aPtr, bPtr, carry, zPtr ) softfloat_addComplCarryM( 3, aPtr, bPtr, carry, zPtr ) 977 #ifndef softfloat_negXM 987 #ifndef softfloat_negX96M 992 #define softfloat_negX96M( zPtr ) softfloat_negXM( 3, zPtr ) 995 #ifndef softfloat_negX128M 1000 #define softfloat_negX128M( zPtr ) softfloat_negXM( 4, zPtr ) 1003 #ifndef softfloat_negX160M 1008 #define softfloat_negX160M( zPtr ) softfloat_negXM( 5, zPtr ) 1011 #ifndef softfloat_negX256M 1016 #define softfloat_negX256M( zPtr ) softfloat_negXM( 8, zPtr ) 1019 #ifndef softfloat_sub1XM 1030 #ifndef softfloat_sub1X96M 1035 #define softfloat_sub1X96M( zPtr ) softfloat_sub1XM( 3, zPtr ) 1038 #ifndef softfloat_sub1X160M 1043 #define softfloat_sub1X160M( zPtr ) softfloat_sub1XM( 5, zPtr ) 1046 #ifndef softfloat_subM 1064 #ifndef softfloat_sub96M 1069 #define softfloat_sub96M( aPtr, bPtr, zPtr ) softfloat_subM( 3, aPtr, bPtr, zPtr ) 1072 #ifndef softfloat_sub128M 1077 #define softfloat_sub128M( aPtr, bPtr, zPtr ) softfloat_subM( 4, aPtr, bPtr, zPtr ) 1080 #ifndef softfloat_sub160M 1085 #define softfloat_sub160M( aPtr, bPtr, zPtr ) softfloat_subM( 5, aPtr, bPtr, zPtr ) 1088 #ifndef softfloat_mul64To128M 1098 #ifndef softfloat_mul128MTo256M 1112 #ifndef softfloat_remStepMBy32 1133 #ifndef softfloat_remStep96MBy32 1138 #define softfloat_remStep96MBy32( remPtr, dist, bPtr, q, zPtr ) softfloat_remStepMBy32( 3, remPtr, dist, bPtr, q, zPtr ) 1141 #ifndef softfloat_remStep128MBy32 1146 #define softfloat_remStep128MBy32( remPtr, dist, bPtr, q, zPtr ) softfloat_remStepMBy32( 4, remPtr, dist, bPtr, q, zPtr ) 1149 #ifndef softfloat_remStep160MBy32 1154 #define softfloat_remStep160MBy32( remPtr, dist, bPtr, q, zPtr ) softfloat_remStepMBy32( 5, remPtr, dist, bPtr, q, zPtr ) void softfloat_shiftRightM(uint_fast8_t size_words, const uint32_t *aPtr, uint32_t dist, uint32_t *zPtr)
void softfloat_shortShiftLeft64To96M(uint64_t a, uint_fast8_t dist, uint32_t *zPtr)
uint64_t softfloat_shiftRightJam64(uint64_t a, uint_fast32_t dist)
uint_fast8_t softfloat_countLeadingZeros32(uint32_t a)
uint32_t softfloat_approxRecip32_1(uint32_t a)
void softfloat_shortShiftRightM(uint_fast8_t size_words, const uint32_t *aPtr, uint_fast8_t dist, uint32_t *zPtr)
void softfloat_shiftRightJamM(uint_fast8_t size_words, const uint32_t *aPtr, uint32_t dist, uint32_t *zPtr)
void softfloat_shortShiftLeftM(uint_fast8_t size_words, const uint32_t *aPtr, uint_fast8_t dist, uint32_t *zPtr)
uint64_t softfloat_shortShiftRightJam64(uint64_t a, uint_fast8_t dist)
int_fast8_t softfloat_compare128M(const uint32_t *aPtr, const uint32_t *bPtr)
const uint16_t softfloat_approxRecipSqrt_1k1s[16]
uint32_t softfloat_shiftRightJam32(uint32_t a, uint_fast16_t dist)
const uint16_t softfloat_approxRecip_1k0s[16]
int_fast8_t softfloat_compare96M(const uint32_t *aPtr, const uint32_t *bPtr)
void softfloat_remStepMBy32(uint_fast8_t size_words, const uint32_t *remPtr, uint_fast8_t dist, const uint32_t *bPtr, uint32_t q, uint32_t *zPtr)
const uint_least8_t softfloat_countLeadingZeros8[256]
uint32_t softfloat_approxRecipSqrt32_1(unsigned int oddExpA, uint32_t a)
unsigned long long uint64_t
void softfloat_shortShiftRightJamM(uint_fast8_t, const uint32_t *, uint_fast8_t, uint32_t *)
void softfloat_mul64To128M(uint64_t a, uint64_t b, uint32_t *zPtr)
void softfloat_sub1XM(uint_fast8_t size_words, uint32_t *zPtr)
const uint16_t softfloat_approxRecip_1k1s[16]
uint_fast8_t softfloat_countLeadingZeros64(uint64_t a)
#define indexWord(total, n)
void softfloat_mul128MTo256M(const uint32_t *aPtr, const uint32_t *bPtr, uint32_t *zPtr)
uint_fast8_t softfloat_countLeadingZeros16(uint16_t a)
void softfloat_addM(uint_fast8_t size_words, const uint32_t *aPtr, const uint32_t *bPtr, uint32_t *zPtr)
void softfloat_negXM(uint_fast8_t size_words, uint32_t *zPtr)
void softfloat_shiftLeftM(uint_fast8_t size_words, const uint32_t *aPtr, uint32_t dist, uint32_t *zPtr)
void softfloat_subM(uint_fast8_t size_words, const uint32_t *aPtr, const uint32_t *bPtr, uint32_t *zPtr)
uint_fast8_t softfloat_addCarryM(uint_fast8_t size_words, const uint32_t *aPtr, const uint32_t *bPtr, uint_fast8_t carry, uint32_t *zPtr)
const uint16_t softfloat_approxRecipSqrt_1k0s[16]
uint_fast8_t softfloat_addComplCarryM(uint_fast8_t size_words, const uint32_t *aPtr, const uint32_t *bPtr, uint_fast8_t carry, uint32_t *zPtr)