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

Go to the source code of this file.

Macros

#define softfloat_shortShiftLeft96M(aPtr, dist, zPtr)
 
#define softfloat_shortShiftLeft128M(aPtr, dist, zPtr)
 
#define softfloat_shortShiftLeft160M(aPtr, dist, zPtr)
 
#define softfloat_shiftLeft96M(aPtr, dist, zPtr)
 
#define softfloat_shiftLeft128M(aPtr, dist, zPtr)
 
#define softfloat_shiftLeft160M(aPtr, dist, zPtr)
 
#define softfloat_shortShiftRight128M(aPtr, dist, zPtr)
 
#define softfloat_shortShiftRight160M(aPtr, dist, zPtr)
 
#define softfloat_shortShiftRightJam160M(aPtr, dist, zPtr)
 
#define softfloat_shiftRight96M(aPtr, dist, zPtr)
 
#define softfloat_shiftRightJam96M(aPtr, dist, zPtr)
 
#define softfloat_shiftRightJam128M(aPtr, dist, zPtr)
 
#define softfloat_shiftRightJam160M(aPtr, dist, zPtr)
 
#define softfloat_add96M(aPtr, bPtr, zPtr)
 
#define softfloat_add128M(aPtr, bPtr, zPtr)
 
#define softfloat_add160M(aPtr, bPtr, zPtr)
 
#define softfloat_addComplCarry96M(aPtr, bPtr, carry, zPtr)
 
#define softfloat_negX96M(zPtr)
 
#define softfloat_negX128M(zPtr)
 
#define softfloat_negX160M(zPtr)
 
#define softfloat_negX256M(zPtr)
 
#define softfloat_sub1X96M(zPtr)
 
#define softfloat_sub1X160M(zPtr)
 
#define softfloat_sub96M(aPtr, bPtr, zPtr)
 
#define softfloat_sub128M(aPtr, bPtr, zPtr)
 
#define softfloat_sub160M(aPtr, bPtr, zPtr)
 
#define softfloat_remStep96MBy32(remPtr, dist, bPtr, q, zPtr)
 
#define softfloat_remStep128MBy32(remPtr, dist, bPtr, q, zPtr)
 
#define softfloat_remStep160MBy32(remPtr, dist, bPtr, q, zPtr)
 

Functions

uint64_t softfloat_shortShiftRightJam64 (uint64_t a, uint_fast8_t dist)
 
uint32_t softfloat_shiftRightJam32 (uint32_t a, uint_fast16_t dist)
 
uint64_t softfloat_shiftRightJam64 (uint64_t a, uint_fast32_t dist)
 
uint_fast8_t softfloat_countLeadingZeros16 (uint16_t a)
 
uint_fast8_t softfloat_countLeadingZeros32 (uint32_t a)
 
uint_fast8_t softfloat_countLeadingZeros64 (uint64_t a)
 
uint32_t softfloat_approxRecip32_1 (uint32_t a)
 
uint32_t softfloat_approxRecipSqrt32_1 (unsigned int oddExpA, uint32_t a)
 
int_fast8_t softfloat_compare96M (const uint32_t *aPtr, const uint32_t *bPtr)
 
int_fast8_t softfloat_compare128M (const uint32_t *aPtr, const uint32_t *bPtr)
 
void softfloat_shortShiftLeft64To96M (uint64_t a, uint_fast8_t dist, uint32_t *zPtr)
 
void softfloat_shortShiftLeftM (uint_fast8_t size_words, const uint32_t *aPtr, uint_fast8_t dist, uint32_t *zPtr)
 
void softfloat_shiftLeftM (uint_fast8_t size_words, const uint32_t *aPtr, uint32_t dist, uint32_t *zPtr)
 
void softfloat_shortShiftRightM (uint_fast8_t size_words, const uint32_t *aPtr, uint_fast8_t dist, uint32_t *zPtr)
 
void softfloat_shortShiftRightJamM (uint_fast8_t, const uint32_t *, uint_fast8_t, uint32_t *)
 
void softfloat_shiftRightM (uint_fast8_t size_words, const uint32_t *aPtr, uint32_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_addM (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)
 
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)
 
void softfloat_negXM (uint_fast8_t size_words, uint32_t *zPtr)
 
void softfloat_sub1XM (uint_fast8_t size_words, uint32_t *zPtr)
 
void softfloat_subM (uint_fast8_t size_words, const uint32_t *aPtr, const uint32_t *bPtr, uint32_t *zPtr)
 
void softfloat_mul64To128M (uint64_t a, uint64_t b, uint32_t *zPtr)
 
void softfloat_mul128MTo256M (const uint32_t *aPtr, const uint32_t *bPtr, uint32_t *zPtr)
 
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)
 

Variables

const uint_least8_t softfloat_countLeadingZeros8 [256]
 
const uint16_t softfloat_approxRecip_1k0s [16]
 
const uint16_t softfloat_approxRecip_1k1s [16]
 
const uint16_t softfloat_approxRecipSqrt_1k0s [16]
 
const uint16_t softfloat_approxRecipSqrt_1k1s [16]
 

Macro Definition Documentation

◆ softfloat_add128M

