aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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