Upgrade to softfloat3e.

This should solve licensing problems as well.
This commit is contained in:
TC1995
2024-06-09 23:08:46 +02:00
parent 4b77ef6823
commit 0f29bcddf1
271 changed files with 25882 additions and 10441 deletions

View File

@@ -1,8 +1,8 @@
#define sf_FPU(name, optype, a_size, load_var, rw, use_var, is_nan, cycle_postfix) \
static int sf_FADD##name##_a##a_size(uint32_t fetchdat) \
{ \
floatx80 a, result; \
struct float_status_t status; \
floatx80 a, result; \
struct softfloat_status_t status; \
optype temp; \
FP_ENTER(); \
FPU_check_pending_exceptions(); \
@@ -19,9 +19,9 @@
status = i387cw_to_softfloat_status_word(i387_get_control_word()); \
a = FPU_read_regi(0); \
if (!is_nan) \
result = floatx80_add(a, use_var, &status); \
result = extF80_add(a, use_var, &status); \
\
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) \
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) \
FPU_save_regi(result, 0); \
\
next_ins: \
@@ -31,8 +31,8 @@ next_ins:
} \
static int sf_FDIV##name##_a##a_size(uint32_t fetchdat) \
{ \
floatx80 a, result; \
struct float_status_t status; \
floatx80 a, result; \
struct softfloat_status_t status; \
optype temp; \
FP_ENTER(); \
FPU_check_pending_exceptions(); \
@@ -49,9 +49,9 @@ next_ins:
status = i387cw_to_softfloat_status_word(i387_get_control_word()); \
a = FPU_read_regi(0); \
if (!is_nan) { \
result = floatx80_div(a, use_var, &status); \
result = extF80_div(a, use_var, &status); \
} \
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) \
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) \
FPU_save_regi(result, 0); \
\
next_ins: \
@@ -61,8 +61,8 @@ next_ins:
} \
static int sf_FDIVR##name##_a##a_size(uint32_t fetchdat) \
{ \
floatx80 a, result; \
struct float_status_t status; \
floatx80 a, result; \
struct softfloat_status_t status; \
optype temp; \
FP_ENTER(); \
FPU_check_pending_exceptions(); \
@@ -79,9 +79,9 @@ next_ins:
status = i387cw_to_softfloat_status_word(i387_get_control_word()); \
a = FPU_read_regi(0); \
if (!is_nan) { \
result = floatx80_div(use_var, a, &status); \
result = extF80_div(use_var, a, &status); \
} \
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) \
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) \
FPU_save_regi(result, 0); \
\
next_ins: \
@@ -91,8 +91,8 @@ next_ins:
} \
static int sf_FMUL##name##_a##a_size(uint32_t fetchdat) \
{ \
floatx80 a, result; \
struct float_status_t status; \
floatx80 a, result; \
struct softfloat_status_t status; \
optype temp; \
FP_ENTER(); \
FPU_check_pending_exceptions(); \
@@ -109,9 +109,9 @@ next_ins:
status = i387cw_to_softfloat_status_word(i387_get_control_word()); \
a = FPU_read_regi(0); \
if (!is_nan) { \
result = floatx80_mul(a, use_var, &status); \
result = extF80_mul(a, use_var, &status); \
} \
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) \
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) \
FPU_save_regi(result, 0); \
\
next_ins: \
@@ -121,8 +121,8 @@ next_ins:
} \
static int sf_FSUB##name##_a##a_size(uint32_t fetchdat) \
{ \
floatx80 a, result; \
struct float_status_t status; \
floatx80 a, result; \
struct softfloat_status_t status; \
optype temp; \
FP_ENTER(); \
FPU_check_pending_exceptions(); \
@@ -139,9 +139,9 @@ next_ins:
status = i387cw_to_softfloat_status_word(i387_get_control_word()); \
a = FPU_read_regi(0); \
if (!is_nan) \
result = floatx80_sub(a, use_var, &status); \
result = extF80_sub(a, use_var, &status); \
\
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) \
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) \
FPU_save_regi(result, 0); \
\
next_ins: \
@@ -151,8 +151,8 @@ next_ins:
} \
static int sf_FSUBR##name##_a##a_size(uint32_t fetchdat) \
{ \
floatx80 a, result; \
struct float_status_t status; \
floatx80 a, result; \
struct softfloat_status_t status; \
optype temp; \
FP_ENTER(); \
FPU_check_pending_exceptions(); \
@@ -169,9 +169,9 @@ next_ins:
status = i387cw_to_softfloat_status_word(i387_get_control_word()); \
a = FPU_read_regi(0); \
if (!is_nan) \
result = floatx80_sub(use_var, a, &status); \
result = extF80_sub(use_var, a, &status); \
\
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) \
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) \
FPU_save_regi(result, 0); \
\
next_ins: \
@@ -181,31 +181,31 @@ next_ins:
}
// clang-format off
sf_FPU(s, float32, 16, temp, geteal(), float32_to_floatx80(temp, &status), FPU_handle_NaN32(a, temp, &result, &status), _32)
sf_FPU(s, float32, 16, temp, geteal(), f32_to_extF80(temp, &status), FPU_handle_NaN32(a, temp, &result, &status), _32)
#ifndef FPU_8087
sf_FPU(s, float32, 32, temp, geteal(), float32_to_floatx80(temp, &status), FPU_handle_NaN32(a, temp, &result, &status), _32)
sf_FPU(s, float32, 32, temp, geteal(), f32_to_extF80(temp, &status), FPU_handle_NaN32(a, temp, &result, &status), _32)
#endif
sf_FPU(d, float64, 16, temp, geteaq(), float64_to_floatx80(temp, &status), FPU_handle_NaN64(a, temp, &result, &status), _64)
sf_FPU(d, float64, 16, temp, geteaq(), f64_to_extF80(temp, &status), FPU_handle_NaN64(a, temp, &result, &status), _64)
#ifndef FPU_8087
sf_FPU(d, float64, 32, temp, geteaq(), float64_to_floatx80(temp, &status), FPU_handle_NaN64(a, temp, &result, &status), _64)
sf_FPU(d, float64, 32, temp, geteaq(), f64_to_extF80(temp, &status), FPU_handle_NaN64(a, temp, &result, &status), _64)
#endif
sf_FPU(iw, uint16_t, 16, temp, geteaw(), int32_to_floatx80((int16_t)temp), 0, _i16)
sf_FPU(iw, uint16_t, 16, temp, geteaw(), i32_to_extF80((int16_t)temp), 0, _i16)
#ifndef FPU_8087
sf_FPU(iw, uint16_t, 32, temp, geteaw(), int32_to_floatx80((int16_t)temp), 0, _i16)
sf_FPU(iw, uint16_t, 32, temp, geteaw(), i32_to_extF80((int16_t)temp), 0, _i16)
#endif
sf_FPU(il, uint32_t, 16, temp, geteal(), int32_to_floatx80((int32_t)temp), 0, _i32)
sf_FPU(il, uint32_t, 16, temp, geteal(), i32_to_extF80((int32_t)temp), 0, _i32)
#ifndef FPU_8087
sf_FPU(il, uint32_t, 32, temp, geteal(), int32_to_floatx80((int32_t)temp), 0, _i32)
sf_FPU(il, uint32_t, 32, temp, geteal(), i32_to_extF80((int32_t)temp), 0, _i32)
#endif
// clang-format on
// clang-format on
static int sf_FADD_st0_stj(uint32_t fetchdat)
static int sf_FADD_st0_stj(uint32_t fetchdat)
{
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
@@ -218,9 +218,9 @@ sf_FPU(il, uint32_t, 32, temp, geteal(), int32_to_floatx80((int32_t)temp), 0, _i
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(0);
b = FPU_read_regi(fetchdat & 7);
result = floatx80_add(a, b, &status);
result = extF80_add(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0))
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0))
FPU_save_regi(result, 0);
next_ins:
@@ -234,7 +234,7 @@ sf_FADD_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
@@ -247,9 +247,9 @@ sf_FADD_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(fetchdat & 7);
b = FPU_read_regi(0);
result = floatx80_add(a, b, &status);
result = extF80_add(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0))
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0))
FPU_save_regi(result, fetchdat & 7);
next_ins:
@@ -264,7 +264,7 @@ sf_FADDP_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
@@ -277,9 +277,9 @@ sf_FADDP_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(fetchdat & 7);
b = FPU_read_regi(0);
result = floatx80_add(a, b, &status);
result = extF80_add(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, fetchdat & 7);
FPU_pop();
}
@@ -296,9 +296,10 @@ sf_FDIV_st0_stj(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -308,9 +309,9 @@ sf_FDIV_st0_stj(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(0);
b = FPU_read_regi(fetchdat & 7);
result = floatx80_div(a, b, &status);
result = extF80_div(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0))
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0))
FPU_save_regi(result, 0);
next_ins:
@@ -325,9 +326,10 @@ sf_FDIV_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -337,9 +339,9 @@ sf_FDIV_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(fetchdat & 7);
b = FPU_read_regi(0);
result = floatx80_div(a, b, &status);
result = extF80_div(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0))
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0))
FPU_save_regi(result, fetchdat & 7);
next_ins:
@@ -353,9 +355,10 @@ sf_FDIVP_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -365,9 +368,9 @@ sf_FDIVP_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(fetchdat & 7);
b = FPU_read_regi(0);
result = floatx80_div(a, b, &status);
result = extF80_div(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, fetchdat & 7);
FPU_pop();
}
@@ -384,9 +387,10 @@ sf_FDIVR_st0_stj(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -396,9 +400,9 @@ sf_FDIVR_st0_stj(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(fetchdat & 7);
b = FPU_read_regi(0);
result = floatx80_div(a, b, &status);
result = extF80_div(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0))
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0))
FPU_save_regi(result, 0);
next_ins:
@@ -412,9 +416,10 @@ sf_FDIVR_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -424,9 +429,9 @@ sf_FDIVR_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(0);
b = FPU_read_regi(fetchdat & 7);
result = floatx80_div(a, b, &status);
result = extF80_div(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0))
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0))
FPU_save_regi(result, fetchdat & 7);
next_ins:
@@ -440,9 +445,10 @@ sf_FDIVRP_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -452,9 +458,9 @@ sf_FDIVRP_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(0);
b = FPU_read_regi(fetchdat & 7);
result = floatx80_div(a, b, &status);
result = extF80_div(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, fetchdat & 7);
FPU_pop();
}
@@ -471,9 +477,10 @@ sf_FMUL_st0_stj(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -483,9 +490,9 @@ sf_FMUL_st0_stj(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(0);
b = FPU_read_regi(fetchdat & 7);
result = floatx80_mul(a, b, &status);
result = extF80_mul(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, 0);
}
@@ -500,9 +507,10 @@ sf_FMUL_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -512,9 +520,9 @@ sf_FMUL_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(0);
b = FPU_read_regi(fetchdat & 7);
result = floatx80_mul(a, b, &status);
result = extF80_mul(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, fetchdat & 7);
}
@@ -529,9 +537,10 @@ sf_FMULP_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -541,9 +550,9 @@ sf_FMULP_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(fetchdat & 7);
b = FPU_read_regi(0);
result = floatx80_mul(a, b, &status);
result = extF80_mul(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, fetchdat & 7);
FPU_pop();
}
@@ -560,9 +569,10 @@ sf_FSUB_st0_stj(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -572,9 +582,9 @@ sf_FSUB_st0_stj(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(0);
b = FPU_read_regi(fetchdat & 7);
result = floatx80_sub(a, b, &status);
result = extF80_sub(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, 0);
}
@@ -589,9 +599,10 @@ sf_FSUB_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -601,9 +612,9 @@ sf_FSUB_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(fetchdat & 7);
b = FPU_read_regi(0);
result = floatx80_sub(a, b, &status);
result = extF80_sub(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, fetchdat & 7);
}
@@ -618,9 +629,10 @@ sf_FSUBP_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -630,9 +642,9 @@ sf_FSUBP_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(fetchdat & 7);
b = FPU_read_regi(0);
result = floatx80_sub(a, b, &status);
result = extF80_sub(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, fetchdat & 7);
FPU_pop();
}
@@ -649,9 +661,10 @@ sf_FSUBR_st0_stj(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -661,9 +674,9 @@ sf_FSUBR_st0_stj(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(fetchdat & 7);
b = FPU_read_regi(0);
result = floatx80_sub(a, b, &status);
result = extF80_sub(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, 0);
}
@@ -678,9 +691,10 @@ sf_FSUBR_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -690,9 +704,9 @@ sf_FSUBR_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(0);
b = FPU_read_regi(fetchdat & 7);
result = floatx80_sub(a, b, &status);
result = extF80_sub(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, fetchdat & 7);
}
@@ -707,9 +721,10 @@ sf_FSUBRP_sti_st0(uint32_t fetchdat)
floatx80 a;
floatx80 b;
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0) || IS_TAG_EMPTY(fetchdat & 7)) {
@@ -719,9 +734,9 @@ sf_FSUBRP_sti_st0(uint32_t fetchdat)
status = i387cw_to_softfloat_status_word(i387_get_control_word());
a = FPU_read_regi(0);
b = FPU_read_regi(fetchdat & 7);
result = floatx80_sub(a, b, &status);
result = extF80_sub(a, b, &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, fetchdat & 7);
FPU_pop();
}
@@ -736,9 +751,10 @@ static int
sf_FSQRT(uint32_t fetchdat)
{
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0)) {
@@ -746,9 +762,9 @@ sf_FSQRT(uint32_t fetchdat)
goto next_ins;
}
status = i387cw_to_softfloat_status_word(i387_get_control_word());
result = floatx80_sqrt(FPU_read_regi(0), &status);
result = extF80_sqrt(FPU_read_regi(0), &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, 0);
}
@@ -762,9 +778,10 @@ static int
sf_FRNDINT(uint32_t fetchdat)
{
floatx80 result;
struct float_status_t status;
struct softfloat_status_t status;
FP_ENTER();
FPU_check_pending_exceptions();
cpu_state.pc++;
clear_C1();
if (IS_TAG_EMPTY(0)) {
@@ -772,9 +789,9 @@ sf_FRNDINT(uint32_t fetchdat)
goto next_ins;
}
status = i387cw_to_softfloat_status_word(i387_get_control_word());
result = floatx80_round_to_int(FPU_read_regi(0), &status);
result = extF80_roundToInt_normal(FPU_read_regi(0), &status);
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
if (!FPU_exception(fetchdat, status.softfloat_exceptionFlags, 0)) {
FPU_save_regi(result, 0);
}