#define softfloat_add128M ( aPtr,
bPtr,
zPtr )
Value:
softfloat_addM( 4, aPtr, bPtr, zPtr )
void softfloat_addM(uint_fast8_t size_words, const uint32_t *aPtr, const uint32_t *bPtr, uint32_t *zPtr)
Definition s_addM.c:44

Definition at line 923 of file primitives.h.

◆ softfloat_add160M

#define softfloat_add160M ( aPtr,
bPtr,
zPtr )
Value:
softfloat_addM( 5, aPtr, bPtr, zPtr )

Definition at line 931 of file primitives.h.

◆ softfloat_add96M

#define softfloat_add96M ( aPtr,
bPtr,
zPtr )
Value:
softfloat_addM( 3, aPtr, bPtr, zPtr )

Definition at line 915 of file primitives.h.

◆ softfloat_addComplCarry96M

#define softfloat_addComplCarry96M ( aPtr,
bPtr,
carry,
zPtr )
Value:
softfloat_addComplCarryM( 3, aPtr, bPtr, carry, zPtr )
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)

Definition at line 974 of file primitives.h.

◆ softfloat_negX128M

#define softfloat_negX128M ( zPtr)
Value:
softfloat_negXM( 4, zPtr )
void softfloat_negXM(uint_fast8_t size_words, uint32_t *zPtr)
Definition s_negXM.c:43

Definition at line 1000 of file primitives.h.

◆ softfloat_negX160M

#define softfloat_negX160M ( zPtr)
Value:
softfloat_negXM( 5, zPtr )

Definition at line 1008 of file primitives.h.

◆ softfloat_negX256M

#define softfloat_negX256M ( zPtr)
Value:
softfloat_negXM( 8, zPtr )

Definition at line 1016 of file primitives.h.

◆ softfloat_negX96M

#define softfloat_negX96M ( zPtr)
Value:
softfloat_negXM( 3, zPtr )

Definition at line 992 of file primitives.h.

◆ softfloat_remStep128MBy32

#define softfloat_remStep128MBy32 ( remPtr,
dist,
bPtr,
q,
zPtr )
Value:
softfloat_remStepMBy32( 4, remPtr, dist, bPtr, q, zPtr )
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)

Definition at line 1146 of file primitives.h.

◆ softfloat_remStep160MBy32

#define softfloat_remStep160MBy32 ( remPtr,
dist,
bPtr,
q,
zPtr )
Value:
softfloat_remStepMBy32( 5, remPtr, dist, bPtr, q, zPtr )

Definition at line 1154 of file primitives.h.

◆ softfloat_remStep96MBy32

#define softfloat_remStep96MBy32 ( remPtr,
dist,
bPtr,
q,
zPtr )
Value:
softfloat_remStepMBy32( 3, remPtr, dist, bPtr, q, zPtr )

Definition at line 1138 of file primitives.h.

◆ softfloat_shiftLeft128M

#define softfloat_shiftLeft128M ( aPtr,
dist,
zPtr )
Value:
softfloat_shiftLeftM( 4, aPtr, dist, zPtr )
#define softfloat_shiftLeftM

Definition at line 747 of file primitives.h.

◆ softfloat_shiftLeft160M

#define softfloat_shiftLeft160M ( aPtr,
dist,
zPtr )
Value:
softfloat_shiftLeftM( 5, aPtr, dist, zPtr )

Definition at line 755 of file primitives.h.

◆ softfloat_shiftLeft96M

#define softfloat_shiftLeft96M ( aPtr,
dist,
zPtr )
Value:
softfloat_shiftLeftM( 3, aPtr, dist, zPtr )

Definition at line 739 of file primitives.h.

◆ softfloat_shiftRight96M

#define softfloat_shiftRight96M ( aPtr,
dist,
zPtr )
Value:
softfloat_shiftRightM( 3, aPtr, dist, zPtr )
#define softfloat_shiftRightM

Definition at line 842 of file primitives.h.

◆ softfloat_shiftRightJam128M

#define softfloat_shiftRightJam128M ( aPtr,
dist,
zPtr )
Value:
softfloat_shiftRightJamM( 4, aPtr, dist, zPtr )
#define softfloat_shiftRightJamM

Definition at line 881 of file primitives.h.

◆ softfloat_shiftRightJam160M

#define softfloat_shiftRightJam160M ( aPtr,
dist,
zPtr )
Value:
softfloat_shiftRightJamM( 5, aPtr, dist, zPtr )

Definition at line 889 of file primitives.h.

◆ softfloat_shiftRightJam96M

#define softfloat_shiftRightJam96M ( aPtr,
dist,
zPtr )
Value:
softfloat_shiftRightJamM( 3, aPtr, dist, zPtr )

Definition at line 873 of file primitives.h.

◆ softfloat_shortShiftLeft128M

#define softfloat_shortShiftLeft128M ( aPtr,
dist,
zPtr )
Value:
softfloat_shortShiftLeftM( 4, aPtr, dist, zPtr )
void softfloat_shortShiftLeftM(uint_fast8_t size_words, const uint32_t *aPtr, uint_fast8_t dist, uint32_t *zPtr)

Definition at line 703 of file primitives.h.

◆ softfloat_shortShiftLeft160M

