summaryrefslogtreecommitdiff
path: root/src/sys/sys_unix.c
diff options
context:
space:
mode:
authorThilo Schulz <arny@ats.s.bawue.de>2011-06-13 09:56:39 +0000
committerTim Angus <tim@ngus.net>2013-01-09 23:15:55 +0000
commit6a71409a0622050f9a682d4e3b02419c444febe5 (patch)
tree7766ff71304d04c6e42de7dd7d48ed7e7e0fac59 /src/sys/sys_unix.c
parentb15804d39f71e9be202818288726777d1ca8ac09 (diff)
- Add MASM assembler files for MSVC x64 projects to support vm_x86 in x64 mode - Clean up ftol()/snapvector() mess - Make use of SSE instructions for ftol()/snapvector() if available - move ftol/snapvector pure assembler to inline assembler, this will add x86_64 and improve support for different calling conventions - Set FPU control word at program startup to get consistent behaviour on all platforms
Diffstat (limited to 'src/sys/sys_unix.c')
-rw-r--r--src/sys/sys_unix.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/sys/sys_unix.c b/src/sys/sys_unix.c
index 4aad8b88..72ca8360 100644
--- a/src/sys/sys_unix.c
+++ b/src/sys/sys_unix.c
@@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <pwd.h>
#include <libgen.h>
#include <fcntl.h>
+#include <fenv.h>
qboolean stdinIsATTY;
@@ -118,31 +119,6 @@ int Sys_Milliseconds (void)
return curtime;
}
-#if !id386
-/*
-==================
-fastftol
-==================
-*/
-long fastftol( float f )
-{
- return (long)f;
-}
-
-/*
-==================
-Sys_SnapVector
-==================
-*/
-void Sys_SnapVector( float *v )
-{
- v[0] = rint(v[0]);
- v[1] = rint(v[1]);
- v[2] = rint(v[2]);
-}
-#endif
-
-
/*
==================
Sys_RandomBytes
@@ -749,6 +725,12 @@ void Sys_GLimpInit( void )
// NOP
}
+void Sys_SetFloatEnv(void)
+{
+ // rounding towards 0
+ fesetround(FE_TOWARDZERO);
+}
+
/*
==============
Sys_PlatformInit