Exclude INTERNAL FPU errors handling outside of standart FPU exceptions
handler CVS ----------------------------------------------------------------------
This commit is contained in:
parent
03b41ad14f
commit
b091e00899
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| div_Xsig.S |
|
||||
| $Id: div_Xsig.c,v 1.2 2001-10-06 03:53:46 bdenney Exp $
|
||||
| $Id: div_Xsig.c,v 1.3 2003-10-04 12:32:55 sshwarts Exp $
|
||||
| |
|
||||
| Division subroutine for 96 bit quantities |
|
||||
| |
|
||||
@ -40,7 +40,7 @@ void div_Xsig(const Xsig *aa, const Xsig *b, Xsig *dest)
|
||||
#ifdef PARANOID
|
||||
if ( (b->msw & 0x80000000) == 0 )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x240);
|
||||
INTERNAL(0x240);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -85,7 +85,7 @@ void div_Xsig(const Xsig *aa, const Xsig *b, Xsig *dest)
|
||||
#ifdef PARANOID
|
||||
if ( a.msw > 1 )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x241);
|
||||
INTERNAL(0x241);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -139,7 +139,7 @@ void div_Xsig(const Xsig *aa, const Xsig *b, Xsig *dest)
|
||||
#ifdef PARANOID
|
||||
if ( a.midw > 1 )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x242);
|
||||
INTERNAL(0x242);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -172,7 +172,7 @@ void div_Xsig(const Xsig *aa, const Xsig *b, Xsig *dest)
|
||||
#ifdef PARANOID
|
||||
if ( a.lsw > 2 )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x243);
|
||||
INTERNAL(0x243);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| errors.c |
|
||||
| $Id: errors.c,v 1.11 2003-08-28 19:25:23 sshwarts Exp $
|
||||
| $Id: errors.c,v 1.12 2003-10-04 12:32:55 sshwarts Exp $
|
||||
| |
|
||||
| The error handling functions for wm-FPU-emu |
|
||||
| |
|
||||
@ -156,7 +156,6 @@ static struct {
|
||||
{ EX_ZeroDiv, "divide by zero" },
|
||||
{ EX_Denormal, "denormalized operand" },
|
||||
{ EX_Invalid, "invalid operation" },
|
||||
{ EX_INTERNAL, "INTERNAL BUG in "FPU_VERSION },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
@ -209,68 +208,36 @@ static struct {
|
||||
0x171 in fpu_tags.c
|
||||
0x172 in fpu_tags.c
|
||||
0x180 in reg_convert.c
|
||||
0x2nn in an *.S file:
|
||||
0x201 in reg_u_add.S
|
||||
0x202 in reg_u_div.S
|
||||
0x203 in reg_u_div.S
|
||||
0x204 in reg_u_div.S
|
||||
0x205 in reg_u_mul.S
|
||||
0x206 in reg_u_sub.S
|
||||
0x207 in wm_sqrt.S
|
||||
0x208 in reg_div.S
|
||||
0x209 in reg_u_sub.S
|
||||
0x210 in reg_u_sub.S
|
||||
0x211 in reg_u_sub.S
|
||||
0x212 in reg_u_sub.S
|
||||
0x213 in wm_sqrt.S
|
||||
0x214 in wm_sqrt.S
|
||||
0x215 in wm_sqrt.S
|
||||
0x220 in reg_norm.S
|
||||
0x221 in reg_norm.S
|
||||
0x230 in reg_round.S
|
||||
0x231 in reg_round.S
|
||||
0x232 in reg_round.S
|
||||
0x233 in reg_round.S
|
||||
0x234 in reg_round.S
|
||||
0x235 in reg_round.S
|
||||
0x236 in reg_round.S
|
||||
0x240 in div_Xsig.S
|
||||
0x241 in div_Xsig.S
|
||||
0x242 in div_Xsig.S
|
||||
*/
|
||||
|
||||
void FPU_internal(int type)
|
||||
{
|
||||
printk("FPU emulator: Internal error type 0x%04x\n", type);
|
||||
}
|
||||
|
||||
void FPU_exception(int n)
|
||||
{
|
||||
int i, int_type;
|
||||
|
||||
int_type = 0; /* Needed only to stop compiler warnings */
|
||||
if ( n & EX_INTERNAL )
|
||||
{
|
||||
int_type = n - EX_INTERNAL;
|
||||
n = EX_INTERNAL;
|
||||
/* Set lots of exception bits! */
|
||||
FPU_partial_status |= (SW_Exc_Mask | SW_Summary | SW_Backward);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Extract only the bits which we use to set the status word */
|
||||
n &= (SW_Exc_Mask);
|
||||
/* Set the corresponding exception bit */
|
||||
FPU_partial_status |= n;
|
||||
/* Set summary bits iff exception isn't masked */
|
||||
if ( FPU_partial_status & ~FPU_control_word & CW_Exceptions )
|
||||
|
||||
/* Extract only the bits which we use to set the status word */
|
||||
n &= (SW_Exc_Mask);
|
||||
/* Set the corresponding exception bit */
|
||||
FPU_partial_status |= n;
|
||||
/* Set summary bits iff exception isn't masked */
|
||||
if (FPU_partial_status & ~FPU_control_word & CW_Exceptions)
|
||||
FPU_partial_status |= (SW_Summary | SW_Backward);
|
||||
if ( n & (SW_Stack_Fault | EX_Precision) )
|
||||
{
|
||||
if ( !(n & SW_C1) )
|
||||
/* This bit distinguishes over- from underflow for a stack fault,
|
||||
and roundup from round-down for precision loss. */
|
||||
FPU_partial_status &= ~SW_C1;
|
||||
}
|
||||
}
|
||||
if (n & (SW_Stack_Fault | EX_Precision))
|
||||
{
|
||||
if (!(n & SW_C1))
|
||||
/* This bit distinguishes over- from underflow for a stack fault,
|
||||
and roundup from round-down for precision loss. */
|
||||
FPU_partial_status &= ~SW_C1;
|
||||
}
|
||||
|
||||
RE_ENTRANT_CHECK_OFF;
|
||||
if ( (~FPU_control_word & n & CW_Exceptions) || (n == EX_INTERNAL) )
|
||||
if (~FPU_control_word & n & CW_Exceptions)
|
||||
{
|
||||
/* Get a name string for error reporting */
|
||||
for (i=0; exception_names[i].type; i++)
|
||||
@ -285,11 +252,6 @@ void FPU_exception(int n)
|
||||
}
|
||||
else
|
||||
printk("FPU emulator: Unknown Exception: 0x%04x!\n", n);
|
||||
|
||||
if ( n == EX_INTERNAL )
|
||||
{
|
||||
printk("FPU emulator: Internal error type 0x%04x\n", int_type);
|
||||
}
|
||||
|
||||
/*
|
||||
* The 80486 generates an interrupt on the next non-control FPU
|
||||
@ -411,7 +373,7 @@ int real_2op_NaN(FPU_REG const *b, u_char tagb,
|
||||
else
|
||||
{
|
||||
signalling = 0;
|
||||
EXCEPTION(EX_INTERNAL|0x113);
|
||||
INTERNAL(0x113);
|
||||
x = &CONST_QNaN;
|
||||
}
|
||||
#endif /* PARANOID */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| exception.h |
|
||||
| $Id: exception.h,v 1.4 2003-07-31 17:39:24 sshwarts Exp $
|
||||
| $Id: exception.h,v 1.5 2003-10-04 12:32:55 sshwarts Exp $
|
||||
| |
|
||||
| Copyright (C) 1992 W. Metzenthen, 22 Parker St, Ormond, Vic 3163, |
|
||||
| Australia. E-mail billm@vaxc.cc.monash.edu.au |
|
||||
@ -17,7 +17,6 @@
|
||||
#define FPU_BUSY (0x8000) /* FPU busy bit (8087 compatibility) */
|
||||
#define EX_ErrorSummary (0x0080) /* Error summary status */
|
||||
/* Special exceptions: */
|
||||
#define EX_INTERNAL (0x8000) /* Internal error in wm-FPU-emu */
|
||||
#define EX_StackOver (0x0041|SW_C1) /* stack overflow */
|
||||
#define EX_StackUnder (0x0041) /* stack underflow */
|
||||
/* Exception flags: */
|
||||
@ -32,5 +31,6 @@
|
||||
#define PRECISION_LOST_DOWN (EX_Precision)
|
||||
|
||||
#define EXCEPTION(x) FPU_exception(x)
|
||||
#define INTERNAL(x) FPU_internal(x)
|
||||
|
||||
#endif /* _EXCEPTION_H_ */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| fpu_emu.h |
|
||||
| $Id: fpu_emu.h,v 1.15 2003-10-03 17:39:04 sshwarts Exp $
|
||||
| $Id: fpu_emu.h,v 1.16 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Copyright (C) 1992,1993,1994,1997 |
|
||||
| W. Metzenthen, 22 Parker St, Ormond, Vic 3163, |
|
||||
@ -155,10 +155,6 @@ typedef struct { overrides override;
|
||||
#define PM16 (SIXTEEN | PROTECTED)
|
||||
#define SEG32 PROTECTED
|
||||
|
||||
#ifndef USE_WITH_CPU_SIM
|
||||
extern u_char const data_sizes_16[32];
|
||||
#endif
|
||||
|
||||
#define fpu_register(x) ( * ((FPU_REG *)(FPU_register_base + sizeof(FPU_REG) * (x & 7) )))
|
||||
#define st(x) ( * ((FPU_REG *)(FPU_register_base + sizeof(FPU_REG) * ((FPU_tos+x) & 7) )))
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| fpu_entry.c |
|
||||
| $Id: fpu_entry.c,v 1.16 2003-08-01 16:57:59 sshwarts Exp $
|
||||
| $Id: fpu_entry.c,v 1.17 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| The entry functions for wm-FPU-emu |
|
||||
| |
|
||||
@ -395,7 +395,7 @@ do_the_FPU_interrupt:
|
||||
FPU_illegal();
|
||||
goto FPU_instruction_done;
|
||||
default:
|
||||
EXCEPTION(EX_INTERNAL|0x111);
|
||||
INTERNAL(0x111);
|
||||
goto FPU_instruction_done;
|
||||
}
|
||||
(*st_instr_table[(int) instr_index])();
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| fpu_etc.c |
|
||||
| $Id: fpu_etc.c,v 1.4 2001-10-06 03:53:46 bdenney Exp $
|
||||
| $Id: fpu_etc.c,v 1.5 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Implement a few FPU instructions. |
|
||||
| |
|
||||
@ -85,7 +85,7 @@ static void ftst_(FPU_REG *st0_ptr, u_char st0tag)
|
||||
break;
|
||||
default:
|
||||
setcc(SW_C0|SW_C2|SW_C3); /* Operand is not comparable */
|
||||
EXCEPTION(EX_INTERNAL|0x14);
|
||||
INTERNAL(0x14);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: fpu_proto.h,v 1.10 2003-08-01 09:32:33 sshwarts Exp $
|
||||
// $Id: fpu_proto.h,v 1.11 2003-10-04 12:32:56 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -38,6 +38,7 @@
|
||||
extern void Un_impl(void);
|
||||
extern void FPU_illegal(void);
|
||||
asmlinkage void FPU_exception(int n);
|
||||
asmlinkage void FPU_internal(int n);
|
||||
extern int real_1op_NaN(FPU_REG *a);
|
||||
extern int real_2op_NaN(FPU_REG const *b, u_char tagb, int deststnr,
|
||||
FPU_REG const *defaultNaN);
|
||||
@ -166,5 +167,5 @@ extern int FPU_mul(FPU_REG const *b, u_char tagb, int deststnr, int control_w);
|
||||
extern int FPU_div(int flags, FPU_REG *regrm, int control_w); // bbd: changed arg2 from int to FPU_REG*
|
||||
/* reg_convert.c */
|
||||
extern int FPU_to_exp16(FPU_REG const *a, FPU_REG *x) BX_CPP_AttrRegparmN(2);
|
||||
#endif /* _FPU_PROTO_H */
|
||||
|
||||
#endif /* _FPU_PROTO_H */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| load_store.c |
|
||||
| $Id: load_store.c,v 1.11 2003-08-01 09:32:33 sshwarts Exp $
|
||||
| $Id: load_store.c,v 1.12 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| This file contains most of the code to interpret the FPU instructions |
|
||||
| which load and store from user memory. |
|
||||
@ -45,22 +45,6 @@ static u_char const type_table[32] = {
|
||||
_NONE_, _REG0_, _NONE_, _REG0_
|
||||
};
|
||||
|
||||
#ifndef USE_WITH_CPU_SIM
|
||||
u_char const data_sizes_16[32] = {
|
||||
4, 4, 8, 2, 0, 0, 0, 0,
|
||||
4, 4, 8, 2, 4, 4, 8, 2,
|
||||
14, 0, 94, 10, 2, 10, 0, 8,
|
||||
14, 0, 94, 10, 2, 10, 2, 8
|
||||
};
|
||||
|
||||
u_char const data_sizes_32[32] = {
|
||||
4, 4, 8, 2, 0, 0, 0, 0,
|
||||
4, 4, 8, 2, 4, 4, 8, 2,
|
||||
28, 0,108, 10, 2, 10, 0, 8,
|
||||
28, 0,108, 10, 2, 10, 2, 8
|
||||
};
|
||||
#endif
|
||||
|
||||
int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
|
||||
bx_address data_address)
|
||||
{
|
||||
@ -93,7 +77,7 @@ int FPU_load_store(u_char type, fpu_addr_modes addr_modes,
|
||||
return 0;
|
||||
#ifdef PARANOID
|
||||
default:
|
||||
EXCEPTION(EX_INTERNAL|0x141);
|
||||
INTERNAL(0x141);
|
||||
return 0;
|
||||
#endif /* PARANOID */
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| poly_2xm1.c |
|
||||
| $Id: poly_2xm1.c,v 1.4 2001-10-06 03:53:46 bdenney Exp $
|
||||
| $Id: poly_2xm1.c,v 1.5 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Function to compute 2^x-1 by a polynomial approximation. |
|
||||
| |
|
||||
@ -65,7 +65,7 @@ int poly_2xm1(u_char sign, FPU_REG *arg, FPU_REG *result)
|
||||
if ( exponent >= 0 ) /* Don't want a |number| >= 1.0 */
|
||||
{
|
||||
/* Number negative, too large, or not Valid. */
|
||||
EXCEPTION(EX_INTERNAL|0x127);
|
||||
INTERNAL(0x127);
|
||||
return 1;
|
||||
}
|
||||
#endif /* PARANOID */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| poly_atan.c |
|
||||
| $Id: poly_atan.c,v 1.4 2001-10-06 03:53:46 bdenney Exp $
|
||||
| $Id: poly_atan.c,v 1.5 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Compute the arctan of a FPU_REG, using a polynomial approximation. |
|
||||
| |
|
||||
@ -121,7 +121,7 @@ void poly_atan(FPU_REG *st0_ptr, u_char st0_tag,
|
||||
(argSignif.lsw == 0) && (argSignif.midw == 0) &&
|
||||
(argSignif.msw == 0x80000000) ) )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x104); /* There must be a logic error */
|
||||
INTERNAL(0x104); /* There must be a logic error */
|
||||
return;
|
||||
}
|
||||
#endif /* PARANOID */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| poly_sin.c |
|
||||
| $Id: poly_sin.c,v 1.4 2001-10-06 03:53:46 bdenney Exp $
|
||||
| $Id: poly_sin.c,v 1.5 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Computation of an approximation of the sin function and the cosine |
|
||||
| function by a polynomial. |
|
||||
@ -198,7 +198,7 @@ void poly_sine(FPU_REG *st0_ptr)
|
||||
if ( (exponent(&result) >= 0)
|
||||
&& (significand(&result) > BX_CONST64(0x8000000000000000)) )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x150);
|
||||
INTERNAL(0x150);
|
||||
}
|
||||
#endif /* PARANOID */
|
||||
|
||||
@ -391,7 +391,7 @@ void poly_cos(FPU_REG *st0_ptr)
|
||||
if ( (exponent(&result) >= 0)
|
||||
&& (significand(&result) > BX_CONST64(0x8000000000000000)) )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x151);
|
||||
INTERNAL(0x151);
|
||||
}
|
||||
#endif /* PARANOID */
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| reg_add_sub.c |
|
||||
| $Id: reg_add_sub.c,v 1.7 2003-05-24 15:04:55 vruppert Exp $
|
||||
| $Id: reg_add_sub.c,v 1.8 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Functions to add or subtract two registers and put the result in a third. |
|
||||
| |
|
||||
@ -232,7 +232,7 @@ int FPU_sub(int flags, FPU_REG *rm, u16 control_w)
|
||||
break;
|
||||
#ifdef PARANOID
|
||||
default:
|
||||
EXCEPTION(EX_INTERNAL|0x111);
|
||||
INTERNAL(0x111);
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
@ -373,7 +373,7 @@ int add_sub_specials_core(FPU_REG const *a, u_char taga, u_char signa,
|
||||
}
|
||||
|
||||
#ifdef PARANOID
|
||||
EXCEPTION(EX_INTERNAL|0x101);
|
||||
INTERNAL(0x101);
|
||||
#endif
|
||||
|
||||
return FPU_Exception;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| reg_compare.c |
|
||||
| $Id: reg_compare.c,v 1.5 2003-07-31 21:07:38 sshwarts Exp $
|
||||
| $Id: reg_compare.c,v 1.6 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Compare two floating point registers |
|
||||
| |
|
||||
@ -201,7 +201,7 @@ int FPU_compare_st_data(FPU_REG const *loaded_data, u_char loaded_tag)
|
||||
break;
|
||||
#ifdef PARANOID
|
||||
default:
|
||||
EXCEPTION(EX_INTERNAL|0x121);
|
||||
INTERNAL(0x121);
|
||||
f = SW_C3 | SW_C2 | SW_C0;
|
||||
break;
|
||||
#endif /* PARANOID */
|
||||
@ -253,7 +253,7 @@ static int compare_st_st(int nr)
|
||||
break;
|
||||
#ifdef PARANOID
|
||||
default:
|
||||
EXCEPTION(EX_INTERNAL|0x122);
|
||||
INTERNAL(0x122);
|
||||
f = SW_C3 | SW_C2 | SW_C0;
|
||||
break;
|
||||
#endif /* PARANOID */
|
||||
@ -310,7 +310,7 @@ static int compare_u_st_st(int nr)
|
||||
break;
|
||||
#ifdef PARANOID
|
||||
default:
|
||||
EXCEPTION(EX_INTERNAL|0x123);
|
||||
INTERNAL(0x123);
|
||||
f = SW_C3 | SW_C2 | SW_C0;
|
||||
break;
|
||||
#endif /* PARANOID */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| reg_convert.c |
|
||||
| $Id: reg_convert.c,v 1.4 2003-03-04 21:46:49 cbothamy Exp $
|
||||
| $Id: reg_convert.c,v 1.5 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Convert register representation. |
|
||||
| |
|
||||
@ -51,7 +51,7 @@ FPU_to_exp16(FPU_REG const *a, FPU_REG *x)
|
||||
|
||||
if ( !(x->sigh & 0x80000000) )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL | 0x180);
|
||||
INTERNAL(0x180);
|
||||
}
|
||||
|
||||
return sign;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| reg_divide.c |
|
||||
| $Id: reg_divide.c,v 1.4 2001-10-06 03:53:46 bdenney Exp $
|
||||
| $Id: reg_divide.c,v 1.5 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Divide one FPU_REG by another and put the result in a destination FPU_REG.|
|
||||
| |
|
||||
@ -201,7 +201,7 @@ int FPU_div(int flags, FPU_REG *rm, int control_w)
|
||||
#ifdef PARANOID
|
||||
else
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x102);
|
||||
INTERNAL(0x102);
|
||||
return FPU_Exception;
|
||||
}
|
||||
#endif /* PARANOID */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| reg_ld_str.c |
|
||||
| $Id: reg_ld_str.c,v 1.15 2003-10-03 17:39:04 sshwarts Exp $
|
||||
| $Id: reg_ld_str.c,v 1.16 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| All of the functions which transfer data between user memory and FPU_REGs.|
|
||||
| |
|
||||
@ -867,7 +867,7 @@ FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, bx_address single)
|
||||
#ifdef PARANOID
|
||||
else
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x164);
|
||||
INTERNAL(0x164);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -892,7 +892,7 @@ FPU_store_single(FPU_REG *st0_ptr, u_char st0_tag, bx_address single)
|
||||
#ifdef PARANOID
|
||||
else
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x163);
|
||||
INTERNAL(0x163);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| reg_mul.c |
|
||||
| $Id: reg_mul.c,v 1.3 2001-10-06 03:53:46 bdenney Exp $
|
||||
| $Id: reg_mul.c,v 1.4 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Multiply one FPU_REG by another, put the result in a destination FPU_REG. |
|
||||
| |
|
||||
@ -124,7 +124,7 @@ int FPU_mul(FPU_REG const *b, u_char tagb, int deststnr, int control_w)
|
||||
#ifdef PARANOID
|
||||
else
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x102);
|
||||
INTERNAL(0x102);
|
||||
return FPU_Exception;
|
||||
}
|
||||
#endif /* PARANOID */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| reg_round.c |
|
||||
| $Id: reg_round.c,v 1.5 2003-05-15 16:11:29 sshwarts Exp $
|
||||
| $Id: reg_round.c,v 1.6 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Rounding/truncation/etc for FPU basic arithmetic functions. |
|
||||
| |
|
||||
@ -234,7 +234,7 @@ int FPU_round(FPU_REG *x, u32 extent, int dummy, u16 control_w, u8 sign)
|
||||
/* With the precision control bits set to 01 "(reserved)", a real 80486
|
||||
behaves as if the precision control bits were set to 11 "64 bits" */
|
||||
#ifdef PARANOID
|
||||
EXCEPTION(EX_INTERNAL|0x236);
|
||||
INTERNAL(0x236);
|
||||
return -1;
|
||||
#endif
|
||||
#endif
|
||||
@ -295,7 +295,7 @@ int FPU_round(FPU_REG *x, u32 extent, int dummy, u16 control_w, u8 sign)
|
||||
break;
|
||||
|
||||
default:
|
||||
EXCEPTION(EX_INTERNAL|0x231);
|
||||
INTERNAL(0x231);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -366,7 +366,7 @@ int FPU_round(FPU_REG *x, u32 extent, int dummy, u16 control_w, u8 sign)
|
||||
break;
|
||||
|
||||
default:
|
||||
EXCEPTION(EX_INTERNAL|0x231);
|
||||
INTERNAL(0x231);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -439,7 +439,7 @@ int FPU_round(FPU_REG *x, u32 extent, int dummy, u16 control_w, u8 sign)
|
||||
break;
|
||||
|
||||
default:
|
||||
EXCEPTION(EX_INTERNAL|0x231);
|
||||
INTERNAL(0x231);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -449,7 +449,7 @@ int FPU_round(FPU_REG *x, u32 extent, int dummy, u16 control_w, u8 sign)
|
||||
|
||||
default:
|
||||
#ifdef PARANOID
|
||||
EXCEPTION(EX_INTERNAL|0x230);
|
||||
INTERNAL(0x230);
|
||||
return -1;
|
||||
#endif
|
||||
break;
|
||||
@ -473,7 +473,7 @@ int FPU_round(FPU_REG *x, u32 extent, int dummy, u16 control_w, u8 sign)
|
||||
{
|
||||
if (x->exp != EXP_UNDER+1)
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x234);
|
||||
INTERNAL(0x234);
|
||||
}
|
||||
if ((x->sigh == 0) && (x->sigl == 0))
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| reg_u_add.c |
|
||||
| $Id: reg_u_add.c,v 1.4 2003-04-20 19:20:08 sshwarts Exp $
|
||||
| $Id: reg_u_add.c,v 1.5 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Add two valid (TAG_Valid) FPU_REG numbers, of the same sign, and put the |
|
||||
| result in a destination FPU_REG. |
|
||||
@ -52,7 +52,7 @@ int FPU_u_add(const FPU_REG *arg1, const FPU_REG *arg2, FPU_REG *answ,
|
||||
#ifdef PARANOID
|
||||
if (!(arg1->sigh & 0x80000000) || !(arg2->sigh & 0x80000000))
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x201);
|
||||
INTERNAL(0x201);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| reg_u_div.c |
|
||||
| $Id: reg_u_div.c,v 1.4 2003-04-20 19:20:08 sshwarts Exp $
|
||||
| $Id: reg_u_div.c,v 1.5 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Divide one FPU_REG by another and put the result in a destination FPU_REG.|
|
||||
| |
|
||||
@ -46,7 +46,7 @@ int FPU_u_div(const FPU_REG *a, const FPU_REG *b, FPU_REG *dest,
|
||||
#ifdef PARANOID
|
||||
if (!(b->sigh & 0x80000000))
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x202);
|
||||
INTERNAL(0x202);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -122,7 +122,7 @@ int FPU_u_div(const FPU_REG *a, const FPU_REG *b, FPU_REG *dest,
|
||||
#ifdef PARANOID
|
||||
if (work32 != 1)
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x203);
|
||||
INTERNAL(0x203);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -137,7 +137,7 @@ int FPU_u_div(const FPU_REG *a, const FPU_REG *b, FPU_REG *dest,
|
||||
#ifdef PARANOID
|
||||
if ((accum64 >> 32))
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x203);
|
||||
INTERNAL(0x203);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -177,7 +177,7 @@ int FPU_u_div(const FPU_REG *a, const FPU_REG *b, FPU_REG *dest,
|
||||
#ifdef PARANOID
|
||||
if (work32 != 1)
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x203);
|
||||
INTERNAL(0x203);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -194,7 +194,7 @@ int FPU_u_div(const FPU_REG *a, const FPU_REG *b, FPU_REG *dest,
|
||||
#ifdef PARANOID
|
||||
if ((accum64 >> 32))
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x203);
|
||||
INTERNAL(0x203);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -214,7 +214,7 @@ int FPU_u_div(const FPU_REG *a, const FPU_REG *b, FPU_REG *dest,
|
||||
/* No overflow should be possible here */
|
||||
if (rat1 == 0)
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x203);
|
||||
INTERNAL(0x203);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| reg_u_mul.c |
|
||||
| $Id: reg_u_mul.c,v 1.5 2003-05-15 16:11:29 sshwarts Exp $
|
||||
| $Id: reg_u_mul.c,v 1.6 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Core multiplication routine |
|
||||
| |
|
||||
@ -33,7 +33,7 @@ int FPU_u_mul(const FPU_REG *a, const FPU_REG *b, FPU_REG *c, u16 cw,
|
||||
#ifdef PARANOID
|
||||
if (! (a->sigh & 0x80000000) || ! (b->sigh & 0x80000000))
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x205);
|
||||
INTERNAL(0x205);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| reg_u_sub.c |
|
||||
| $Id: reg_u_sub.c,v 1.5 2003-05-15 16:11:29 sshwarts Exp $
|
||||
| $Id: reg_u_sub.c,v 1.6 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Core floating point subtraction routine. |
|
||||
| |
|
||||
@ -39,7 +39,7 @@ int FPU_u_sub(const FPU_REG *arg1, const FPU_REG *arg2, FPU_REG *dest,
|
||||
#ifdef PARANOID
|
||||
if (ediff < 0)
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x206);
|
||||
INTERNAL(0x206);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
@ -49,7 +49,7 @@ int FPU_u_sub(const FPU_REG *arg1, const FPU_REG *arg2, FPU_REG *dest,
|
||||
#ifdef PARANOID
|
||||
if (!(arg1->sigh & 0x80000000) || !(arg2->sigh & 0x80000000))
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x209);
|
||||
INTERNAL(0x209);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
@ -147,7 +147,7 @@ int FPU_u_sub(const FPU_REG *arg1, const FPU_REG *arg2, FPU_REG *dest,
|
||||
if (borrow)
|
||||
{
|
||||
/* This can only occur if the code is bugged */
|
||||
EXCEPTION(EX_INTERNAL|0x212);
|
||||
INTERNAL(0x212);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
@ -184,7 +184,7 @@ int FPU_u_sub(const FPU_REG *arg1, const FPU_REG *arg2, FPU_REG *dest,
|
||||
if (extent != 0x80000000)
|
||||
{
|
||||
/* This can only occur if the code is bugged */
|
||||
EXCEPTION(EX_INTERNAL|0x210);
|
||||
INTERNAL(0x210);
|
||||
return -1;
|
||||
}
|
||||
dest->sigh = extent;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*---------------------------------------------------------------------------+
|
||||
| wm_sqrt.c |
|
||||
| $Id: wm_sqrt.c,v 1.3 2001-10-06 03:53:46 bdenney Exp $
|
||||
| $Id: wm_sqrt.c,v 1.4 2003-10-04 12:32:56 sshwarts Exp $
|
||||
| |
|
||||
| Fixed point arithmetic square root evaluation. |
|
||||
| |
|
||||
@ -100,7 +100,7 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
|
||||
#ifdef PARANOID
|
||||
if ( (n->sigh != 0xffffffff) && (n->sigl != 0xffffffff) )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x213);
|
||||
INTERNAL(0x213);
|
||||
}
|
||||
#endif
|
||||
/* We know the answer here. */
|
||||
@ -155,7 +155,7 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
|
||||
#ifdef PARANOID
|
||||
if ( (diff >> 32) != 0 )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x207);
|
||||
INTERNAL(0x207);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -255,7 +255,7 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
|
||||
#ifdef PARANOID
|
||||
if ( ((s32)work32 > 3*ERR_MARGIN) || ((s32)work32 < -3*ERR_MARGIN) )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x214);
|
||||
INTERNAL(0x214);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -315,7 +315,7 @@ int wm_sqrt(FPU_REG *n, s32 dummy1, s32 dummy2, u16 control_w, u8 sign)
|
||||
#ifdef PARANOID
|
||||
if ( ((s32)work32 > 4*3*ERR_MARGIN) || ((s32)work32 < -4*3*ERR_MARGIN) )
|
||||
{
|
||||
EXCEPTION(EX_INTERNAL|0x215);
|
||||
INTERNAL(0x215);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user