#define softfloat_shortShiftLeft160M ( aPtr,
dist,
zPtr )
Value:
softfloat_shortShiftLeftM( 5, aPtr, dist, zPtr )

Definition at line 711 of file primitives.h.

◆ softfloat_shortShiftLeft96M

#define softfloat_shortShiftLeft96M ( aPtr,
dist,
zPtr )
Value:
softfloat_shortShiftLeftM( 3, aPtr, dist, zPtr )

Definition at line 695 of file primitives.h.

◆ softfloat_shortShiftRight128M

#define softfloat_shortShiftRight128M ( aPtr,
dist,
zPtr )
Value:
softfloat_shortShiftRightM( 4, aPtr, dist, zPtr )
void softfloat_shortShiftRightM(uint_fast8_t size_words, const uint32_t *aPtr, uint_fast8_t dist, uint32_t *zPtr)

Definition at line 782 of file primitives.h.

◆ softfloat_shortShiftRight160M

#define softfloat_shortShiftRight160M ( aPtr,
dist,
zPtr )
Value:
softfloat_shortShiftRightM( 5, aPtr, dist, zPtr )

Definition at line 790 of file primitives.h.

◆ softfloat_shortShiftRightJam160M

#define softfloat_shortShiftRightJam160M ( aPtr,
dist,
zPtr )
Value:
softfloat_shortShiftRightJamM( 5, aPtr, dist, zPtr )
void softfloat_shortShiftRightJamM(uint_fast8_t, const uint32_t *, uint_fast8_t, uint32_t *)

Definition at line 814 of file primitives.h.

◆ softfloat_sub128M

#define softfloat_sub128M ( aPtr,
bPtr,
zPtr )
Value:
softfloat_subM( 4, aPtr, bPtr, zPtr )
void softfloat_subM(uint_fast8_t size_words, const uint32_t *aPtr, const uint32_t *bPtr, uint32_t *zPtr)
Definition s_subM.c:44

Definition at line 1077 of file primitives.h.

◆ softfloat_sub160M

#define softfloat_sub160M ( aPtr,
bPtr,
zPtr )
Value:
softfloat_subM( 5, aPtr, bPtr, zPtr )

Definition at line 1085 of file primitives.h.

◆ softfloat_sub1X160M

#define softfloat_sub1X160M ( zPtr)
Value:
softfloat_sub1XM( 5, zPtr )
void softfloat_sub1XM(uint_fast8_t size_words, uint32_t *zPtr)
Definition s_sub1XM.c:43

Definition at line 1043 of file primitives.h.

◆ softfloat_sub1X96M

#define softfloat_sub1X96M ( zPtr)
Value:
softfloat_sub1XM( 3, zPtr )

Definition at line 1035 of file primitives.h.

◆ softfloat_sub96M

#define softfloat_sub96M ( aPtr,
bPtr,
zPtr )
Value:
softfloat_subM( 3, aPtr, bPtr, zPtr )

Definition at line 1069 of file primitives.h.

Function Documentation

◆ softfloat_addCarryM()

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 )

Definition at line 44 of file s_addCarryM.c.

51{
52 unsigned int index, lastIndex;
53 uint32_t wordA, wordZ;
54
55 index = indexWordLo( size_words );
56 lastIndex = indexWordHi( size_words );
57 for (;;) {
58 wordA = aPtr[index];
59 wordZ = wordA + bPtr[index] + carry;
60 zPtr[index] = wordZ;
61 if ( wordZ != wordA ) carry = (wordZ < wordA);
62 if ( index == lastIndex ) break;
63 index += wordIncr;
64 }
65 return carry;
66
67}
#define wordIncr
#define indexWordLo(total)
#define indexWordHi(total)
unsigned int uint32_t
Definition stdint.h:126
Here is the caller graph for this function:

◆ softfloat_addComplCarryM()

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 )

Definition at line 44 of file s_addComplCarryM.c.

51{
52 unsigned int index, lastIndex;
53 uint32_t wordA, wordZ;
54
55 index = indexWordLo( size_words );
56 lastIndex = indexWordHi( size_words );
57 for (;;) {
58 wordA = aPtr[index];
59 wordZ = wordA + ~bPtr[index] + carry;
60 zPtr[index] = wordZ;
61 if ( wordZ != wordA ) carry = (wordZ < wordA);
62 if ( index == lastIndex ) break;
63 index += wordIncr;
64 }
65 return carry;
66
67}
Here is the caller graph for this function:

◆ softfloat_addM()

void softfloat_addM ( uint_fast8_t size_words,
const uint32_t * aPtr,
const uint32_t * bPtr,
uint32_t * zPtr )

Definition at line 44 of file s_addM.c.

50{
51 unsigned int index, lastIndex;
52 uint_fast8_t carry;
53 uint32_t wordA, wordZ;
54
55 index = indexWordLo( size_words );
56 lastIndex = indexWordHi( size_words );
57 carry = 0;
58 for (;;) {
59 wordA = aPtr[index];
60 wordZ = wordA + bPtr[index] + carry;
61 zPtr[index] = wordZ;
62 if ( index == lastIndex ) break;
63 if ( wordZ != wordA ) carry = (wordZ < wordA);
64 index += wordIncr;
65 }
66
67}
uint8_t uint_fast8_t
Definition stdint.h:154

