aboutsummaryrefslogtreecommitdiff
path: root/softfloat/s_remStepMBy32.c
diff options
context:
space:
mode:
Diffstat (limited to 'softfloat/s_remStepMBy32.c')
-rw-r--r--softfloat/s_remStepMBy32.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/softfloat/s_remStepMBy32.c b/softfloat/s_remStepMBy32.c
index 429d3dc..fe787a4 100644
--- a/softfloat/s_remStepMBy32.c
+++ b/softfloat/s_remStepMBy32.c
@@ -2,9 +2,9 @@
/*============================================================================
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
-Package, Release 3a, by John R. Hauser.
+Package, Release 3d, by John R. Hauser.
-Copyright 2011, 2012, 2013, 2014, 2015 The Regents of the University of
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
California. All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -44,34 +44,33 @@ void
softfloat_remStepMBy32(
uint_fast8_t size_words,
const uint32_t *remPtr,
- uint_fast8_t count,
+ uint_fast8_t dist,
const uint32_t *bPtr,
uint32_t q,
uint32_t *zPtr
)
{
- uint_fast8_t negCount;
unsigned int index, lastIndex;
uint64_t dwordProd;
uint32_t wordRem, wordShiftedRem, wordProd;
- uint_fast8_t borrow;
+ uint_fast8_t uNegDist, borrow;
- negCount = -count;
index = indexWordLo( size_words );
lastIndex = indexWordHi( size_words );
dwordProd = (uint64_t) bPtr[index] * q;
wordRem = remPtr[index];
- wordShiftedRem = wordRem<<count;
+ wordShiftedRem = wordRem<<dist;
wordProd = dwordProd;
zPtr[index] = wordShiftedRem - wordProd;
if ( index != lastIndex ) {
+ uNegDist = -dist;
borrow = (wordShiftedRem < wordProd);
for (;;) {
- wordShiftedRem = wordRem>>(negCount & 31);
+ wordShiftedRem = wordRem>>(uNegDist & 31);
index += wordIncr;
dwordProd = (uint64_t) bPtr[index] * q + (dwordProd>>32);
wordRem = remPtr[index];
- wordShiftedRem |= wordRem<<count;
+ wordShiftedRem |= wordRem<<dist;
wordProd = dwordProd;
zPtr[index] = wordShiftedRem - wordProd - borrow;
if ( index == lastIndex ) break;