diff --git a/include/QF/sys.h b/include/QF/sys.h index 3b40ac24c..fae7e8bcc 100644 --- a/include/QF/sys.h +++ b/include/QF/sys.h @@ -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 diff --git a/include/r_local.h b/include/r_local.h index 58d5f265f..48a829011 100644 --- a/include/r_local.h +++ b/include/r_local.h @@ -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 diff --git a/libs/util/sys.c b/libs/util/sys.c index a193e5b26..bbb88ce6d 100644 --- a/libs/util/sys.c +++ b/libs/util/sys.c @@ -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 diff --git a/libs/video/renderer/sw/Makefile.am b/libs/video/renderer/sw/Makefile.am index 9c51c4e9e..78308c41d 100644 --- a/libs/video/renderer/sw/Makefile.am +++ b/libs/video/renderer/sw/Makefile.am @@ -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 diff --git a/libs/video/renderer/sw/fpu.c b/libs/video/renderer/sw/fpu.c new file mode 100644 index 000000000..b0280f676 --- /dev/null +++ b/libs/video/renderer/sw/fpu.c @@ -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 diff --git a/libs/util/sys_ia32.S b/libs/video/renderer/sw/fpua.S similarity index 91% rename from libs/util/sys_ia32.S rename to libs/video/renderer/sw/fpua.S index 471a2a26f..7fc021727 100644 --- a/libs/util/sys_ia32.S +++ b/libs/video/renderer/sw/fpua.S @@ -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 */ diff --git a/libs/video/renderer/sw/sw_rmain.c b/libs/video/renderer/sw/sw_rmain.c index 87e683b2a..16f3b4995 100644 --- a/libs/video/renderer/sw/sw_rmain.c +++ b/libs/video/renderer/sw/sw_rmain.c @@ -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 diff --git a/nq/source/sys_sdl.c b/nq/source/sys_sdl.c index 3bd9da10b..120a7bc4d 100644 --- a/nq/source/sys_sdl.c +++ b/nq/source/sys_sdl.c @@ -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 diff --git a/nq/source/sys_unix.c b/nq/source/sys_unix.c index 799f9e378..580f6ccb1 100644 --- a/nq/source/sys_unix.c +++ b/nq/source/sys_unix.c @@ -66,9 +66,6 @@ qboolean isDedicated = false; void Sys_Init (void) { -#ifdef USE_INTEL_ASM - Sys_SetFPCW (); -#endif } static void diff --git a/nq/source/sys_unixd.c b/nq/source/sys_unixd.c index 314796220..bb140a582 100644 --- a/nq/source/sys_unixd.c +++ b/nq/source/sys_unixd.c @@ -79,9 +79,6 @@ shutdown (void) void Sys_Init (void) { -#ifdef USE_INTEL_ASM - Sys_SetFPCW (); -#endif } int diff --git a/nq/source/sys_win.c b/nq/source/sys_win.c index d14843a69..80bdb13c7 100644 --- a/nq/source/sys_win.c +++ b/nq/source/sys_win.c @@ -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"); diff --git a/qw/source/cl_sys_sdl.c b/qw/source/cl_sys_sdl.c index fff141828..df95a67e8 100644 --- a/qw/source/cl_sys_sdl.c +++ b/qw/source/cl_sys_sdl.c @@ -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 diff --git a/qw/source/cl_sys_unix.c b/qw/source/cl_sys_unix.c index 76e9d4a8d..e8a79f3f4 100644 --- a/qw/source/cl_sys_unix.c +++ b/qw/source/cl_sys_unix.c @@ -66,9 +66,6 @@ char *svs_info; void Sys_Init (void) { -#ifdef USE_INTEL_ASM - Sys_SetFPCW (); -#endif } static void diff --git a/qw/source/cl_sys_win.c b/qw/source/cl_sys_win.c index b0796a99d..12a444245 100644 --- a/qw/source/cl_sys_win.c +++ b/qw/source/cl_sys_win.c @@ -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); diff --git a/qw/source/sv_sys_unix.c b/qw/source/sv_sys_unix.c index 2305eb3aa..90058a60e 100644 --- a/qw/source/sv_sys_unix.c +++ b/qw/source/sv_sys_unix.c @@ -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 diff --git a/qw/source/sv_sys_win.c b/qw/source/sv_sys_win.c index a4f6d4bd9..c5e9e3628 100644 --- a/qw/source/sv_sys_win.c +++ b/qw/source/sv_sys_win.c @@ -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);