◆ softfloat_approxRecip32_1()

uint32_t softfloat_approxRecip32_1 ( uint32_t a)

Definition at line 45 of file s_approxRecip32_1.c.

46{
47 int index;
48 uint16_t eps, r0;
51 uint32_t sqrSigma0;
52
53 index = a>>27 & 0xF;
54 eps = (uint16_t) (a>>11);
56 - ((softfloat_approxRecip_1k1s[index] * (uint_fast32_t) eps)>>20);
57 sigma0 = ~(uint_fast32_t) ((r0 * (uint_fast64_t) a)>>7);
58 r = ((uint_fast32_t) r0<<16) + ((r0 * (uint_fast64_t) sigma0)>>24);
59 sqrSigma0 = ((uint_fast64_t) sigma0 * sigma0)>>32;
60 r += ((uint32_t) r * (uint_fast64_t) sqrSigma0)>>48;
61 return r;
62
63}
const mie::Vuint & r
Definition bn.cpp:28
#define sigma0(x)
Definition hash_impl.h:21
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
const uint16_t softfloat_approxRecip_1k0s[16]
const uint16_t softfloat_approxRecip_1k1s[16]
unsigned short uint16_t
Definition stdint.h:125
uint64_t uint_fast64_t
Definition stdint.h:157
uint32_t uint_fast32_t
Definition stdint.h:156
Here is the caller graph for this function:

◆ softfloat_approxRecipSqrt32_1()

uint32_t softfloat_approxRecipSqrt32_1 ( unsigned int oddExpA,
uint32_t a )

Definition at line 45 of file s_approxRecipSqrt32_1.c.

46{
47 int index;
48 uint16_t eps, r0;
49 uint_fast32_t ESqrR0;
52 uint32_t sqrSigma0;
53
54 index = (a>>27 & 0xE) + oddExpA;
55 eps = (uint16_t) (a>>12);
58 >>20);
59 ESqrR0 = (uint_fast32_t) r0 * r0;
60 if ( ! oddExpA ) ESqrR0 <<= 1;
61 sigma0 = ~(uint_fast32_t) (((uint32_t) ESqrR0 * (uint_fast64_t) a)>>23);
62 r = ((uint_fast32_t) r0<<16) + ((r0 * (uint_fast64_t) sigma0)>>25);
63 sqrSigma0 = ((uint_fast64_t) sigma0 * sigma0)>>32;
64 r += ((uint32_t) ((r>>1) + (r>>3) - ((uint_fast32_t) r0<<14))
65 * (uint_fast64_t) sqrSigma0)
66 >>48;
67 if ( ! (r & 0x80000000) ) r = 0x80000000;
68 return r;
69
70}
const uint16_t softfloat_approxRecipSqrt_1k0s[]
const uint16_t softfloat_approxRecipSqrt_1k1s[]
Here is the caller graph for this function:

◆ softfloat_compare128M()

int_fast8_t softfloat_compare128M ( const uint32_t * aPtr,
const uint32_t * bPtr )

Definition at line 43 of file s_compare128M.c.

44{
45 unsigned int index, lastIndex;
46 uint32_t wordA, wordB;
47
48 index = indexWordHi( 4 );
49 lastIndex = indexWordLo( 4 );
50 for (;;) {
51 wordA = aPtr[index];
52 wordB = bPtr[index];
53 if ( wordA != wordB ) return (wordA < wordB) ? -1 : 1;
54 if ( index == lastIndex ) break;
55 index -= wordIncr;
56 }
57 return 0;
58
59}
Here is the caller graph for this function:

◆ softfloat_compare96M()

int_fast8_t softfloat_compare96M ( const uint32_t * aPtr,
const uint32_t * bPtr )

Definition at line 43 of file s_compare96M.c.

44{
45 unsigned int index, lastIndex;
46 uint32_t wordA, wordB;
47
48 index = indexWordHi( 3 );
49 lastIndex = indexWordLo( 3 );
50 for (;;) {
51 wordA = aPtr[index];
52 wordB = bPtr[index];
53 if ( wordA != wordB ) return (wordA < wordB) ? -1 : 1;
54 if ( index == lastIndex ) break;
55 index -= wordIncr;
56 }
57 return 0;
58
59}
Here is the caller graph for this function:

◆ softfloat_countLeadingZeros16()

uint_fast8_t softfloat_countLeadingZeros16 ( uint16_t a)

Definition at line 45 of file s_countLeadingZeros16.c.

46{
48
49 count = 8;
50 if ( 0x100 <= a ) {
51 count = 0;
52 a >>= 8;
53 }
55 return count;
56
57}
int * count
const uint_least8_t softfloat_countLeadingZeros8[256]

◆ softfloat_countLeadingZeros32()

uint_fast8_t softfloat_countLeadingZeros32 ( uint32_t a)

Definition at line 45 of file s_countLeadingZeros32.c.

46{
48
49 count = 0;
50 if ( a < 0x10000 ) {
51 count = 16;
52 a <<= 16;
53 }
54 if ( a < 0x1000000 ) {
55 count += 8;
56 a <<= 8;
57 }
59 return count;
60
61}

