mat3.h: Some inline assembly from Norman.
#ifdef WIN32
# ifndef HAVE_STL_SGI_PORT
-# include <memory.h> /* required for memset() and memcpy() */
+# ifdef __BORLANDC__
+# include <mem.h>
+# else
+# include <memory.h> /* required for memset() and memcpy() */
+# endif
# endif
#endif
extern MAT3mat identityMatrix;
+#if defined(i386)
+#define USE_X86_ASM
+#endif
+
+#if defined(USE_X86_ASM)
+static __inline__ int FloatToInt(float f)
+{
+ int r;
+ __asm__ ("fistpl %0" : "=m" (r) : "t" (f) : "st");
+ return r;
+}
+#elif defined(__MSC__) && defined(__WIN32__)
+static __inline int FloatToInt(float f)
+{
+ int r;
+ _asm {
+ fld f
+ fistp r
+ }
+ return r;
+}
+#else
+#define FloatToInt(F) ((int) (F))
+#endif
+
+
/* Tests if a number is within EPSILON of zero */
#define MAT3_IS_ZERO(N) ((N) < MAT3_EPSILON && (N) > -MAT3_EPSILON)