diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2018-12-11 14:26:46 +0100 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2018-12-11 14:26:46 +0100 |
commit | 51a27f176b0eb5fb2943807a5cb95f2024420936 (patch) | |
tree | 4e1aceadab40427a7a5a80ec9250595a2ed534f3 /runtime | |
parent | a045315a8d1da5c4f726512b0dd972897afe9971 (diff) | |
download | compcert-kvx-51a27f176b0eb5fb2943807a5cb95f2024420936.tar.gz compcert-kvx-51a27f176b0eb5fb2943807a5cb95f2024420936.zip |
Fixed div64 and mod64
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/mppa_k1c/Makefile | 2 | ||||
-rw-r--r-- | runtime/mppa_k1c/i64_udivmod.c | 30 |
2 files changed, 1 insertions, 31 deletions
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__ */ - |