From 14d1a63dc30aa4590c30b24b824b4cc76e869183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 9 Jun 2007 12:22:54 +0200 Subject: Define sigill_return and sigill_handler only on x86, as there is where they only are used. --- src/xine-utils/cpu_accel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/xine-utils/cpu_accel.c') diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c index b32733fba..ddada94d3 100644 --- a/src/xine-utils/cpu_accel.c +++ b/src/xine-utils/cpu_accel.c @@ -24,8 +24,6 @@ #include #include #include -#include -#include #include #if defined (__SVR4) && defined (__sun) @@ -42,11 +40,16 @@ #if defined(ARCH_X86) || defined(ARCH_X86_64) +#ifndef __x86_64__ +#include +#include + static jmp_buf sigill_return; static void sigill_handler (int n) { longjmp(sigill_return, 1); } +#endif static uint32_t arch_accel (void) { -- cgit v1.2.3 From 1164322fc326fd8023c9a01823092eac105ccba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 9 Jun 2007 12:30:11 +0200 Subject: Include dlfcn.h only when dlopen() is needed. --- src/xine-utils/cpu_accel.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/xine-utils/cpu_accel.c') diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c index ddada94d3..9285148b8 100644 --- a/src/xine-utils/cpu_accel.c +++ b/src/xine-utils/cpu_accel.c @@ -24,7 +24,10 @@ #include #include #include + +#if defined(HAVE_MLIB) && defined(MLIB_LAZYLOAD) #include +#endif #if defined (__SVR4) && defined (__sun) #include -- cgit v1.2.3 From 2c5cfbc4e033c3959f5e3c9707b71044adadbd55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 9 Jun 2007 12:50:55 +0200 Subject: If 3dNOW is enabled at build-time, mark it as present on x86-64; it's not always there because Intel EM64T machines does not have it. --- src/xine-utils/cpu_accel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/xine-utils/cpu_accel.c') diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c index 9285148b8..147a32ac5 100644 --- a/src/xine-utils/cpu_accel.c +++ b/src/xine-utils/cpu_accel.c @@ -61,7 +61,11 @@ static uint32_t arch_accel (void) #ifdef __x86_64__ /* 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 -- cgit v1.2.3 From 13cb1497c43a5bffc29ca27933c37c5e3e898d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 9 Jun 2007 12:56:14 +0200 Subject: If SSE, SSE2 and MMX are enabled at build-time, enable them and skip over the cpuid tests; a runtime CPU detection option could be supplied by configure, for instance. --- src/xine-utils/cpu_accel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/xine-utils/cpu_accel.c') diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c index 147a32ac5..e350898eb 100644 --- a/src/xine-utils/cpu_accel.c +++ b/src/xine-utils/cpu_accel.c @@ -58,7 +58,8 @@ 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 @@ -158,6 +159,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); -- cgit v1.2.3 From 71895542f37568218e6c479c9036218e856c8fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 9 Jun 2007 13:04:05 +0200 Subject: Use __i386__ and __x86_64__ instead of ARCH_X86 and ARCH_X86_64; the ARCH_* defines comes from FFmpeg, but they can easily stay there. --- src/xine-utils/cpu_accel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/xine-utils/cpu_accel.c') diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c index e350898eb..87d7aee77 100644 --- a/src/xine-utils/cpu_accel.c +++ b/src/xine-utils/cpu_accel.c @@ -41,7 +41,7 @@ #include "xineutils.h" -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#if defined(__i386__) || defined(__x86_64__) #ifndef __x86_64__ #include @@ -183,7 +183,7 @@ static uint32_t arch_accel (void) return caps; } -#endif /* ARCH_X86 */ +#endif /* i386 or x86_64 */ #if defined(ARCH_PPC) && defined(ENABLE_ALTIVEC) static sigjmp_buf jmpbuf; @@ -340,7 +340,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 -- cgit v1.2.3 From d5d3776bf7e2733d382c5811b317bcdb7c2c9e88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 9 Jun 2007 13:04:43 +0200 Subject: signal.h and setjmp.h are needed on PPC and SPARC too. --- src/xine-utils/cpu_accel.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/xine-utils/cpu_accel.c') diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c index 87d7aee77..06ee90cd3 100644 --- a/src/xine-utils/cpu_accel.c +++ b/src/xine-utils/cpu_accel.c @@ -186,6 +186,9 @@ static uint32_t arch_accel (void) #endif /* i386 or x86_64 */ #if defined(ARCH_PPC) && defined(ENABLE_ALTIVEC) +#include +#include + static sigjmp_buf jmpbuf; static volatile sig_atomic_t canjump = 0; @@ -270,6 +273,9 @@ static uint32_t arch_accel (void) return flags; } #else +#include +#include + static sigjmp_buf jmpbuf; static volatile sig_atomic_t canjump = 0; -- cgit v1.2.3