◆ softfloat_countLeadingZeros64()

uint_fast8_t softfloat_countLeadingZeros64 ( uint64_t a)

Definition at line 45 of file s_countLeadingZeros64.c.

46{
48 uint32_t a32;
49
50 count = 0;
51 a32 = a>>32;
52 if ( ! a32 ) {
53 count = 32;
54 a32 = a;
55 }
56 /*------------------------------------------------------------------------
57 | From here, result is current count + count leading zeros of `a32'.
58 *------------------------------------------------------------------------*/
59 if ( a32 < 0x10000 ) {
60 count += 16;
61 a32 <<= 16;
62 }
63 if ( a32 < 0x1000000 ) {
64 count += 8;
65 a32 <<= 8;
66 }
68 return count;
69
70}

◆ softfloat_mul128MTo256M()

void softfloat_mul128MTo256M ( const uint32_t * aPtr,
const uint32_t * bPtr,
uint32_t * zPtr )

Definition at line 44 of file s_mul128MTo256M.c.

46{
47 uint32_t *lastZPtr, wordB;
48 uint64_t dwordProd;
49 uint32_t wordZ;
50 uint_fast8_t carry;
51
52 bPtr += indexWordLo( 4 );
53 lastZPtr = zPtr + indexMultiwordHi( 8, 5 );
54 zPtr += indexMultiwordLo( 8, 5 );
55 wordB = *bPtr;
56 dwordProd = (uint64_t) aPtr[indexWord( 4, 0 )] * wordB;
57 zPtr[indexWord( 5, 0 )] = dwordProd;
58 dwordProd = (uint64_t) aPtr[indexWord( 4, 1 )] * wordB + (dwordProd>>32);
59 zPtr[indexWord( 5, 1 )] = dwordProd;
60 dwordProd = (uint64_t) aPtr[indexWord( 4, 2 )] * wordB + (dwordProd>>32);
61 zPtr[indexWord( 5, 2 )] = dwordProd;
62 dwordProd = (uint64_t) aPtr[indexWord( 4, 3 )] * wordB + (dwordProd>>32);
63 zPtr[indexWord( 5, 3 )] = dwordProd;
64 zPtr[indexWord( 5, 4 )] = dwordProd>>32;
65 do {
66 bPtr += wordIncr;
67 zPtr += wordIncr;
68 wordB = *bPtr;
69 dwordProd = (uint64_t) aPtr[indexWord( 4, 0 )] * wordB;
70 wordZ = zPtr[indexWord( 5, 0 )] + (uint32_t) dwordProd;
71 zPtr[indexWord( 5, 0 )] = wordZ;
72 carry = (wordZ < (uint32_t) dwordProd);
73 dwordProd =
74 (uint64_t) aPtr[indexWord( 4, 1 )] * wordB + (dwordProd>>32);
75 wordZ = zPtr[indexWord( 5, 1 )] + (uint32_t) dwordProd + carry;
76 zPtr[indexWord( 5, 1 )] = wordZ;
77 if ( wordZ != (uint32_t) dwordProd ) {
78 carry = (wordZ < (uint32_t) dwordProd);
79 }
80 dwordProd =
81 (uint64_t) aPtr[indexWord( 4, 2 )] * wordB + (dwordProd>>32);
82 wordZ = zPtr[indexWord( 5, 2 )] + (uint32_t) dwordProd + carry;
83 zPtr[indexWord( 5, 2 )] = wordZ;
84 if ( wordZ != (uint32_t) dwordProd ) {
85 carry = (wordZ < (uint32_t) dwordProd);
86 }
87 dwordProd =
88 (uint64_t) aPtr[indexWord( 4, 3 )] * wordB + (dwordProd>>32);
89 wordZ = zPtr[indexWord( 5, 3 )] + (uint32_t) dwordProd + carry;
90 zPtr[indexWord( 5, 3 )] = wordZ;
91 if ( wordZ != (uint32_t) dwordProd ) {
92 carry = (wordZ < (uint32_t) dwordProd);
93 }
94 zPtr[indexWord( 5, 4 )] = (dwordProd>>32) + carry;
95 } while ( zPtr != lastZPtr );
96
97}
#define indexMultiwordHi(total, n)
#define indexMultiwordLo(total, n)
#define indexWord(total, n)
unsigned __int64 uint64_t
Definition stdint.h:136
Here is the caller graph for this function:

◆ softfloat_mul64To128M()

void softfloat_mul64To128M ( uint64_t a,
uint64_t b,
uint32_t * zPtr )

Definition at line 43 of file s_mul64To128M.c.

44{
45 uint32_t a32, a0, b32, b0;
46 uint64_t z0, mid1, z64, mid;
47
48 a32 = a>>32;
49 a0 = a;
50 b32 = b>>32;
51 b0 = b;
52 z0 = (uint64_t) a0 * b0;
53 mid1 = (uint64_t) a32 * b0;
54 mid = mid1 + (uint64_t) a0 * b32;
55 z64 = (uint64_t) a32 * b32;
56 z64 += (uint64_t) (mid < mid1)<<32 | mid>>32;
57 mid <<= 32;
58 z0 += mid;
59 zPtr[indexWord( 4, 1 )] = z0>>32;
60 zPtr[indexWord( 4, 0 )] = z0;
61 z64 += (z0 < mid);
62 zPtr[indexWord( 4, 3 )] = z64>>32;
63 zPtr[indexWord( 4, 2 )] = z64;
64
65}
Here is the caller graph for this function:

