Remove unused function MathUtils::ceil_int. The x86 assembly was incorrect (assumes...
authorChris Lance <chris_lance@sbcglobal.net>
Sun, 3 Jul 2011 16:34:31 +0000 (12:34 -0400)
committerChris Lance <chris_lance@sbcglobal.net>
Sun, 3 Jul 2011 16:34:31 +0000 (12:34 -0400)
xbmc/utils/MathUtils.h

index 4d6faec..8cc0aa5 100644 (file)
@@ -69,41 +69,6 @@ namespace MathUtils
     return (i);
   }
   
-  inline int ceil_int (double x)
-  {
-    assert(x > static_cast<double>(INT_MIN / 2) - 1.0);
-    assert(x < static_cast <double>(INT_MAX / 2) + 1.0);
-    
-#if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__)
-    const float round_towards_p_i = -0.5f;
-#endif
-    int i;
-    
-#ifndef _LINUX
-    __asm
-    {
-      fld x
-      fadd st, st (0)
-      fsubr round_towards_p_i
-      fistp i
-      sar i, 1
-    }
-#else
-#if defined(__powerpc__) || defined(__ppc__) || defined(__arm__)
-    return (int)ceil(x);
-#else
-    __asm__ __volatile__ (
-                          "fadd %%st\n\t"
-                          "fsubr %%st(1)\n\t"
-                          "fistpl %0\n\t"
-                          "sarl $1, %0\n"
-                          : "=m"(i) : "u"(round_towards_p_i), "t"(x) : "st"
-                          );
-#endif
-#endif
-    return (-i);
-  }
-  
   inline int truncate_int(double x)
   {
     assert(x > static_cast<double>(INT_MIN / 2) - 1.0);
@@ -154,7 +119,6 @@ namespace MathUtils
     // functions as unused
     MathUtils::round_int(0.0);
     MathUtils::truncate_int(0.0);
-    MathUtils::ceil_int(0.0);
     MathUtils::abs(0);
   }
 } // namespace MathUtils