aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/mppa_k1c/i64_sdiv.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/mppa_k1c/i64_sdiv.c')
-rw-r--r--runtime/mppa_k1c/i64_sdiv.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/mppa_k1c/i64_sdiv.c b/runtime/mppa_k1c/i64_sdiv.c
index 9fac8ff9..df308736 100644
--- a/runtime/mppa_k1c/i64_sdiv.c
+++ b/runtime/mppa_k1c/i64_sdiv.c
@@ -1,4 +1,14 @@
+extern long __divdi3 (long a, long b);
+
+int i32_sdiv (int a, int b)
+{
+ return __divdi3 (a, b);
+}
+
+/* #define COMPCERT_FE_EXCEPT */
+#ifdef COMPCERT_FE_EXCEPT
#ifdef __K1C_COS__
+
#include <hal/cos_registers.h>
#define K1_SFR_CS_IO_MASK COS_SFR_CS_IO_MASK
#define K1_SFR_CS_DZ_MASK COS_SFR_CS_DZ_MASK
@@ -10,8 +20,6 @@
#include <mppa_bare_runtime/k1c/registers.h>
#endif
-/* #define COMPCERT_FE_EXCEPT */
-#ifdef COMPCERT_FE_EXCEPT
/* DM FIXME this is for floating point */
int fetestexcept(int excepts) {
int mask = (K1_SFR_CS_IO_MASK | K1_SFR_CS_DZ_MASK | K1_SFR_CS_OV_MASK | K1_SFR_CS_UN_MASK | K1_SFR_CS_IN_MASK) & excepts;