◆ softfloat_negXM()

void softfloat_negXM ( uint_fast8_t size_words,
uint32_t * zPtr )

Definition at line 43 of file s_negXM.c.

44{
45 unsigned int index, lastIndex;
46 uint_fast8_t carry;
48
49 index = indexWordLo( size_words );
50 lastIndex = indexWordHi( size_words );
51 carry = 1;
52 for (;;) {
53 word = ~zPtr[index] + carry;
54 zPtr[index] = word;
55 if ( index == lastIndex ) break;
56 index += wordIncr;
57 if ( word ) carry = 0;
58 }
59
60}
static const AddressFrame word(16)

◆ softfloat_remStepMBy32()

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 )

Definition at line 44 of file s_remStepMBy32.c.

52{
53 unsigned int index, lastIndex;
54 uint64_t dwordProd;
55 uint32_t wordRem, wordShiftedRem, wordProd;
56 uint_fast8_t uNegDist, borrow;
57
58 index = indexWordLo( size_words );
59 lastIndex = indexWordHi( size_words );
60 dwordProd = (uint64_t) bPtr[index] * q;
61 wordRem = remPtr[index];
62 wordShiftedRem = wordRem<<dist;
63 wordProd = dwordProd;
64 zPtr[index] = wordShiftedRem - wordProd;
65 if ( index != lastIndex ) {
66 uNegDist = -dist;
67 borrow = (wordShiftedRem < wordProd);
68 for (;;) {
69 wordShiftedRem = wordRem>>(uNegDist & 31);
70 index += wordIncr;
71 dwordProd = (uint64_t) bPtr[index] * q + (dwordProd>>32);
72 wordRem = remPtr[index];
73 wordShiftedRem |= wordRem<<dist;
74 wordProd = dwordProd;
75 zPtr[index] = wordShiftedRem - wordProd - borrow;
76 if ( index == lastIndex ) break;
77 borrow =
78 borrow ? (wordShiftedRem <= wordProd)
79 : (wordShiftedRem < wordProd);
80 }
81 }
82
83}

◆ softfloat_shiftLeftM()

void softfloat_shiftLeftM ( uint_fast8_t size_words,
const uint32_t * aPtr,
uint32_t dist,
uint32_t * zPtr )

Definition at line 46 of file s_shiftLeftM.c.

52{
53 uint32_t wordDist;
54 uint_fast8_t innerDist;
55 uint32_t *destPtr;
57
58 wordDist = dist>>5;
59 if ( wordDist < size_words ) {
60 aPtr += indexMultiwordLoBut( size_words, wordDist );
61 innerDist = dist & 31;
62 if ( innerDist ) {
64 size_words - wordDist,
65 aPtr,
66 innerDist,
67 zPtr + indexMultiwordHiBut( size_words, wordDist )
68 );
69 if ( ! wordDist ) return;
70 } else {
71 aPtr += indexWordHi( size_words - wordDist );
72 destPtr = zPtr + indexWordHi( size_words );
73 for ( i = size_words - wordDist; i; --i ) {
74 *destPtr = *aPtr;
75 aPtr -= wordIncr;
76 destPtr -= wordIncr;
77 }
78 }
79 zPtr += indexMultiwordLo( size_words, wordDist );
80 } else {
81 wordDist = size_words;
82 }
83 do {
84 *zPtr++ = 0;
85 --wordDist;
86 } while ( wordDist );
87
88}
#define indexMultiwordHiBut(total, n)
#define indexMultiwordLoBut(total, n)
Here is the call graph for this function:

◆ softfloat_shiftRightJam32()

uint32_t softfloat_shiftRightJam32 ( uint32_t a,
uint_fast16_t dist )

Definition at line 42 of file s_shiftRightJam32.c.

43{
44
45 return
46 (dist < 31) ? a>>dist | ((uint32_t) (a<<(-dist & 31)) != 0) : (a != 0);
47
48}
Here is the caller graph for this function:

◆ softfloat_shiftRightJam64()

uint64_t softfloat_shiftRightJam64 ( uint64_t a,
uint_fast32_t dist )

Definition at line 42 of file s_shiftRightJam64.c.

43{
44
45 return
46 (dist < 63) ? a>>dist | ((uint64_t) (a<<(-dist & 63)) != 0) : (a != 0);
47
48}
Here is the caller graph for this function:

◆ softfloat_shiftRightJamM()

void softfloat_shiftRightJamM ( uint_fast8_t size_words,
const uint32_t * aPtr,
uint32_t dist,
uint32_t * zPtr )

Definition at line 46 of file s_shiftRightJamM.c.

