From 51a27f176b0eb5fb2943807a5cb95f2024420936 Mon Sep 17 00:00:00 2001 From: Cyril SIX Date: Tue, 11 Dec 2018 14:26:46 +0100 Subject: Fixed div64 and mod64 --- runtime/mppa_k1c/Makefile | 2 +- runtime/mppa_k1c/i64_udivmod.c | 30 ------------------------------ 2 files changed, 1 insertion(+), 31 deletions(-) (limited to 'runtime') diff --git a/runtime/mppa_k1c/Makefile b/runtime/mppa_k1c/Makefile index e10c5086..37e15e94 100644 --- a/runtime/mppa_k1c/Makefile +++ b/runtime/mppa_k1c/Makefile @@ -1,4 +1,4 @@ -CCOMP ?= ccomp +CCOMP ?= ../../ccomp CFLAGS ?= -O2 -D__K1_TINYK1__ CFILES=$(wildcard *.c) diff --git a/runtime/mppa_k1c/i64_udivmod.c b/runtime/mppa_k1c/i64_udivmod.c index 20d8c976..74b39874 100644 --- a/runtime/mppa_k1c/i64_udivmod.c +++ b/runtime/mppa_k1c/i64_udivmod.c @@ -1,31 +1,3 @@ -#ifdef __K1_TINYK1__ -unsigned long long -udivmoddi4(unsigned long long num, unsigned long long den, int modwanted) -{ - unsigned long long bit = 1; - unsigned long long res = 0; - - while (den < num && bit && !(den & (1L<<31))) - { - den <<=1; - bit <<=1; - } - while (bit) - { - if (num >= den) - { - num -= den; - res |= bit; - } - bit >>=1; - den >>=1; - } - if (modwanted) return num; - return res; -} - -#else - /* THIS IS THE PREVIOUS VERSION, USED ON BOSTAN AND ANDEY */ unsigned long long udivmoddi4(unsigned long long num, unsigned long long den, int modwanted) @@ -54,5 +26,3 @@ udivmoddi4(unsigned long long num, unsigned long long den, int modwanted) return modwanted ? r : q; } -#endif /* __K1_TINYK1__ */ - -- cgit