the fpu manipulation stuff seems to be better off in the one place that

actually uses it...
This commit is contained in:
Bill Currie 2002-06-07 15:09:20 +00:00
parent 054ec3c072
commit ebfdbd9285
16 changed files with 86 additions and 75 deletions

View File

@ -70,10 +70,7 @@ int Sys_TimeID (void);
// called to yield for a little bit so as
// not to hog cpu when paused or debugging
void Sys_LowFPPrecision (void);
void Sys_HighFPPrecision (void);
void Sys_SetFPCW (void);
void MaskExceptions (void);
void Sys_MaskExceptions (void);
// send text to the console

View File

@ -337,4 +337,8 @@ void R_MarkLights (const vec3_t lightorigin, struct dlight_s *light, int bit,
void R_LoadSkys (const char *);
void R_LowFPPrecision (void);
void R_HighFPPrecision (void);
void R_SetFPCW (void);
#endif // _R_LOCAL_H

View File

@ -133,27 +133,7 @@ const char sys_char_map[256] = {
#ifndef USE_INTEL_ASM
void
Sys_HighFPPrecision (void)
{
}
void
Sys_LowFPPrecision (void)
{
}
void
Sys_SetFPCW (void)
{
}
void
Sys_PushFPCW_SetHigh (void)
{
}
void
Sys_PopFPCW (void)
Sys_MaskExceptions (void)
{
}
#endif

View File

@ -15,13 +15,13 @@ noinst_LTLIBRARIES=
endif
asm_src= \
d_draw.S d_parta.S d_polysa.S d_scana.S d_spr8.S d_varsa.S \
d_draw.S d_parta.S d_polysa.S d_scana.S d_spr8.S d_varsa.S fpua.S \
surf8.S sw_raclipa.S sw_raliasa.S sw_rdrawa.S sw_redgea.S \
sw_rvarsa.S transform.S
sw_src= \
d_edge.c d_fill.c d_init.c d_modech.c d_part.c d_polyse.c d_scan.c \
d_sky.c d_sprite.c d_surf.c d_vars.c d_zpoint.c draw.c nonintel.c \
d_sky.c d_sprite.c d_surf.c d_vars.c d_zpoint.c draw.c fpu.c nonintel.c \
screen.c sw_graph.c sw_raclip.c sw_ralias.c sw_rbsp.c sw_rdraw.c \
sw_redge.c sw_rmain.c sw_rmisc.c sw_rpart.c sw_rsky.c sw_rsprite.c \
sw_rsurf.c sw_skin.c

View File

@ -0,0 +1,62 @@
/*
#FILENAME#
#DESCRIPTION#
Copyright (C) 2001 #AUTHOR#
Author: #AUTHOR#
Date: #DATE#
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
*/
static const char rcsid[] =
"$Id$";
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifndef USE_INTEL_ASM
void
R_HighFPPrecision (void)
{
}
void
R_LowFPPrecision (void)
{
}
void
R_SetFPCW (void)
{
}
void
R_PushFPCW_SetHigh (void)
{
}
void
R_PopFPCW (void)
{
}
#endif

View File

@ -1,5 +1,5 @@
/*
sys_ia32.S
sw_fpua.S
Intel 32-bit assembly language dependent routines.
@ -118,40 +118,40 @@ pushed_cw: .long 0
.text
F_BEGIN(Sys_LowFPPrecision)
F_BEGIN(R_LowFPPrecision)
got_base(3)
fldcw got_var(single_cw)
ret
F_END(Sys_LowFPPrecision)
F_END(R_LowFPPrecision)
F_BEGIN(Sys_HighFPPrecision)
F_BEGIN(R_HighFPPrecision)
got_base(4)
fldcw got_var(full_cw)
ret
F_END(Sys_HighFPPrecision)
F_END(R_HighFPPrecision)
F_BEGIN(Sys_PushFPCW_SetHigh)
F_BEGIN(R_PushFPCW_SetHigh)
got_base(5)
fnstcw got_var(pushed_cw)
fldcw got_var(full_cw)
ret
F_END(Sys_PushFPCW_SetHigh)
F_END(R_PushFPCW_SetHigh)
F_BEGIN(Sys_PopFPCW)
F_BEGIN(R_PopFPCW)
got_base(6)
fldcw got_var(pushed_cw)
ret
F_END(Sys_PopFPCW)
F_END(R_PopFPCW)
F_BEGIN(Sys_SetFPCW)
F_BEGIN(R_SetFPCW)
got_base(7)
fnstcw got_var(cw)
movl got_var(cw),%eax
@ -168,5 +168,5 @@ F_BEGIN(Sys_SetFPCW)
movl %eax,got_var(ceil_cw)
ret
F_END(Sys_SetFPCW)
F_END(R_SetFPCW)
#endif /* USE_INTEL_ASM */

View File

@ -147,6 +147,7 @@ R_Init (void)
// get stack position so we can guess if we are going to overflow
r_stack_start = (byte *) & dummy;
R_SetFPCW ();
R_InitVars ();
R_InitTurb ();
@ -858,7 +859,7 @@ R_RenderView_ (void)
// while, so we don't do it globally. This also sets chop mode, and we do it
// here so that setup stuff like the refresh area calculations match what's
// done in screen.c
Sys_LowFPPrecision ();
R_LowFPPrecision ();
if (!r_worldentity.model)
Sys_Error ("R_RenderView: NULL worldmodel");
@ -928,7 +929,7 @@ R_RenderView_ (void)
Con_Printf ("Short roughly %d edges\n", r_outofedges * 2 / 3);
// back to high floating-point precision
Sys_HighFPPrecision ();
R_HighFPPrecision ();
}
void

View File

@ -77,7 +77,6 @@ int noconinput;
#ifdef _WIN32
# include "winquake.h"
void MaskExceptions (void);
#endif
void
@ -88,9 +87,8 @@ Sys_Init (void)
#endif
#ifdef USE_INTEL_ASM
#ifdef _WIN32
MaskExceptions ();
Sys_MaskExceptions ();
#endif
Sys_SetFPCW ();
#endif
#ifdef _WIN32

View File

@ -66,9 +66,6 @@ qboolean isDedicated = false;
void
Sys_Init (void)
{
#ifdef USE_INTEL_ASM
Sys_SetFPCW ();
#endif
}
static void

View File

@ -79,9 +79,6 @@ shutdown (void)
void
Sys_Init (void)
{
#ifdef USE_INTEL_ASM
Sys_SetFPCW ();
#endif
}
int

View File

@ -92,13 +92,6 @@ findhandle (void)
// SYSTEM IO ==================================================================
#ifndef USE_INTEL_ASM
void
MaskExceptions (void)
{
}
#endif
void
Sys_Init (void)
{
@ -106,8 +99,7 @@ Sys_Init (void)
unsigned int lowpart, highpart;
OSVERSIONINFO vinfo;
MaskExceptions ();
Sys_SetFPCW ();
Sys_MaskExceptions ();
if (!QueryPerformanceFrequency (&PerformanceFreq))
Sys_Error ("No hardware timer available");

View File

@ -86,9 +86,6 @@ Sys_Init (void)
#ifdef WIN32
OSVERSIONINFO vinfo;
#endif
#ifdef USE_INTEL_ASM
Sys_SetFPCW ();
#endif
#ifdef _WIN32
// make sure the timer is high precision, otherwise NT gets 18ms resolution

View File

@ -66,9 +66,6 @@ char *svs_info;
void
Sys_Init (void)
{
#ifdef USE_INTEL_ASM
Sys_SetFPCW ();
#endif
}
static void

View File

@ -96,11 +96,6 @@ Sys_Init (void)
1, /* Maximum count */
"qwcl"); /* Semaphore name */
#ifdef USE_INTEL_ASM
MaskExceptions ();
Sys_SetFPCW ();
#endif
// make sure the timer is high precision, otherwise NT gets 18ms resolution
timeBeginPeriod (1);

View File

@ -113,9 +113,6 @@ wrfpcr(unsigned long val)
void
Sys_Init (void)
{
#ifdef USE_INTEL_ASM
Sys_SetFPCW ();
#endif
#ifdef __alpha__
wrfpcr (rdfpcr () | 1L << 47);
#endif

View File

@ -52,9 +52,6 @@ Sys_Init (void)
{
OSVERSIONINFO vinfo;
#ifdef USE_INTEL_ASM
Sys_SetFPCW ();
#endif
// make sure the timer is high precision, otherwise NT gets 18ms resolution
timeBeginPeriod (1);