summaryrefslogtreecommitdiff
path: root/src/xine-utils/cpu_accel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-utils/cpu_accel.c')
-rw-r--r--src/xine-utils/cpu_accel.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c
index 1e12986fb..adcc4edc0 100644
--- a/src/xine-utils/cpu_accel.c
+++ b/src/xine-utils/cpu_accel.c
@@ -24,9 +24,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
-#include <signal.h>
-#include <setjmp.h>
+
+#if defined(HAVE_MLIB) && defined(MLIB_LAZYLOAD)
#include <dlfcn.h>
+#endif
#if defined (__SVR4) && defined (__sun)
#include <sys/systeminfo.h>
@@ -38,28 +39,38 @@
#define LOG
*/
-#include "xineutils.h"
+#include <xine/xineutils.h>
#if defined(PIC) && ! defined(__PIC__)
#define __PIC__
#endif
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+#if defined(__i386__) || defined(__x86_64__)
+
+#ifndef __x86_64__
+#include <signal.h>
+#include <setjmp.h>
static jmp_buf sigill_return;
static void sigill_handler (int n) {
longjmp(sigill_return, 1);
}
+#endif
static uint32_t arch_accel (void)
{
uint32_t caps;
-#ifdef __x86_64__
+#if defined(__x86_64__) || \
+ ( defined(__SSE__) && defined(__SSE2__) && defined(__MMX__) )
/* No need to test for this on AMD64, we know what the
platform has. */
- caps = MM_ACCEL_X86_MMX | MM_ACCEL_X86_SSE | MM_ACCEL_X86_MMXEXT | MM_ACCEL_X86_SSE2;
+ caps = MM_ACCEL_X86_MMX | MM_ACCEL_X86_SSE | MM_ACCEL_X86_MMXEXT | MM_ACCEL_X86_SSE2
+# if defined(__3dNOW__)
+ | MM_ACCEL_X86_3DNOW
+# endif
+ ;
#else
#ifndef _MSC_VER
@@ -152,6 +163,9 @@ static uint32_t arch_accel (void)
caps = 0;
#endif /* _MSC_VER */
+#endif /* x86_64 or built-in options */
+
+#ifndef __x86_64__
/* test OS support for SSE */
if (caps & MM_ACCEL_X86_SSE) {
void (*old_sigill_handler)(int);
@@ -173,9 +187,12 @@ static uint32_t arch_accel (void)
return caps;
}
-#endif /* ARCH_X86 */
+#endif /* i386 or x86_64 */
#if defined(ARCH_PPC) && defined(ENABLE_ALTIVEC)
+#include <signal.h>
+#include <setjmp.h>
+
static sigjmp_buf jmpbuf;
static volatile sig_atomic_t canjump = 0;
@@ -260,6 +277,9 @@ static uint32_t arch_accel (void)
return flags;
}
#else
+#include <signal.h>
+#include <setjmp.h>
+
static sigjmp_buf jmpbuf;
static volatile sig_atomic_t canjump = 0;
@@ -330,7 +350,7 @@ uint32_t xine_mm_accel (void)
#endif
#endif
-#if defined(ARCH_X86) || defined(ARCH_X86_64) || (defined(ARCH_PPC) && defined(ENABLE_ALTIVEC)) || (defined(ARCH_SPARC) && defined(ENABLE_VIS))
+#if defined(__i386__) || defined(__x86_64__) || (defined(ARCH_PPC) && defined(ENABLE_ALTIVEC)) || (defined(ARCH_SPARC) && defined(ENABLE_VIS))
accel |= arch_accel();
#endif