#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-//#undef HAVE_MMX2
-//#define HAVE_AMD3DNOW
-//#undef HAVE_MMX
+//#undef HAVE_MMXEXT_INLINE
+//#define HAVE_AMD3DNOW_INLINE
+//#undef HAVE_MMX_INLINE
//#undef ARCH_X86
//#define DEBUG_BRIGHTNESS
#include "postprocess.h"
#define TEMP_STRIDE 8
//#define NUM_BLOCKS_AT_ONCE 16 //not used yet
-#if ARCH_X86
+#if ARCH_X86 && HAVE_INLINE_ASM
DECLARE_ASM_CONST(8, uint64_t, w05)= 0x0005000500050005LL;
DECLARE_ASM_CONST(8, uint64_t, w04)= 0x0004000400040004LL;
DECLARE_ASM_CONST(8, uint64_t, w20)= 0x0020002000200020LL;
};
-#if ARCH_X86
+#if ARCH_X86 && HAVE_INLINE_ASM
static inline void prefetchnta(void *p)
{
__asm__ volatile( "prefetchnta (%0)\n\t"
#define COMPILE_ALTIVEC
#endif //HAVE_ALTIVEC
-#if ARCH_X86
+#if ARCH_X86 && HAVE_INLINE_ASM
-#if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT
+#if (HAVE_MMX_INLINE && !HAVE_AMD3DNOW_INLINE && !HAVE_MMXEXT_INLINE) || CONFIG_RUNTIME_CPUDETECT
#define COMPILE_MMX
#endif
-#if HAVE_MMX2 || CONFIG_RUNTIME_CPUDETECT
+#if HAVE_MMXEXT_INLINE || CONFIG_RUNTIME_CPUDETECT
#define COMPILE_MMX2
#endif
-#if (HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT
+#if (HAVE_AMD3DNOW_INLINE && !HAVE_MMXEXT_INLINE) || CONFIG_RUNTIME_CPUDETECT
#define COMPILE_3DNOW
#endif
#endif /* ARCH_X86 */
-#undef HAVE_MMX
-#define HAVE_MMX 0
-#undef HAVE_MMX2
-#define HAVE_MMX2 0
-#undef HAVE_AMD3DNOW
-#define HAVE_AMD3DNOW 0
+#undef HAVE_MMX_INLINE
+#define HAVE_MMX_INLINE 0
+#undef HAVE_MMXEXT_INLINE
+#define HAVE_MMXEXT_INLINE 0
+#undef HAVE_AMD3DNOW_INLINE
+#define HAVE_AMD3DNOW_INLINE 0
#undef HAVE_ALTIVEC
#define HAVE_ALTIVEC 0
//MMX versions
#ifdef COMPILE_MMX
#undef RENAME
-#undef HAVE_MMX
-#define HAVE_MMX 1
+#undef HAVE_MMX_INLINE
+#define HAVE_MMX_INLINE 1
#define RENAME(a) a ## _MMX
#include "postprocess_template.c"
#endif
//MMX2 versions
#ifdef COMPILE_MMX2
#undef RENAME
-#undef HAVE_MMX
-#undef HAVE_MMX2
-#define HAVE_MMX 1
-#define HAVE_MMX2 1
+#undef HAVE_MMX_INLINE
+#undef HAVE_MMXEXT_INLINE
+#define HAVE_MMX_INLINE 1
+#define HAVE_MMXEXT_INLINE 1
#define RENAME(a) a ## _MMX2
#include "postprocess_template.c"
#endif
//3DNOW versions
#ifdef COMPILE_3DNOW
#undef RENAME
-#undef HAVE_MMX
-#undef HAVE_MMX2
-#undef HAVE_AMD3DNOW
-#define HAVE_MMX 1
-#define HAVE_MMX2 0
-#define HAVE_AMD3DNOW 1
+#undef HAVE_MMX_INLINE
+#undef HAVE_MMXEXT_INLINE
+#undef HAVE_AMD3DNOW_INLINE
+#define HAVE_MMX_INLINE 1
+#define HAVE_MMXEXT_INLINE 0
+#define HAVE_AMD3DNOW_INLINE 1
#define RENAME(a) a ## _3DNow
#include "postprocess_template.c"
#endif
// difference would not be measurable here but it is much better because
// someone might exchange the CPU whithout restarting MPlayer ;)
#if CONFIG_RUNTIME_CPUDETECT
-#if ARCH_X86
+#if ARCH_X86 && HAVE_INLINE_ASM
// ordered per speed fastest first
if(c->cpuCaps & PP_CPU_CAPS_MMX2)
postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
#endif
#else /* CONFIG_RUNTIME_CPUDETECT */
-#if HAVE_MMX2
+#if HAVE_MMXEXT_INLINE
postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
-#elif HAVE_AMD3DNOW
+#elif HAVE_AMD3DNOW_INLINE
postProcess_3DNow(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
-#elif HAVE_MMX
+#elif HAVE_MMX_INLINE
postProcess_MMX(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
#elif HAVE_ALTIVEC
postProcess_altivec(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);