Game Development Community

MMath_ASM.asm questions

by Mike Parker · in Torque Game Engine · 08/25/2004 (10:37 am) · 1 replies

In the mMath_C.cc and mMath_ASM.asm:

// mMath_C.cc
static S32 m_mulDivS32_C(S32 a, S32 b, S32 c)
{
   // S64/U64 support in most 32-bit compilers generate 
   // horrible code, the C version are here just for porting
   // assembly implementation is recommended
   return (S32) ((S64)a*(S64)b) / (S64)c;
}  

// mMath_ASM.asm
;
; static S32 m_mulDivS32_ASM( S32 a, S32 b, S32 c )
;
;    // Note: this returns different (but correct) values than the C
;    //  version.  C code must be overflowing...returns -727
;    //  if a b and c are 1 million, for instance.  This version returns
;    //  1 million.


// the U32 version also says there are overflows

Looking at the target.torque.mk file I do not see mMath_ASM.asm in the SOURCE.MATH list. Since it isn't being compiled in, can we assume that these comments are outdated and there is no overflow? Or should mMath_ASM.asm be getting compiled?

About the author

Recent Threads

  • TGE Overhaul

  • #1
    08/25/2004 (11:04 am)
    Looked into this a little bit. Turns out these are so outdated, they are not even used anymore. Since I'm working in this area of the code I'll make sure to remove them.