summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraustriancoder <austriancoder>2004-08-23 15:38:52 +0000
committeraustriancoder <austriancoder>2004-08-23 15:38:52 +0000
commit791ae1aa43007dd0cd17baeb5f7a068689707798 (patch)
treeb01b9a7e780d88cc0642da4e5b2c822b7f113a1e
parent389e36a93db0bd137ba76d424064de1f9a7ea219 (diff)
downloadvdr-plugin-dxr3-791ae1aa43007dd0cd17baeb5f7a068689707798.tar.gz
vdr-plugin-dxr3-791ae1aa43007dd0cd17baeb5f7a068689707798.tar.bz2
should now compile also with gcc 2.95
-rw-r--r--HISTORY3
-rw-r--r--dxr3memcpy.c16
-rw-r--r--dxr3memcpy.h5
3 files changed, 20 insertions, 4 deletions
diff --git a/HISTORY b/HISTORY
index 684676e..ce6cca7 100644
--- a/HISTORY
+++ b/HISTORY
@@ -235,4 +235,5 @@ NOTE: I havent found time to include all of the languages, will be done in pre2
- fixed output of anamorphic video, if tv aspect is configured to 16:9 in DVB setup menu
thanks Seppo Ingalsuo <seppo.ingalsuo@iki.fi>
- rewrote i18n support
-- fixed void cDxr3Interface::SetAudioDigitalPCM() - thanks to Stephan Skrodzki <skrodzki@contcast.de> for patch \ No newline at end of file
+- fixed void cDxr3Interface::SetAudioDigitalPCM() - thanks to Stephan Skrodzki <skrodzki@contcast.de> for patch
+- dxr3memcpy.c/h: fix to support older compilers like gcc-2.95 \ No newline at end of file
diff --git a/dxr3memcpy.c b/dxr3memcpy.c
index a8814b6..3a545f3 100644
--- a/dxr3memcpy.c
+++ b/dxr3memcpy.c
@@ -93,6 +93,10 @@ int d0, d1, d2;
#define MMX1_MIN_LEN 0x800 /* 2K blocks */
#define MIN_LEN 0x40 /* 64-byte blocks */
+
+// Test for GCC > 3.2.0
+#if GCC_VERSION > 30200
+
// ==================================
/* SSE note: i tried to move 128 bytes a time instead of 64 but it
didn't make any measureable difference. i'm using 64 for the sake of
@@ -256,7 +260,7 @@ static void * mmx2_memcpy(void * to, const void * from, size_t len)
" prefetchnta 224(%0)\n"
" prefetchnta 256(%0)\n"
" prefetchnta 288(%0)\n"
- : : "r" (from) );
+ :: "r" (from) );
if(len >= MIN_LEN)
{
@@ -308,6 +312,8 @@ static void * mmx2_memcpy(void * to, const void * from, size_t len)
return retval;
}
+#endif /*GCC_VERSION > 30200*/
+
// ==================================
static void *linux_kernel_memcpy(void *to, const void *from, size_t len) {
return __memcpy(to,from,len);
@@ -344,6 +350,9 @@ cDxr3MemcpyBench::cDxr3MemcpyBench(uint32_t config_flags)
routine.cpu_require = 0;
m_methods.push_back(routine);
+ // Test for GCC > 3.2.0
+ #if GCC_VERSION > 30200
+
// MMX optimized memcpy()
routine.name = "MMX optimized memcpy()";
routine.function = mmx_memcpy;
@@ -356,7 +365,7 @@ cDxr3MemcpyBench::cDxr3MemcpyBench(uint32_t config_flags)
routine.cpu_require = CC_MMXEXT;
m_methods.push_back(routine);
- #ifndef __FreeBSD__
+ # ifndef __FreeBSD__
// SSE optimized memcpy()
routine.name = "SSE optimized memcpy()";
@@ -364,7 +373,8 @@ cDxr3MemcpyBench::cDxr3MemcpyBench(uint32_t config_flags)
routine.cpu_require = CC_MMXEXT|CC_SSE;
m_methods.push_back(routine);
- #endif /*__FreeBSD__*/
+ # endif /*__FreeBSD__*/
+ #endif /*GCC_VERSION > 30200*/
// #endif /*ARCH_X86*/
diff --git a/dxr3memcpy.h b/dxr3memcpy.h
index 71bb673..e360b32 100644
--- a/dxr3memcpy.h
+++ b/dxr3memcpy.h
@@ -57,6 +57,11 @@
// size of buffer for benchmark
#define BUFSIZE 1024*1024
+// get gcc version
+#define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+
enum {
MEMCPY_PROBE = 0,
MEMCPY_GLIBC,