Commit 40d0e665 authored by Ramiro Polla's avatar Ramiro Polla

Do not misuse long as the size of a register in x86.

typedef x86_reg as the appropriate size and use it instead.

Originally committed as revision 13081 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 35027edd
......@@ -25,6 +25,7 @@
#include "dsputil.h"
#include "dsputil_mmx.h"
#include "common.h"
#include "x86_cpu.h"
/*****************************************************************************
*
......@@ -301,7 +302,7 @@ static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
VOP(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
\
: "+a"(src), "+c"(dst)\
: "S"((long)srcStride), "D"((long)dstStride), "m"(ADD), "m"(MUL1), "m"(MUL2)\
: "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "m"(ADD), "m"(MUL1), "m"(MUL2)\
: "memory"\
);\
if(h==16){\
......@@ -316,7 +317,7 @@ static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
VOP(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
\
: "+a"(src), "+c"(dst)\
: "S"((long)srcStride), "D"((long)dstStride), "m"(ADD), "m"(MUL1), "m"(MUL2)\
: "S"((x86_reg)srcStride), "D"((x86_reg)dstStride), "m"(ADD), "m"(MUL1), "m"(MUL2)\
: "memory"\
);\
}\
......@@ -367,7 +368,7 @@ static void OPNAME ## cavs_qpel8_h_ ## MMX(uint8_t *dst, uint8_t *src, int dstSt
"decl %2 \n\t"\
" jnz 1b \n\t"\
: "+a"(src), "+c"(dst), "+m"(h)\
: "d"((long)srcStride), "S"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_4)\
: "d"((x86_reg)srcStride), "S"((x86_reg)dstStride), "m"(ff_pw_5), "m"(ff_pw_4)\
: "memory"\
);\
}\
......
......@@ -42,7 +42,7 @@ int mm_support(void)
int rval = 0;
int eax, ebx, ecx, edx;
int max_std_level, max_ext_level, std_caps=0, ext_caps=0;
long a, c;
x86_reg a, c;
asm volatile (
/* See if CPUID instruction is supported ... */
......
......@@ -249,7 +249,7 @@ static void H264_CHROMA_MC4_TMPL(uint8_t *dst/*align 4*/, uint8_t *src/*align 1*
"sub $2, %2 \n\t"
"jnz 1b \n\t"
: "+r"(dst), "+r"(src), "+r"(h)
: "r"((long)stride), "m"(ff_pw_32), "m"(x), "m"(y)
: "r"((x86_reg)stride), "m"(ff_pw_32), "m"(x), "m"(y)
);
}
......@@ -300,7 +300,7 @@ static void H264_CHROMA_MC2_TMPL(uint8_t *dst/*align 2*/, uint8_t *src/*align 1*
"sub $1, %2\n\t"
"jnz 1b\n\t"
: "+r" (dst), "+r"(src), "+r"(h)
: "m" (ff_pw_32), "r"((long)stride)
: "m" (ff_pw_32), "r"((x86_reg)stride)
: "%esi");
}
......
......@@ -72,7 +72,7 @@ static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*
"lea (%0,%3,2), %0 \n\t"
"jg 1b \n\t"
:"+r"(dst), "+r"(src), "+r"(h)
:"r"((long)stride)
:"r"((x86_reg)stride)
);
} else {
asm volatile(
......@@ -100,7 +100,7 @@ static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*
"lea (%0,%3,2), %0 \n\t"
"jg 1b \n\t"
:"+r"(dst), "+r"(src), "+r"(h)
:"r"((long)stride)
:"r"((x86_reg)stride)
);
}
return;
......@@ -154,7 +154,7 @@ static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*
"lea (%0,%3,2), %0 \n\t"
"jg 1b \n\t"
:"+r"(dst), "+r"(src), "+r"(h)
:"r"((long)stride)
:"r"((x86_reg)stride)
);
}
......@@ -202,7 +202,7 @@ static void H264_CHROMA_MC4_TMPL(uint8_t *dst/*align 4*/, uint8_t *src/*align 1*
"lea (%0,%3,2), %0 \n\t"
"jg 1b \n\t"
:"+r"(dst), "+r"(src), "+r"(h)
:"r"((long)stride)
:"r"((x86_reg)stride)
);
}
This diff is collapsed.
......@@ -55,7 +55,7 @@ static void DEF(put_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D"(block)
:"r" ((long)line_size)
:"r" ((x86_reg)line_size)
:"%"REG_a, "memory");
}
......@@ -105,7 +105,7 @@ static void DEF(put_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
:"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride)
:"memory");
}
......@@ -152,7 +152,7 @@ static void DEF(put_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
:"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride)
:"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
......@@ -222,7 +222,7 @@ static void DEF(put_no_rnd_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
:"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride)
:"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
......@@ -277,7 +277,7 @@ static void DEF(avg_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
:"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride)
:"memory");
}
......@@ -329,7 +329,7 @@ static void DEF(avg_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
:"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride)
:"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
......@@ -373,7 +373,7 @@ static void DEF(put_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D"(block)
:"r" ((long)line_size)
:"r" ((x86_reg)line_size)
:"%"REG_a, "memory");
}
......@@ -417,7 +417,7 @@ static void DEF(put_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
:"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride)
:"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
......@@ -471,7 +471,7 @@ static void DEF(avg_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
:"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride)
:"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
......@@ -544,7 +544,7 @@ static void DEF(put_no_rnd_pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t *sr
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
:"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride)
:"memory");
//the following should be used, though better not with gcc ...
/* :"+g"(h), "+r"(src1), "+r"(src2), "+r"(dst)
......@@ -586,7 +586,7 @@ static void DEF(put_no_rnd_pixels8_x2)(uint8_t *block, const uint8_t *pixels, in
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D"(block)
:"r" ((long)line_size)
:"r" ((x86_reg)line_size)
:"%"REG_a, "memory");
}
......@@ -616,7 +616,7 @@ static void DEF(put_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D" (block)
:"r" ((long)line_size)
:"r" ((x86_reg)line_size)
:"%"REG_a, "memory");
}
......@@ -650,7 +650,7 @@ static void DEF(put_no_rnd_pixels8_y2)(uint8_t *block, const uint8_t *pixels, in
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D" (block)
:"r" ((long)line_size)
:"r" ((x86_reg)line_size)
:"%"REG_a, "memory");
}
......@@ -678,7 +678,7 @@ static void DEF(avg_pixels8)(uint8_t *block, const uint8_t *pixels, int line_siz
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D"(block)
:"r" ((long)line_size)
:"r" ((x86_reg)line_size)
:"%"REG_a, "memory");
}
......@@ -710,7 +710,7 @@ static void DEF(avg_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D"(block)
:"r" ((long)line_size)
:"r" ((x86_reg)line_size)
:"%"REG_a, "memory");
}
......@@ -748,7 +748,7 @@ static void DEF(avg_pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line_
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D"(block)
:"r" ((long)line_size)
:"r" ((x86_reg)line_size)
:"%"REG_a, "memory");
}
......@@ -791,7 +791,7 @@ static void DEF(avg_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D"(block)
:"r" ((long)line_size)
:"r" ((x86_reg)line_size)
:"%"REG_a, "memory");
}
......@@ -812,7 +812,7 @@ static void DEF(avg_pixels4)(uint8_t *block, const uint8_t *pixels, int line_siz
"movd %%mm2, (%1, %2, 2) \n\t"
"movd %%mm3, (%1, %3) \n\t"
::"S"(pixels), "D"(block),
"r" ((long)line_size), "r"(3L*line_size)
"r" ((x86_reg)line_size), "r"((x86_reg)3L*line_size)
:"memory");
block += 4*line_size;
pixels += 4*line_size;
......@@ -868,8 +868,8 @@ static void DEF(OPNAME ## 2tap_qpel16_l3)(uint8_t *dst, uint8_t *src, int stride
"decl %0 \n\t"\
"jnz 1b \n\t"\
:"+g"(h), "+r"(src)\
:"r"((long)off1), "r"((long)off2),\
"r"((long)(dst-src)), "r"((long)stride)\
:"r"((x86_reg)off1), "r"((x86_reg)off2),\
"r"((x86_reg)(dst-src)), "r"((x86_reg)stride)\
:"memory"\
);\
}\
......@@ -885,8 +885,8 @@ static void DEF(OPNAME ## 2tap_qpel8_l3)(uint8_t *dst, uint8_t *src, int stride,
"decl %0 \n\t"\
"jnz 1b \n\t"\
:"+g"(h), "+r"(src)\
:"r"((long)off1), "r"((long)off2),\
"r"((long)(dst-src)), "r"((long)stride)\
:"r"((x86_reg)off1), "r"((x86_reg)off2),\
"r"((x86_reg)(dst-src)), "r"((x86_reg)stride)\
:"memory"\
);\
}
......
......@@ -30,7 +30,7 @@
static int DEF(try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale)
{
long i=0;
x86_reg i=0;
assert(FFABS(scale) < MAX_ABS);
scale<<= 16 + SCALE_OFFSET - BASIS_SHIFT + RECON_SHIFT;
......@@ -72,7 +72,7 @@ static int DEF(try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[
static void DEF(add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale)
{
long i=0;
x86_reg i=0;
if(FFABS(scale) < MAX_ABS){
scale<<= 16 + SCALE_OFFSET - BASIS_SHIFT + RECON_SHIFT;
......
......@@ -57,7 +57,7 @@ static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D"(block)
:"r"((long)line_size)
:"r"((x86_reg)line_size)
:REG_a, "memory");
}
......@@ -107,7 +107,7 @@ static void av_unused DEF(put, pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
:"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride)
:"memory");
}
......@@ -153,7 +153,7 @@ static void DEF(put, pixels16_x2)(uint8_t *block, const uint8_t *pixels, int lin
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D"(block)
:"r"((long)line_size)
:"r"((x86_reg)line_size)
:REG_a, "memory");
}
......@@ -202,7 +202,7 @@ static void av_unused DEF(put, pixels16_l2)(uint8_t *dst, uint8_t *src1, uint8_t
#else
:"+b"(h), "+a"(src1), "+c"(src2), "+d"(dst)
#endif
:"S"((long)src1Stride), "D"((long)dstStride)
:"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride)
:"memory");
}
......@@ -231,7 +231,7 @@ static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D"(block)
:"r"((long)line_size)
:"r"((x86_reg)line_size)
:REG_a, "memory");
}
......@@ -297,7 +297,7 @@ static void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int lin
"subl $2, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels)
:"D"(block), "r"((long)line_size)
:"D"(block), "r"((x86_reg)line_size)
:REG_a, "memory");
}
......@@ -493,7 +493,7 @@ static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, int line
"subl $4, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels), "+D"(block)
:"r"((long)line_size)
:"r"((x86_reg)line_size)
:REG_a, "memory");
}
......@@ -568,7 +568,7 @@ static void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int lin
"subl $2, %0 \n\t"
"jnz 1b \n\t"
:"+g"(h), "+S"(pixels)
:"D"(block), "r"((long)line_size)
:"D"(block), "r"((x86_reg)line_size)
:REG_a, "memory");
}
......
......@@ -51,7 +51,7 @@ static void get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size)
"add $32, %%"REG_a" \n\t"
"js 1b \n\t"
: "+r" (pixels)
: "r" (block+64), "r" ((long)line_size), "r" ((long)line_size*2)
: "r" (block+64), "r" ((x86_reg)line_size), "r" ((x86_reg)line_size*2)
: "%"REG_a
);
}
......@@ -80,7 +80,7 @@ static inline void diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const uint
"add $16, %%"REG_a" \n\t"
"jnz 1b \n\t"
: "+r" (s1), "+r" (s2)
: "r" (block+64), "r" ((long)stride)
: "r" (block+64), "r" ((x86_reg)stride)
: "%"REG_a
);
}
......@@ -88,7 +88,7 @@ static inline void diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const uint
static int pix_sum16_mmx(uint8_t * pix, int line_size){
const int h=16;
int sum;
long index= -line_size*h;
x86_reg index= -line_size*h;
asm volatile(
"pxor %%mm7, %%mm7 \n\t"
......@@ -117,7 +117,7 @@ static int pix_sum16_mmx(uint8_t * pix, int line_size){
"movd %%mm6, %0 \n\t"
"andl $0xFFFF, %0 \n\t"
: "=&r" (sum), "+r" (index)
: "r" (pix - index), "r" ((long)line_size)
: "r" (pix - index), "r" ((x86_reg)line_size)
);
return sum;
......@@ -162,7 +162,7 @@ static int pix_norm1_mmx(uint8_t *pix, int line_size) {
"psrlq $32, %%mm7\n" /* shift hi dword to lo */
"paddd %%mm7,%%mm1\n"
"movd %%mm1,%1\n"
: "+r" (pix), "=r"(tmp) : "r" ((long)line_size) : "%ecx" );
: "+r" (pix), "=r"(tmp) : "r" ((x86_reg)line_size) : "%ecx" );
return tmp;
}
......@@ -222,7 +222,7 @@ static int sse8_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int
"paddd %%mm7,%%mm1\n"
"movd %%mm1,%2\n"
: "+r" (pix1), "+r" (pix2), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "r" ((x86_reg)line_size) , "m" (h)
: "%ecx");
return tmp;
}
......@@ -282,7 +282,7 @@ static int sse16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, int
"paddd %%mm7,%%mm1\n"
"movd %%mm1,%2\n"
: "+r" (pix1), "+r" (pix2), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "r" ((x86_reg)line_size) , "m" (h)
: "%ecx");
return tmp;
}
......@@ -345,7 +345,7 @@ static int sse16_sse2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, in
"paddd %%xmm1,%%xmm7\n"
"movd %%xmm7,%3\n"
: "+r" (pix1), "+r" (pix2), "+r"(h), "=r"(tmp)
: "r" ((long)line_size));
: "r" ((x86_reg)line_size));
return tmp;
}
......@@ -469,7 +469,7 @@ static int hf_noise8_mmx(uint8_t * pix1, int line_size, int h) {
"paddd %%mm6,%%mm0\n"
"movd %%mm0,%1\n"
: "+r" (pix1), "=r"(tmp)
: "r" ((long)line_size) , "g" (h-2)
: "r" ((x86_reg)line_size) , "g" (h-2)
: "%ecx");
return tmp;
}
......@@ -583,7 +583,7 @@ static int hf_noise16_mmx(uint8_t * pix1, int line_size, int h) {
"paddd %%mm6,%%mm0\n"
"movd %%mm0,%1\n"
: "+r" (pix1), "=r"(tmp)
: "r" ((long)line_size) , "g" (h-2)
: "r" ((x86_reg)line_size) , "g" (h-2)
: "%ecx");
return tmp + hf_noise8_mmx(pix+8, line_size, h);
}
......@@ -665,7 +665,7 @@ static int vsad_intra16_mmx(void *v, uint8_t * pix, uint8_t * dummy, int line_si
"paddw %%mm6,%%mm0\n"
"movd %%mm0,%1\n"
: "+r" (pix), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "r" ((x86_reg)line_size) , "m" (h)
: "%ecx");
return tmp & 0xFFFF;
}
......@@ -706,7 +706,7 @@ static int vsad_intra16_mmx2(void *v, uint8_t * pix, uint8_t * dummy, int line_s
"movd %%mm6,%1\n"
: "+r" (pix), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "r" ((x86_reg)line_size) , "m" (h)
: "%ecx");
return tmp;
}
......@@ -785,7 +785,7 @@ static int vsad16_mmx(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, in
"paddw %%mm6,%%mm0\n"
"movd %%mm0,%2\n"
: "+r" (pix1), "+r" (pix2), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "r" ((x86_reg)line_size) , "m" (h)
: "%ecx");
return tmp & 0x7FFF;
}
......@@ -843,14 +843,14 @@ static int vsad16_mmx2(void *v, uint8_t * pix1, uint8_t * pix2, int line_size, i
"movd %%mm6,%2\n"
: "+r" (pix1), "+r" (pix2), "=r"(tmp)
: "r" ((long)line_size) , "m" (h)
: "r" ((x86_reg)line_size) , "m" (h)
: "%ecx");
return tmp;
}
#undef SUM
static void diff_bytes_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
long i=0;
x86_reg i=0;
asm volatile(
"1: \n\t"
"movq (%2, %0), %%mm0 \n\t"
......@@ -865,14 +865,14 @@ static void diff_bytes_mmx(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w){
"cmp %4, %0 \n\t"
" jb 1b \n\t"
: "+r" (i)
: "r"(src1), "r"(src2), "r"(dst), "r"((long)w-15)
: "r"(src1), "r"(src2), "r"(dst), "r"((x86_reg)w-15)
);
for(; i<w; i++)
dst[i+0] = src1[i+0]-src2[i+0];
}
static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top){
long i=0;
x86_reg i=0;
uint8_t l, lt;
asm volatile(
......@@ -895,7 +895,7 @@ static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *src1, uint8_t
"cmp %4, %0 \n\t"
" jb 1b \n\t"
: "+r" (i)
: "r"(src1), "r"(src2), "r"(dst), "r"((long)w)
: "r"(src1), "r"(src2), "r"(dst), "r"((x86_reg)w)
);
l= *left;
......@@ -930,7 +930,7 @@ static void sub_hfyu_median_prediction_mmx2(uint8_t *dst, uint8_t *src1, uint8_t
DIFF_PIXELS_1(m0, mm##7, mm##0, (%1,%3,4), (%2,%3,4))\
"mov"#m1" %0, "#mm"0 \n\t"\
: "+m"(temp), "+r"(p1b), "+r"(p2b)\
: "r"((long)stride), "r"((long)stride*3)\
: "r"((x86_reg)stride), "r"((x86_reg)stride*3)\
);\
}
//the "+m"(temp) is needed as gcc 2.95 sometimes fails to compile "=m"(temp)
......@@ -1237,7 +1237,7 @@ DCT_SAD_FUNC(ssse3)
static int ssd_int8_vs_int16_mmx(const int8_t *pix1, const int16_t *pix2, int size){
int sum;
long i=size;
x86_reg i=size;
asm volatile(
"pxor %%mm4, %%mm4 \n"
"1: \n"
......
......@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dsputil.h"
#include "x86_cpu.h"
static const int p1m1[2] __attribute__((aligned(8))) =
{ 0, 1 << 31 };
......@@ -30,7 +31,8 @@ static const int m1p1[2] __attribute__((aligned(8))) =
void ff_fft_calc_3dn(FFTContext *s, FFTComplex *z)
{
int ln = s->nbits;
long i, j;
long j;
x86_reg i;
long nblocks, nloops;
FFTComplex *p, *cptr;
......
......@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dsputil.h"
#include "x86_cpu.h"
static const int p1m1[2] __attribute__((aligned(8))) =
{ 0, 1 << 31 };
......@@ -30,7 +31,8 @@ static const int m1p1[2] __attribute__((aligned(8))) =
void ff_fft_calc_3dn2(FFTContext *s, FFTComplex *z)
{
int ln = s->nbits;
long i, j;
long j;
x86_reg i;
long nblocks, nloops;
FFTComplex *p, *cptr;
......@@ -124,7 +126,8 @@ void ff_fft_calc_3dn2(FFTContext *s, FFTComplex *z)
void ff_imdct_calc_3dn2(MDCTContext *s, FFTSample *output,
const FFTSample *input, FFTSample *tmp)
{
long k, n8, n4, n2, n;
long n8, n4, n2, n;
x86_reg k;
const uint16_t *revtab = s->fft.revtab;
const FFTSample *tcos = s->tcos;
const FFTSample *tsin = s->tsin;
......
......@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "dsputil.h"
#include "x86_cpu.h"
static const int p1p1p1m1[4] __attribute__((aligned(16))) =
{ 0, 0, 0, 1 << 31 };
......@@ -48,7 +49,8 @@ static void print_v4sf(const char *str, __m128 a)
void ff_fft_calc_sse(FFTContext *s, FFTComplex *z)
{
int ln = s->nbits;
long i, j;
x86_reg i;
long j;
long nblocks, nloops;
FFTComplex *p, *cptr;
......@@ -142,7 +144,8 @@ void ff_fft_calc_sse(FFTContext *s, FFTComplex *z)
void ff_imdct_calc_sse(MDCTContext *s, FFTSample *output,
const FFTSample *input, FFTSample *tmp)
{
long k, n8, n4, n2, n;
x86_reg k;
long n8, n4, n2, n;
const uint16_t *revtab = s->fft.revtab;
const FFTSample *tcos = s->tcos;
const FFTSample *tsin = s->tsin;
......
......@@ -20,13 +20,14 @@
*/
#include "dsputil_mmx.h"
#include "x86_cpu.h"
static void apply_welch_window_sse2(const int32_t *data, int len, double *w_data)
{
double c = 2.0 / (len-1.0);
int n2 = len>>1;
long i = -n2*sizeof(int32_t);
long j = n2*sizeof(int32_t);
x86_reg i = -n2*sizeof(int32_t);
x86_reg j = n2*sizeof(int32_t);
asm volatile(
"movsd %0, %%xmm7 \n\t"
"movapd %1, %%xmm6 \n\t"
......@@ -71,7 +72,7 @@ void ff_flac_compute_autocorr_sse2(const int32_t *data, int len, int lag,
double *data1 = tmp + lag;
int j;
if((long)data1 & 15)
if((x86_reg)data1 & 15)
data1++;
apply_welch_window_sse2(data, len, data1);
......@@ -81,7 +82,7 @@ void ff_flac_compute_autocorr_sse2(const int32_t *data, int len, int lag,
data1[len] = 0.0;
for(j=0; j<lag; j+=2){
long i = -len*sizeof(double);
x86_reg i = -len*sizeof(double);
if(j == lag-2) {
asm volatile(
"movsd %6, %%xmm0 \n\t"
......
......@@ -96,7 +96,7 @@ static int decode_significance_8x8_x86(CABACContext *c,
int *index, const uint8_t *sig_off){
int minusindex= 4-(int)index;
int coeff_count;
long last=0;
x86_reg last=0;
asm volatile(
"movl "RANGE "(%3), %%esi \n\t"
"movl "LOW "(%3), %%ebx \n\t"
......
This diff is collapsed.
......@@ -34,7 +34,7 @@ DECLARE_ASM_CONST(8, uint64_t, bone)= 0x0101010101010101LL;
static inline void sad8_1_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
long len= -(stride*h);
x86_reg len= -(stride*h);
asm volatile(
ASMALIGN(4)
"1: \n\t"
......@@ -64,7 +64,7 @@ static inline void sad8_1_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
"add %3, %%"REG_a" \n\t"
" js 1b \n\t"
: "+a" (len)
: "r" (blk1 - len), "r" (blk2 - len), "r" ((long)stride)
: "r" (blk1 - len), "r" (blk2 - len), "r" ((x86_reg)stride)
);
}
......@@ -84,7 +84,7 @@ static inline void sad8_1_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
"sub $2, %0 \n\t"
" jg 1b \n\t"
: "+r" (h), "+r" (blk1), "+r" (blk2)
: "r" ((long)stride)
: "r" ((x86_reg)stride)
);
}
......@@ -106,7 +106,7 @@ static int sad16_sse2(void *v, uint8_t *blk2, uint8_t *blk1, int stride, int h)
"sub $2, %0 \n\t"
" jg 1b \n\t"
: "+r" (h), "+r" (blk1), "+r" (blk2)
: "r" ((long)stride)
: "r" ((x86_reg)stride)
);
asm volatile(
"movhlps %%xmm6, %%xmm0 \n\t"
......@@ -135,7 +135,7 @@ static inline void sad8_x2a_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h
"sub $2, %0 \n\t"
" jg 1b \n\t"
: "+r" (h), "+r" (blk1), "+r" (blk2)
: "r" ((long)stride)
: "r" ((x86_reg)stride)
);
}
......@@ -160,7 +160,7 @@ static inline void sad8_y2a_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h
"sub $2, %0 \n\t"
" jg 1b \n\t"
: "+r" (h), "+r" (blk1), "+r" (blk2)
: "r" ((long)stride)
: "r" ((x86_reg)stride)
);
}
......@@ -190,13 +190,13 @@ static inline void sad8_4_mmx2(uint8_t *blk1, uint8_t *blk2, int stride, int h)
"sub $2, %0 \n\t"
" jg 1b \n\t"
: "+r" (h), "+r" (blk1), "+r" (blk2)
: "r" ((long)stride)
: "r" ((x86_reg)stride)
);
}
static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int stride, int h)
{
long len= -(stride*h);
x86_reg len= -(stride*h);
asm volatile(
ASMALIGN(4)
"1: \n\t"
......@@ -228,13 +228,13 @@ static inline void sad8_2_mmx(uint8_t *blk1a, uint8_t *blk1b, uint8_t *blk2, int
"add %4, %%"REG_a" \n\t"
" js 1b \n\t"
: "+a" (len)
: "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" ((long)stride)
: "r" (blk1a - len), "r" (blk1b -len), "r" (blk2 - len), "r" ((x86_reg)stride)
);