well, that's one way to confuse anybody

fixes the floating point exception
This commit is contained in:
Bill Currie 2002-06-03 07:23:41 +00:00
parent 53703ece81
commit b4e8e0750c
4 changed files with 19 additions and 4 deletions

View File

@ -205,12 +205,12 @@ C(D_PolysetCalcGradients):
// (t1*p01_minus_p21 - t0*p11_minus_p21)*
// xstepdenominv | ystepdenominv |
// xstepdenominv | p00_minus_p20 | p11_minus_p21
fldcw ceil_cw
fldcw r_ceil_cw
fistpl C(r_lstepy) // r_lstepx | ystepdenominv | xstepdenominv |
// p00_minus_p20 | p11_minus_p21
fistpl C(r_lstepx) // ystepdenominv | xstepdenominv | p00_minus_p20 |
// p11_minus_p21
fldcw single_cw
fldcw r_single_cw
// t0 = r_p0[2] - r_p2[2];
// t1 = r_p1[2] - r_p2[2];

View File

@ -153,7 +153,7 @@ Lemit:
//
// FIXME: do away with by manually extracting integers from floats?
// FIXME: set less often
fldcw ceil_cw
fldcw r_ceil_cw
// edge_t *edge, *pcheck;
// int u_check;
@ -220,7 +220,7 @@ LCalcSecond:
// r_ceilv1 = (int)(r_v1 - 2000) + 2000; // ceil(r_v1);
fistl C(r_ceilv1)
fldcw single_cw // put back normal floating-point state
fldcw r_single_cw // put back normal floating-point state
fsts C(r_v1)
fxch %st(4) // lzi0 | lzi1 | u1 | v0 | v1 | u0

View File

@ -137,6 +137,7 @@ float se_time1, se_time2, de_time1, de_time2, dv_time1, dv_time2;
void R_MarkLeaves (void);
void R_LoadSky_f (void);
void R_InitVars (void);
void
R_Init (void)
@ -146,6 +147,8 @@ R_Init (void)
// get stack position so we can guess if we are going to overflow
r_stack_start = (byte *) & dummy;
R_InitVars ();
R_InitTurb ();
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "Tests the current "

View File

@ -65,8 +65,20 @@ FloatZero: .long 0
Float2ToThe31nd: .long 0x4f000000
FloatMinus2ToThe31nd: .long 0xcf000000
.globl r_ceil_cw, r_single_cw
r_ceil_cw: .long 0
r_single_cw: .long 0
.globl C(r_bmodelactive)
C(r_bmodelactive): .long 0
.global C(R_InitVars)
C(R_InitVars):
movl ceil_cw, %eax
movl single_cw, %edx
movl %eax, r_ceil_cw
movl %edx, r_single_cw
ret
#endif // USE_INTEL_ASM