From d59d6787bfe26c3b18491ece602ad6cc5cf26c42 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 3 May 2014 10:58:31 -0700 Subject: [PATCH] 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 --- src/kernel/ao_int64.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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); } -- 2.30.2