aboutsummaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-20 11:18:51 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-20 11:18:51 +0100
commitbf0b2478a7cb6724cfce41695b552db47eacbff2 (patch)
tree429c44575a4a3149e8f8ea4f30c5445b659fa6c2 /runtime
parentc86388b548984dae5f8dd794cad1f4b4505d4307 (diff)
downloadcompcert-kvx-bf0b2478a7cb6724cfce41695b552db47eacbff2.tar.gz
compcert-kvx-bf0b2478a7cb6724cfce41695b552db47eacbff2.zip
sdiv works
Diffstat (limited to 'runtime')
-rw-r--r--runtime/mppa_k1c/Makefile2
-rw-r--r--runtime/mppa_k1c/i64_sdiv.c14
2 files changed, 15 insertions, 1 deletions
diff --git a/runtime/mppa_k1c/Makefile b/runtime/mppa_k1c/Makefile
index 37e15e94..9f2ba980 100644
--- a/runtime/mppa_k1c/Makefile
+++ b/runtime/mppa_k1c/Makefile
@@ -11,4 +11,4 @@ all: $(SFILES)
.SECONDARY:
%.s: %.c $(CCOMPPATH)
$(CCOMP) $(CFLAGS) -S $< -o $@
- sed -i -e 's/i64_/__compcert_i64_/g' $@
+ sed -i -e 's/i64_/__compcert_i64_/g' -e 's/i32_/__compcert_i32_/g' $@
diff --git a/runtime/mppa_k1c/i64_sdiv.c b/runtime/mppa_k1c/i64_sdiv.c
index 9ef1a25c..e312f6e8 100644
--- a/runtime/mppa_k1c/i64_sdiv.c
+++ b/runtime/mppa_k1c/i64_sdiv.c
@@ -1,3 +1,4 @@
+#if COMPLIQUE
unsigned long long
udivmoddi4(unsigned long long num, unsigned long long den, int modwanted);
@@ -27,3 +28,16 @@ i64_sdiv (long long a, long long b)
return res;
}
+#else
+extern long __divdi3 (long a, long b);
+
+long i64_sdiv (long a, long b)
+{
+ return __divdi3 (a, b);
+}
+
+int i32_sdiv (int a, int b)
+{
+ return __divdi3 (a, b);
+}
+#endif