[xiph-cvs] cvs commit: vorbis/lib os.h

Jack Moffitt jack at xiph.org
Mon Nov 6 12:36:08 PST 2000



jack        00/11/06 12:36:07

  Modified:    lib      os.h
  Log:
  win32 asm ftoi
  
  jack.

Revision  Changes    Path
1.14      +16 -5     vorbis/lib/os.h

Index: os.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/os.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- os.h	2000/11/06 11:55:44	1.13
+++ os.h	2000/11/06 20:36:07	1.14
@@ -14,7 +14,7 @@
  ********************************************************************
 
  function: #ifdef jail to whip a few platforms into the UNIX ideal.
- last mod: $Id: os.h,v 1.13 2000/11/06 11:55:44 msmith Exp $
+ last mod: $Id: os.h,v 1.14 2000/11/06 20:36:07 jack Exp $
 
  ********************************************************************/
 
@@ -97,20 +97,31 @@
 
 #else
 
-static int vorbis_ftoi(double f){
-  return (int)(f+.5);
-}
 
-
 typedef int vorbis_fpu_control;
 
 #ifdef _WIN32
+
+static __inline int vorbis_ftoi(double f){
+	int i;
+	__asm{
+		fld f
+		fistp i
+	}
+	return i;
+}
+
 static __inline void vorbis_fpu_setround(vorbis_fpu_control *fpu){
 }
 
 static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){
 }
 #else 
+
+static int vorbis_ftoi(double f){
+  return (int)(f+.5);
+}
+
 /* We don't have special code for this compiler/arch, so do it the slow way */
 #define vorbis_fpu_setround(vorbis_fpu_control) {}
 #define vorbis_fpu_restore(vorbis_fpu_control) {}

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list