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

Go to the source code of this file.

Functions

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)
 

Function Documentation

◆ 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}
#define wordIncr
#define indexWordLo(total)
#define indexWordHi(total)
unsigned int uint32_t
Definition stdint.h:126
uint8_t uint_fast8_t
Definition stdint.h:154
unsigned __int64 uint64_t
Definition stdint.h:136