]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/internal.h
Remove AltiVec vector declaration compiler compatibility macros.
[ffmpeg] / libavutil / internal.h
index 80d3d4114c440afd6382690d582260d78ddfef32..cc62d3b221ea22c9fba22b769421ac47a7e59c2f 100644 (file)
 #endif
 #endif
 
-/* Use Apple-specific AltiVec syntax for vector declarations when necessary. */
-#ifdef __APPLE_CC__
-#define AVV(x...) (x)
-#else
-#define AVV(x...) {x}
-#endif
-
 #ifndef M_PI
 #define M_PI    3.14159265358979323846
 #endif
 #endif
 
 // Use rip-relative addressing if compiling PIC code on x86-64.
-#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__DJGPP__) || \
-    defined(__OS2__) || defined(__APPLE__) || \
-    (defined (__OpenBSD__) && !defined(__ELF__))
-#    if defined(ARCH_X86_64) && defined(PIC)
-#        define MANGLE(a) "_" #a"(%%rip)"
-#    else
-#        define MANGLE(a) "_" #a
-#    endif
-#elif defined(ARCH_X86_64) && defined(PIC)
-#        define MANGLE(a) #a"(%%rip)"
+#if defined(ARCH_X86_64) && defined(PIC)
+#    define LOCAL_MANGLE(a) #a "(%%rip)"
 #else
-#        define MANGLE(a) #a
+#    define LOCAL_MANGLE(a) #a
 #endif
 
+#define MANGLE(a) EXTERN_PREFIX LOCAL_MANGLE(a)
+
 /* debug stuff */
 
 /* dprintf macros */
@@ -159,6 +146,13 @@ extern const uint32_t ff_inverse[256];
             );\
         ret;\
     })
+#elif defined(HAVE_ARMV6)
+static inline av_const int FASTDIV(int a, int b)
+{
+    int r;
+    asm volatile("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(ff_inverse[b]));
+    return r;
+}
 #elif defined(ARCH_ARMV4L)
 #    define FASTDIV(a,b) \
     ({\
@@ -180,7 +174,7 @@ extern const uint8_t ff_sqrt_tab[256];
 
 static inline int av_log2_16bit(unsigned int v);
 
-static inline unsigned int ff_sqrt(unsigned int a)
+static inline av_const unsigned int ff_sqrt(unsigned int a)
 {
     unsigned int b;
 
@@ -275,35 +269,35 @@ if((y)<(x)){\
 }
 
 #ifndef HAVE_LLRINT
-static av_always_inline long long llrint(double x)
+static av_always_inline av_const long long llrint(double x)
 {
     return rint(x);
 }
 #endif /* HAVE_LLRINT */
 
 #ifndef HAVE_LRINT
-static av_always_inline long int lrint(double x)
+static av_always_inline av_const long int lrint(double x)
 {
     return rint(x);
 }
 #endif /* HAVE_LRINT */
 
 #ifndef HAVE_LRINTF
-static av_always_inline long int lrintf(float x)
+static av_always_inline av_const long int lrintf(float x)
 {
     return (int)(rint(x));
 }
 #endif /* HAVE_LRINTF */
 
 #ifndef HAVE_ROUND
-static av_always_inline double round(double x)
+static av_always_inline av_const double round(double x)
 {
     return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5);
 }
 #endif /* HAVE_ROUND */
 
 #ifndef HAVE_ROUNDF
-static av_always_inline float roundf(float x)
+static av_always_inline av_const float roundf(float x)
 {
     return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5);
 }