From 2f733d9f0da3d3a7032aea4f94be6a5fd257f193 Mon Sep 17 00:00:00 2001 From: Pixel <> Date: Mon, 16 Apr 2001 16:35:18 +0000 Subject: Fast ALU mul & div fixed --- lib/alu.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/alu.c b/lib/alu.c index 0419ffd..ffbf9c8 100644 --- a/lib/alu.c +++ b/lib/alu.c @@ -36,21 +36,31 @@ Uint32 RSoustractionSigne(Uint32 a, Uint32 b) Uint32 RMultiplicationNonSigne(Uint32 a, Uint32 b) { - return (a * b); + unsigned long long temp; + + temp = a * b; + SecondResult = temp >> 32; + return (temp & ((1 << 32) -1)); } Uint32 RMultiplicationSigne(Uint32 a, Uint32 b) { - return (a * b); + unsigned long long temp; + + temp = a * b; + SecondResult = temp >> 32; + return (temp & ((1 << 32) -1)); } Uint32 RDivisionNonSigne(Uint32 a, Uint32 b) { + SecondResult = a % b; return (a / b); } Uint32 RDivisionSigne(Uint32 a, Uint32 b) { + SecondResuld = a % b; return (a / b); } -- cgit v1.2.3