Clang-formatting in src/cpu
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
static int
|
||||
sf_F2XM1(uint32_t fetchdat)
|
||||
{
|
||||
floatx80 result;
|
||||
floatx80 result;
|
||||
struct float_status_t status;
|
||||
|
||||
FP_ENTER();
|
||||
@@ -13,7 +13,7 @@ sf_F2XM1(uint32_t fetchdat)
|
||||
}
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word() | FPU_PR_80_BITS);
|
||||
result = f2xm1(FPU_read_regi(0), &status);
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0))
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0))
|
||||
FPU_save_regi(result, 0);
|
||||
|
||||
next_ins:
|
||||
@@ -25,7 +25,7 @@ next_ins:
|
||||
static int
|
||||
sf_FYL2X(uint32_t fetchdat)
|
||||
{
|
||||
floatx80 result;
|
||||
floatx80 result;
|
||||
struct float_status_t status;
|
||||
|
||||
FP_ENTER();
|
||||
@@ -37,7 +37,7 @@ sf_FYL2X(uint32_t fetchdat)
|
||||
}
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word() | FPU_PR_80_BITS);
|
||||
result = fyl2x(FPU_read_regi(0), FPU_read_regi(1), &status);
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
FPU_pop();
|
||||
FPU_save_regi(result, 0);
|
||||
}
|
||||
@@ -51,8 +51,8 @@ next_ins:
|
||||
static int
|
||||
sf_FPTAN(uint32_t fetchdat)
|
||||
{
|
||||
const floatx80 floatx80_default_nan = packFloatx80(0, floatx80_default_nan_exp, floatx80_default_nan_fraction);
|
||||
floatx80 y;
|
||||
const floatx80 floatx80_default_nan = packFloatx80(0, floatx80_default_nan_exp, floatx80_default_nan_fraction);
|
||||
floatx80 y;
|
||||
struct float_status_t status;
|
||||
|
||||
FP_ENTER();
|
||||
@@ -74,14 +74,14 @@ sf_FPTAN(uint32_t fetchdat)
|
||||
goto next_ins;
|
||||
}
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word() | FPU_PR_80_BITS);
|
||||
y = FPU_read_regi(0);
|
||||
y = FPU_read_regi(0);
|
||||
if (ftan(&y, &status) == -1) {
|
||||
fpu_state.swd |= C2;
|
||||
goto next_ins;
|
||||
}
|
||||
|
||||
if (floatx80_is_nan(y)) {
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
FPU_save_regi(y, 0);
|
||||
FPU_push();
|
||||
FPU_save_regi(y, 0);
|
||||
@@ -89,7 +89,7 @@ sf_FPTAN(uint32_t fetchdat)
|
||||
goto next_ins;
|
||||
}
|
||||
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
FPU_save_regi(y, 0);
|
||||
FPU_push();
|
||||
FPU_save_regi(Const_1, 0);
|
||||
@@ -115,11 +115,11 @@ sf_FPATAN(uint32_t fetchdat)
|
||||
FPU_stack_underflow(fetchdat, 1, 1);
|
||||
goto next_ins;
|
||||
}
|
||||
a = FPU_read_regi(0);
|
||||
b = FPU_read_regi(1);
|
||||
a = FPU_read_regi(0);
|
||||
b = FPU_read_regi(1);
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word() | FPU_PR_80_BITS);
|
||||
result = fpatan(a, b, &status);
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
FPU_pop();
|
||||
FPU_save_regi(result, 0);
|
||||
}
|
||||
@@ -141,7 +141,7 @@ sf_FXTRACT(uint32_t fetchdat)
|
||||
cpu_state.pc++;
|
||||
clear_C1();
|
||||
|
||||
#if 0 //TODO
|
||||
#if 0 // TODO
|
||||
if ((IS_TAG_EMPTY(0) || IS_TAG_EMPTY(-1))) {
|
||||
if (IS_TAG_EMPTY(0))
|
||||
FPU_exception(fetchdat, FPU_EX_Stack_Underflow, 0);
|
||||
@@ -159,15 +159,15 @@ sf_FXTRACT(uint32_t fetchdat)
|
||||
#endif
|
||||
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word());
|
||||
a = FPU_read_regi(0);
|
||||
b = floatx80_extract(&a, &status);
|
||||
a = FPU_read_regi(0);
|
||||
b = floatx80_extract(&a, &status);
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
FPU_save_regi(b, 0); // exponent
|
||||
FPU_push();
|
||||
FPU_save_regi(a, 0); // fraction
|
||||
}
|
||||
|
||||
#if 0 //TODO.
|
||||
#if 0 // TODO.
|
||||
next_ins:
|
||||
#endif
|
||||
CLOCK_CYCLES_FPU((fpu_type >= FPU_487SX) ? (x87_timings.fxtract) : (x87_timings.fxtract * cpu_multi));
|
||||
@@ -195,10 +195,10 @@ sf_FPREM1(uint32_t fetchdat)
|
||||
goto next_ins;
|
||||
}
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word());
|
||||
a = FPU_read_regi(0);
|
||||
b = FPU_read_regi(1);
|
||||
flags = floatx80_ieee754_remainder(a, b, &result, "ient, &status);
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
a = FPU_read_regi(0);
|
||||
b = FPU_read_regi(1);
|
||||
flags = floatx80_ieee754_remainder(a, b, &result, "ient, &status);
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
if (flags >= 0) {
|
||||
cc = 0;
|
||||
if (flags)
|
||||
@@ -242,11 +242,11 @@ sf_FPREM(uint32_t fetchdat)
|
||||
goto next_ins;
|
||||
}
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word());
|
||||
a = FPU_read_regi(0);
|
||||
b = FPU_read_regi(1);
|
||||
a = FPU_read_regi(0);
|
||||
b = FPU_read_regi(1);
|
||||
// handle unsupported extended double-precision floating encodings
|
||||
flags = floatx80_remainder(a, b, &result, "ient, &status);
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
if (flags >= 0) {
|
||||
cc = 0;
|
||||
if (flags)
|
||||
@@ -273,7 +273,7 @@ next_ins:
|
||||
static int
|
||||
sf_FYL2XP1(uint32_t fetchdat)
|
||||
{
|
||||
floatx80 result;
|
||||
floatx80 result;
|
||||
struct float_status_t status;
|
||||
|
||||
FP_ENTER();
|
||||
@@ -285,7 +285,7 @@ sf_FYL2XP1(uint32_t fetchdat)
|
||||
}
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word() | FPU_PR_80_BITS);
|
||||
result = fyl2xp1(FPU_read_regi(0), FPU_read_regi(1), &status);
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
FPU_save_regi(result, 1);
|
||||
FPU_pop();
|
||||
}
|
||||
@@ -325,12 +325,12 @@ sf_FSINCOS(uint32_t fetchdat)
|
||||
goto next_ins;
|
||||
}
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word() | FPU_PR_80_BITS);
|
||||
y = FPU_read_regi(0);
|
||||
y = FPU_read_regi(0);
|
||||
if (fsincos(y, &sin_y, &cos_y, &status) == -1) {
|
||||
fpu_state.swd |= C2;
|
||||
goto next_ins;
|
||||
}
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0)) {
|
||||
FPU_save_regi(sin_y, 0);
|
||||
FPU_push();
|
||||
FPU_save_regi(cos_y, 0);
|
||||
@@ -346,7 +346,7 @@ next_ins:
|
||||
static int
|
||||
sf_FSCALE(uint32_t fetchdat)
|
||||
{
|
||||
floatx80 result;
|
||||
floatx80 result;
|
||||
struct float_status_t status;
|
||||
|
||||
FP_ENTER();
|
||||
@@ -358,7 +358,7 @@ sf_FSCALE(uint32_t fetchdat)
|
||||
}
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word());
|
||||
result = floatx80_scale(FPU_read_regi(0), FPU_read_regi(1), &status);
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0))
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0))
|
||||
FPU_save_regi(result, 0);
|
||||
|
||||
next_ins:
|
||||
@@ -371,7 +371,7 @@ next_ins:
|
||||
static int
|
||||
sf_FSIN(uint32_t fetchdat)
|
||||
{
|
||||
floatx80 y;
|
||||
floatx80 y;
|
||||
struct float_status_t status;
|
||||
|
||||
FP_ENTER();
|
||||
@@ -383,12 +383,12 @@ sf_FSIN(uint32_t fetchdat)
|
||||
goto next_ins;
|
||||
}
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word() | FPU_PR_80_BITS);
|
||||
y = FPU_read_regi(0);
|
||||
y = FPU_read_regi(0);
|
||||
if (fsin(&y, &status) == -1) {
|
||||
fpu_state.swd |= C2;
|
||||
goto next_ins;
|
||||
}
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0))
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0))
|
||||
FPU_save_regi(y, 0);
|
||||
|
||||
next_ins:
|
||||
@@ -400,7 +400,7 @@ next_ins:
|
||||
static int
|
||||
sf_FCOS(uint32_t fetchdat)
|
||||
{
|
||||
floatx80 y;
|
||||
floatx80 y;
|
||||
struct float_status_t status;
|
||||
|
||||
FP_ENTER();
|
||||
@@ -412,12 +412,12 @@ sf_FCOS(uint32_t fetchdat)
|
||||
goto next_ins;
|
||||
}
|
||||
status = i387cw_to_softfloat_status_word(i387_get_control_word() | FPU_PR_80_BITS);
|
||||
y = FPU_read_regi(0);
|
||||
y = FPU_read_regi(0);
|
||||
if (fcos(&y, &status) == -1) {
|
||||
fpu_state.swd |= C2;
|
||||
goto next_ins;
|
||||
}
|
||||
if (! FPU_exception(fetchdat, status.float_exception_flags, 0))
|
||||
if (!FPU_exception(fetchdat, status.float_exception_flags, 0))
|
||||
FPU_save_regi(y, 0);
|
||||
|
||||
next_ins:
|
||||
|
||||
Reference in New Issue
Block a user