diff options
author | Keith Packard <keithp@keithp.com> | 2014-05-03 10:58:31 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-05-08 20:44:10 -0700 |
commit | d59d6787bfe26c3b18491ece602ad6cc5cf26c42 (patch) | |
tree | aafa0d274398e831c09e4f22d16064dd0bb0d86b /src | |
parent | c49e13a7807a74bb66c83cd4a2e10eb601f59e62 (diff) |
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 <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/kernel/ao_int64.c | 6 |
1 files 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 <ao_int64.h> -__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); } |