52{
53 uint32_t wordJam, wordDist, *ptr;
54 uint_fast8_t i, innerDist;
55
56 wordJam = 0;
57 wordDist = dist>>5;
58 if ( wordDist ) {
59 if ( size_words < wordDist ) wordDist = size_words;
60 ptr = (uint32_t *) (aPtr + indexMultiwordLo( size_words, wordDist ));
61 i = wordDist;
62 do {
63 wordJam = *ptr++;
64 if ( wordJam ) break;
65 --i;
66 } while ( i );
67 ptr = zPtr;
68 }
69 if ( wordDist < size_words ) {
70 aPtr += indexMultiwordHiBut( size_words, wordDist );
71 innerDist = dist & 31;
72 if ( innerDist ) {
74 size_words - wordDist,
75 aPtr,
76 innerDist,
77 zPtr + indexMultiwordLoBut( size_words, wordDist )
78 );
79 if ( ! wordDist ) goto wordJam;
80 } else {
81 aPtr += indexWordLo( size_words - wordDist );
82 ptr = zPtr + indexWordLo( size_words );
83 for ( i = size_words - wordDist; i; --i ) {
84 *ptr = *aPtr;
85 aPtr += wordIncr;
86 ptr += wordIncr;
87 }
88 }
89 ptr = zPtr + indexMultiwordHi( size_words, wordDist );
90 }
91 do {
92 *ptr++ = 0;
93 --wordDist;
94 } while ( wordDist );
95 wordJam:
96 if ( wordJam ) zPtr[indexWordLo( size_words )] |= 1;
97
98}
Here is the call graph for this function:

◆ softfloat_shiftRightM()

void softfloat_shiftRightM ( uint_fast8_t size_words,
const uint32_t * aPtr,
uint32_t dist,
uint32_t * zPtr )

Definition at line 46 of file s_shiftRightM.c.

52{
53 uint32_t wordDist;
54 uint_fast8_t innerDist;
55 uint32_t *destPtr;
57
58 wordDist = dist>>5;
59 if ( wordDist < size_words ) {
60 aPtr += indexMultiwordHiBut( size_words, wordDist );
61 innerDist = dist & 31;
62 if ( innerDist ) {
64 size_words - wordDist,
65 aPtr,
66 innerDist,
67 zPtr + indexMultiwordLoBut( size_words, wordDist )
68 );
69 if ( ! wordDist ) return;
70 } else {
71 aPtr += indexWordLo( size_words - wordDist );
72 destPtr = zPtr + indexWordLo( size_words );
73 for ( i = size_words - wordDist; i; --i ) {
74 *destPtr = *aPtr;
75 aPtr += wordIncr;
76 destPtr += wordIncr;
77 }
78 }
79 zPtr += indexMultiwordHi( size_words, wordDist );
80 } else {
81 wordDist = size_words;
82 }
83 do {
84 *zPtr++ = 0;
85 --wordDist;
86 } while ( wordDist );
87
88}
Here is the call graph for this function:

◆ softfloat_shortShiftLeft64To96M()

void softfloat_shortShiftLeft64To96M ( uint64_t a,
uint_fast8_t dist,
uint32_t * zPtr )

Definition at line 44 of file s_shortShiftLeft64To96M.c.

46{
47
48 zPtr[indexWord( 3, 0 )] = (uint32_t) a<<dist;
49 a >>= 32 - dist;
50 zPtr[indexWord( 3, 2 )] = a>>32;
51 zPtr[indexWord( 3, 1 )] = a;
52
53}
Here is the caller graph for this function:

◆ softfloat_shortShiftLeftM()

void softfloat_shortShiftLeftM ( uint_fast8_t size_words,
const uint32_t * aPtr,
uint_fast8_t dist,
uint32_t * zPtr )

Definition at line 44 of file s_shortShiftLeftM.c.

50{
51 uint_fast8_t uNegDist;
52 unsigned int index, lastIndex;
53 uint32_t partWordZ, wordA;
54
55 uNegDist = -dist;
56 index = indexWordHi( size_words );
57 lastIndex = indexWordLo( size_words );
58 partWordZ = aPtr[index]<<dist;
59 while ( index != lastIndex ) {
60 wordA = aPtr[index - wordIncr];
61 zPtr[index] = partWordZ | wordA>>(uNegDist & 31);
62 index -= wordIncr;
63 partWordZ = wordA<<dist;
64 }
65 zPtr[index] = partWordZ;
66
67}
Here is the caller graph for this function:

◆ softfloat_shortShiftRightJam64()

uint64_t softfloat_shortShiftRightJam64 ( uint64_t a,
uint_fast8_t dist )

Definition at line 42 of file s_shortShiftRightJam64.c.

43{
44
45 return a>>dist | ((a & (((uint_fast64_t) 1<<dist) - 1)) != 0);
46
47}
Here is the caller graph for this function:

◆ softfloat_shortShiftRightJamM()

void softfloat_shortShiftRightJamM ( uint_fast8_t size_words,
const uint32_t * aPtr,
uint_fast8_t dist,
uint32_t * zPtr )

Definition at line 44 of file s_shortShiftRightJamM.c.

