diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/mppa_k1c/i64_sdiv.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/runtime/mppa_k1c/i64_sdiv.c b/runtime/mppa_k1c/i64_sdiv.c index 0b281d3e..c80ae0cb 100644 --- a/runtime/mppa_k1c/i64_sdiv.c +++ b/runtime/mppa_k1c/i64_sdiv.c @@ -51,3 +51,18 @@ float f32_div(float a, float b) { return __divsf3(a, b); } #endif + +#include <mppa_bare_runtime/k1c/registers.h> + +/* 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; + unsigned long long cs = __builtin_k1_get(K1_SFR_CS); + return cs & mask; +} + +int feclearexcept(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; + __builtin_k1_wfxl(K1_SFR_CS, mask); + return 0; +} |