From: Keith Packard Date: Sat, 3 May 2014 17:58:31 +0000 (-0700) Subject: altos: 8051 64 * 16 multiply function was broken for negative 64-bit X-Git-Tag: 1.3.2.2~123 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=d59d6787bfe26c3b18491ece602ad6cc5cf26c42 altos: 8051 64 * 16 multiply function was broken for negative 64-bit It was jumping around the actual multiply when the 64-bit argument was negative. Signed-off-by: Keith Packard --- diff --git a/src/kernel/ao_int64.c b/src/kernel/ao_int64.c index aa23dbe0..ca75751b 100644 --- a/src/kernel/ao_int64.c +++ b/src/kernel/ao_int64.c @@ -17,8 +17,6 @@ #include -__pdata ao_int64_t *__data ao_64r, *__data ao_64a, *__data ao_64b; - void ao_plus64(__pdata ao_int64_t *r, __pdata ao_int64_t *a, __pdata ao_int64_t *b) __FATTR { __LOCAL uint32_t t; @@ -151,8 +149,8 @@ void ao_mul64_64_16(__ARG ao_int64_t *r, __ARG ao_int64_t *a, __ARG uint16_t b) ao_neg64(&ap, a); a = ≈ negative++; - } else - ao_umul64_64_16(r, a, b); + } + ao_umul64_64_16(r, a, b); if (negative) ao_neg64(r, r); }