diff options
author | 2019-10-25 13:51:36 +0700 | |
---|---|---|
committer | 2019-10-25 13:51:36 +0700 | |
commit | c263a02b50af103ada7b0ae244297ab0b8e08699 (patch) | |
tree | 3cd8aa3eb78dab869d5b58e5b064f4df29c8c2c3 /src/devices/cpu/clipper/clipper.h | |
parent | 864e12ec7086c7def8ca627a1dd64b6ca7cca8d8 (diff) |
clipper: migrate to softfloat3 (nw)
Diffstat (limited to 'src/devices/cpu/clipper/clipper.h')
-rw-r--r-- | src/devices/cpu/clipper/clipper.h | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/devices/cpu/clipper/clipper.h b/src/devices/cpu/clipper/clipper.h index d480100d509..b54a661c1a0 100644 --- a/src/devices/cpu/clipper/clipper.h +++ b/src/devices/cpu/clipper/clipper.h @@ -6,9 +6,7 @@ #pragma once -#include <limits.h> -#include "softfloat/milieu.h" -#include "softfloat/softfloat.h" +#include "softfloat3/source/include/softfloat.h" #include "cpu/clipper/common.h" #include "machine/cammu.h" @@ -142,11 +140,11 @@ public: enum fp_exception_mask : u8 { F_NONE = (0), - F_I = (float_flag_invalid), - F_X = (float_flag_inexact), - F_IX = (float_flag_invalid | float_flag_inexact), - F_IVUX = (float_flag_invalid | float_flag_overflow | float_flag_underflow | float_flag_inexact), - F_IVDUX = (float_flag_invalid | float_flag_overflow | float_flag_divbyzero | float_flag_underflow | float_flag_inexact) + F_I = (softfloat_flag_invalid), + F_X = (softfloat_flag_inexact), + F_IX = (softfloat_flag_invalid | softfloat_flag_inexact), + F_IVUX = (softfloat_flag_invalid | softfloat_flag_overflow | softfloat_flag_underflow | softfloat_flag_inexact), + F_IVDUX = (softfloat_flag_invalid | softfloat_flag_overflow | softfloat_flag_infinite | softfloat_flag_underflow | softfloat_flag_inexact) }; protected: @@ -207,19 +205,19 @@ protected: } // floating point helpers - float32 get_fp32(const u8 reg) const { return m_f[reg & 0xf]; } - float64 get_fp64(const u8 reg) const { return m_f[reg & 0xf]; } - template <typename T> void set_fp(const u8 reg, const T data, const fp_exception_mask exception_mask) + float32_t get_fp32(u8 const reg) const { return float32_t{ u32(m_f[reg & 0xf]) }; } + float64_t get_fp64(u8 const reg) const { return float64_t{ m_f[reg & 0xf] }; } + template <typename T> void set_fp(u8 const reg, T const data, fp_exception_mask const exception_mask) { // suppress unexpected exceptions - float_exception_flags &= exception_mask; + softfloat_exceptionFlags &= exception_mask; // save floating exception state m_fp_pc = m_pc; m_fp_dst = m_f[reg & 0xf]; // assign data - if (float_exception_flags & float_flag_overflow && PSW(EFV)) + if (softfloat_exceptionFlags & softfloat_flag_overflow && PSW(EFV)) { /* * If the EFV flag is set, the computed result is delivered to the @@ -241,9 +239,9 @@ protected: * Standard wrapped exponent. */ // FIXME: implement non-IEEE behaviour described above - m_f[reg & 0xf] = data; + m_f[reg & 0xf] = data.v; } - else if (float_exception_flags & float_flag_underflow && PSW(EFU)) + else if (softfloat_exceptionFlags & softfloat_flag_underflow && PSW(EFU)) { /* * If EFU is set, the floating underflow exception is signalled @@ -260,10 +258,10 @@ protected: * is 0..-275; for double-precision the range is 0..-1125. */ // FIXME: implement non-IEEE behaviour described above - m_f[reg & 0xf] = data; + m_f[reg & 0xf] = data.v; } else - m_f[reg & 0xf] = data; + m_f[reg & 0xf] = data.v; // set floating dirty flag m_ssw |= SSW_FRD; |