summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-03 09:20:01 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-03 09:20:01 +0000
commit485b17cc7d419336c0244ab2594a0c00c16eec87 (patch)
treed84d0c21f5a437c8483df7447549db9f296d3ddc
parent4a981bf09aa13f3165e715ebe2c2658ce14d8aff (diff)
downloadmpv-485b17cc7d419336c0244ab2594a0c00c16eec87.tar.bz2
mpv-485b17cc7d419336c0244ab2594a0c00c16eec87.tar.xz
Do not assume that "long" is the size of a register.
Fixes aclib compilation on mingw64 (with --enable-runtime-cpudetection). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30177 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libvo/aclib.c2
-rw-r--r--libvo/aclib_template.c16
2 files changed, 10 insertions, 8 deletions
diff --git a/libvo/aclib.c b/libvo/aclib.c
index 4fbd36d10e..377dff9fce 100644
--- a/libvo/aclib.c
+++ b/libvo/aclib.c
@@ -23,9 +23,11 @@
#include "config.h"
#include <stddef.h>
+#include <stdint.h>
#include <string.h>
#include "cpudetect.h"
#include "fastmemcpy.h"
+#include "libavutil/x86_cpu.h"
#undef memcpy
#define BLOCK_SIZE 4096
diff --git a/libvo/aclib_template.c b/libvo/aclib_template.c
index aa02c81a21..ba9ee484db 100644
--- a/libvo/aclib_template.c
+++ b/libvo/aclib_template.c
@@ -100,7 +100,7 @@ If you have questions please contact with me: Nick Kurshev: nickols_k@mail.ru.
/* for small memory blocks (<256 bytes) this version is faster */
#define small_memcpy(to,from,n)\
{\
-register unsigned long int dummy;\
+register x86_reg dummy;\
__asm__ volatile(\
"rep; movsb"\
:"=&D"(to), "=&S"(from), "=&c"(dummy)\
@@ -180,9 +180,9 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
#endif
if(len >= MIN_LEN)
{
- register unsigned long int delta;
+ register x86_reg delta;
/* Align destinition to MMREG_SIZE -boundary */
- delta = ((unsigned long int)to)&(MMREG_SIZE-1);
+ delta = ((intptr_t)to)&(MMREG_SIZE-1);
if(delta)
{
delta=MMREG_SIZE-delta;
@@ -201,7 +201,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
processor's decoders, but it's not always possible.
*/
#if HAVE_SSE /* Only P3 (may be Cyrix3) */
- if(((unsigned long)from) & 15)
+ if(((intptr_t)from) & 15)
/* if SRC is misaligned */
for(; i>0; i--)
{
@@ -243,7 +243,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
}
#else
// Align destination at BLOCK_SIZE boundary
- for(; ((int)to & (BLOCK_SIZE-1)) && i>0; i--)
+ for(; ((intptr_t)to & (BLOCK_SIZE-1)) && i>0; i--)
{
__asm__ volatile (
#ifndef HAVE_ONLY_MMX1
@@ -328,7 +328,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len)
"cmp %4, %2 \n\t"
" jae 1b \n\t"
: "+r" (from), "+r" (to), "+r" (i)
- : "r" ((long)BLOCK_SIZE), "i" (BLOCK_SIZE/64), "i" ((long)CONFUSION_FACTOR)
+ : "r" ((x86_reg)BLOCK_SIZE), "i" (BLOCK_SIZE/64), "i" ((x86_reg)CONFUSION_FACTOR)
: "%"REG_a, "%ecx"
);
@@ -400,9 +400,9 @@ static void * RENAME(mem2agpcpy)(void * to, const void * from, size_t len)
#endif
if(len >= MIN_LEN)
{
- register unsigned long int delta;
+ register x86_reg delta;
/* Align destinition to MMREG_SIZE -boundary */
- delta = ((unsigned long int)to)&7;
+ delta = ((intptr_t)to)&7;
if(delta)
{
delta=8-delta;