diff options
Diffstat (limited to 'runtime')
l--------- | runtime/c/ccomp_k1c_fixes.h | 1 | ||||
-rw-r--r-- | runtime/include/ccomp_k1c_fixes.h | 4 | ||||
l--------- | runtime/mppa_k1c/ccomp_k1c_fixes.h | 1 | ||||
-rw-r--r-- | runtime/mppa_k1c/i64_sdiv.c | 10 |
4 files changed, 16 insertions, 0 deletions
diff --git a/runtime/c/ccomp_k1c_fixes.h b/runtime/c/ccomp_k1c_fixes.h new file mode 120000 index 00000000..b640c96e --- /dev/null +++ b/runtime/c/ccomp_k1c_fixes.h @@ -0,0 +1 @@ +../include/ccomp_k1c_fixes.h
\ No newline at end of file diff --git a/runtime/include/ccomp_k1c_fixes.h b/runtime/include/ccomp_k1c_fixes.h index 9a2a26c1..5c543d8f 100644 --- a/runtime/include/ccomp_k1c_fixes.h +++ b/runtime/include/ccomp_k1c_fixes.h @@ -18,3 +18,7 @@ extern __int128 __compcert_acswapd(void *address, unsigned long long new_value, #define __builtin_k1_acswapw __compcert_acswapw extern __int128 __compcert_acswapw(void *address, unsigned long long new_value, unsigned long long old_value); #endif + +#define __builtin_expect(x, y) (x) +#define __builtin_ctz(x) __builtin_k1_ctzw(x) +#define __builtin_clz(x) __builtin_k1_clzw(x) diff --git a/runtime/mppa_k1c/ccomp_k1c_fixes.h b/runtime/mppa_k1c/ccomp_k1c_fixes.h new file mode 120000 index 00000000..b640c96e --- /dev/null +++ b/runtime/mppa_k1c/ccomp_k1c_fixes.h @@ -0,0 +1 @@ +../include/ccomp_k1c_fixes.h
\ No newline at end of file diff --git a/runtime/mppa_k1c/i64_sdiv.c b/runtime/mppa_k1c/i64_sdiv.c index 9feab791..892aac07 100644 --- a/runtime/mppa_k1c/i64_sdiv.c +++ b/runtime/mppa_k1c/i64_sdiv.c @@ -10,7 +10,17 @@ int i32_sdiv (int a, int b) return __divdi3 (a, b); } +#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 +#define K1_SFR_CS_OV_MASK COS_SFR_CS_OV_MASK +#define K1_SFR_CS_UN_MASK COS_SFR_CS_UN_MASK +#define K1_SFR_CS_IN_MASK COS_SFR_CS_IN_MASK +#define K1_SFR_CS COS_SFR_CS +#else #include <mppa_bare_runtime/k1c/registers.h> +#endif /* DM FIXME this is for floating point */ int fetestexcept(int excepts) { |