Skip to content

Commit

Permalink
remove code that was replaced by the use of ANSI
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Monson committed Sep 28, 2018
1 parent 205b64c commit 820f3cc
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions Modules/_decimal/libmpdec/typearith.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,31 +525,6 @@ _mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo,
*r = rr;
}
/* END MASM (_MSC_VER) */
#elif defined _M_ARM
static inline void __cdecl
_mpd_mul_words(mpd_uint_t *hi, mpd_uint_t *lo, mpd_uint_t a, mpd_uint_t b)
{
uint64_t aa = a;
uint64_t bb = b;
uint64_t result = aa * bb;

*lo = (mpd_uint_t)result & 0xFFFFFFFF;
*hi = (mpd_uint_t)(result >> 32) & 0xFFFFFFFF;
}

static inline void __cdecl
_mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo,
mpd_uint_t d)
{
uint64_t numerator = (((uint64_t)hi) << 32) | ((uint64_t)lo);
uint64_t denominator = d;
uint64_t quotient = numerator / denominator;
uint64_t remainder = numerator % denominator;

*q = (mpd_uint_t)quotient;
*r = (mpd_uint_t)remainder;
}

#else
#error "need platform specific 64 bit multiplication and division"
#endif
Expand Down

0 comments on commit 820f3cc

Please sign in to comment.