50{
51 uint_fast8_t uNegDist;
52 unsigned int index, lastIndex;
53 uint32_t partWordZ, wordA;
54
55 uNegDist = -dist;
56 index = indexWordLo( size_words );
57 lastIndex = indexWordHi( size_words );
58 wordA = aPtr[index];
59 partWordZ = wordA>>dist;
60 if ( partWordZ<<dist != wordA ) partWordZ |= 1;
61 while ( index != lastIndex ) {
62 wordA = aPtr[index + wordIncr];
63 zPtr[index] = wordA<<(uNegDist & 31) | partWordZ;
64 index += wordIncr;
65 partWordZ = wordA>>dist;
66 }
67 zPtr[index] = partWordZ;
68
69}
Here is the caller graph for this function:

◆ softfloat_shortShiftRightM()

void softfloat_shortShiftRightM ( uint_fast8_t size_words,
const uint32_t * aPtr,
uint_fast8_t dist,
uint32_t * zPtr )

Definition at line 44 of file s_shortShiftRightM.c.

50{
51 uint_fast8_t uNegDist;
52 unsigned int index, lastIndex;
53 uint32_t partWordZ, wordA;
54
55 uNegDist = -dist;
56 index = indexWordLo( size_words );
57 lastIndex = indexWordHi( size_words );
58 partWordZ = aPtr[index]>>dist;
59 while ( index != lastIndex ) {
60 wordA = aPtr[index + wordIncr];
61 zPtr[index] = wordA<<(uNegDist & 31) | partWordZ;
62 index += wordIncr;
63 partWordZ = wordA>>dist;
64 }
65 zPtr[index] = partWordZ;
66
67}
Here is the caller graph for this function:

◆ softfloat_sub1XM()

void softfloat_sub1XM ( uint_fast8_t size_words,
uint32_t * zPtr )

Definition at line 43 of file s_sub1XM.c.

44{
45 unsigned int index, lastIndex;
46 uint32_t wordA;
47
48 index = indexWordLo( size_words );
49 lastIndex = indexWordHi( size_words );
50 for (;;) {
51 wordA = zPtr[index];
52 zPtr[index] = wordA - 1;
53 if ( wordA || (index == lastIndex) ) break;
54 index += wordIncr;
55 }
56
57}

◆ softfloat_subM()

void softfloat_subM ( uint_fast8_t size_words,
const uint32_t * aPtr,
const uint32_t * bPtr,
uint32_t * zPtr )

Definition at line 44 of file s_subM.c.

50{
51 unsigned int index, lastIndex;
52 uint_fast8_t borrow;
53 uint32_t wordA, wordB;
54
55 index = indexWordLo( size_words );
56 lastIndex = indexWordHi( size_words );
57 borrow = 0;
58 for (;;) {
59 wordA = aPtr[index];
60 wordB = bPtr[index];
61 zPtr[index] = wordA - wordB - borrow;
62 if ( index == lastIndex ) break;
63 borrow = borrow ? (wordA <= wordB) : (wordA < wordB);
64 index += wordIncr;
65 }
66
67}

Variable Documentation

◆ softfloat_approxRecip_1k0s

const uint16_t softfloat_approxRecip_1k0s[16]
extern

Definition at line 41 of file s_approxRecip_1Ks.c.

41 {
42 0xFFC4, 0xF0BE, 0xE363, 0xD76F, 0xCCAD, 0xC2F0, 0xBA16, 0xB201,
43 0xAA97, 0xA3C6, 0x9D7A, 0x97A6, 0x923C, 0x8D32, 0x887E, 0x8417
44};

◆ softfloat_approxRecip_1k1s

const uint16_t softfloat_approxRecip_1k1s[16]
extern

Definition at line 45 of file s_approxRecip_1Ks.c.

45 {
46 0xF0F1, 0xD62C, 0xBFA1, 0xAC77, 0x9C0A, 0x8DDB, 0x8185, 0x76BA,
47 0x6D3B, 0x64D4, 0x5D5C, 0x56B1, 0x50B6, 0x4B55, 0x4679, 0x4211
48};

◆ softfloat_approxRecipSqrt_1k0s

const uint16_t softfloat_approxRecipSqrt_1k0s[16]
extern

Definition at line 41 of file s_approxRecipSqrt_1Ks.c.

41 {
42 0xB4C9, 0xFFAB, 0xAA7D, 0xF11C, 0xA1C5, 0xE4C7, 0x9A43, 0xDA29,
43 0x93B5, 0xD0E5, 0x8DED, 0xC8B7, 0x88C6, 0xC16D, 0x8424, 0xBAE1
44};

◆ softfloat_approxRecipSqrt_1k1s

const uint16_t softfloat_approxRecipSqrt_1k1s[16]
extern

Definition at line 45 of file s_approxRecipSqrt_1Ks.c.

45 {
46 0xA5A5, 0xEA42, 0x8C21, 0xC62D, 0x788F, 0xAA7F, 0x6928, 0x94B6,
47 0x5CC7, 0x8335, 0x52A6, 0x74E2, 0x4A3E, 0x68FE, 0x432B, 0x5EFD
48};

◆ softfloat_countLeadingZeros8

const uint_least8_t softfloat_countLeadingZeros8[256]
extern

Definition at line 41 of file s_countLeadingZeros8.c.

41 {
42 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
43 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
44 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
45 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
46 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
47 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
48 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
49 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
50 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
51 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
52 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
53 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
54 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
55 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
56 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
57 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
58};