Commit 2bacfbba authored by diego's avatar diego

Add ARCH_X86_32 as a new define for 32 bit x86 architectures and change

the semantics of ARCH_X86 to mean both 32 and 64 bits.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6852 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 3dba5aaa
...@@ -355,10 +355,10 @@ dcbzl="no" ...@@ -355,10 +355,10 @@ dcbzl="no"
mmi="default" mmi="default"
case "$arch" in case "$arch" in
i386|i486|i586|i686|i86pc|BePC) i386|i486|i586|i686|i86pc|BePC)
arch="x86" arch="x86_32"
;; ;;
x86_64|amd64) x86_64|amd64)
arch="x86" arch="x86"_32
canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`" canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
...@@ -1002,7 +1002,7 @@ fi ...@@ -1002,7 +1002,7 @@ fi
# compute MMX state # compute MMX state
if test $mmx = "default"; then if test $mmx = "default"; then
if test $arch = "x86" -o $arch = "x86_64"; then if test $arch = "x86_32" -o $arch = "x86_64"; then
mmx="yes" mmx="yes"
else else
mmx="no" mmx="no"
...@@ -1567,7 +1567,7 @@ fi ...@@ -1567,7 +1567,7 @@ fi
echo "big-endian $bigendian" echo "big-endian $bigendian"
echo "inttypes.h $inttypes" echo "inttypes.h $inttypes"
echo "broken inttypes.h $emu_fast_int" echo "broken inttypes.h $emu_fast_int"
if test $arch = "x86" -o $arch = "x86_64"; then if test $arch = "x86_32" -o $arch = "x86_64"; then
echo "MMX enabled $mmx" echo "MMX enabled $mmx"
echo "CMOV enabled $cmov" echo "CMOV enabled $cmov"
echo "CMOV is fast $cmov_is_fast" echo "CMOV is fast $cmov_is_fast"
...@@ -1684,9 +1684,13 @@ echo "SLIBPREF=$SLIBPREF" >> config.mak ...@@ -1684,9 +1684,13 @@ echo "SLIBPREF=$SLIBPREF" >> config.mak
echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
echo "TARGET_OS=$targetos" >> config.mak echo "TARGET_OS=$targetos" >> config.mak
if test "$arch" = "x86" ; then if test "$arch" = "x86_32" -o "$arch" = "x86_64" ; then
echo "TARGET_ARCH_X86=yes" >> config.mak echo "TARGET_ARCH_X86=yes" >> config.mak
echo "#define ARCH_X86 1" >> $TMPH echo "#define ARCH_X86 1" >> $TMPH
fi
if test "$arch" = "x86_32" ; then
echo "TARGET_ARCH_X86_32=yes" >> config.mak
echo "#define ARCH_X86_32 1" >> $TMPH
elif test "$arch" = "x86_64" ; then elif test "$arch" = "x86_64" ; then
echo "TARGET_ARCH_X86_64=yes" >> config.mak echo "TARGET_ARCH_X86_64=yes" >> config.mak
echo "#define ARCH_X86_64 1" >> $TMPH echo "#define ARCH_X86_64 1" >> $TMPH
......
...@@ -379,7 +379,7 @@ static int always_inline get_cabac_inline(CABACContext *c, uint8_t * const state ...@@ -379,7 +379,7 @@ static int always_inline get_cabac_inline(CABACContext *c, uint8_t * const state
#define BYTE "16" #define BYTE "16"
#define BYTEEND "20" #define BYTEEND "20"
#endif #endif
#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) #if defined(ARCH_X86_32) && !(defined(PIC) && defined(__GNUC__))
int bit; int bit;
#ifndef BRANCHLESS_CABAC_DECODER #ifndef BRANCHLESS_CABAC_DECODER
...@@ -535,7 +535,7 @@ static int always_inline get_cabac_inline(CABACContext *c, uint8_t * const state ...@@ -535,7 +535,7 @@ static int always_inline get_cabac_inline(CABACContext *c, uint8_t * const state
); );
bit&=1; bit&=1;
#endif /* BRANCHLESS_CABAC_DECODER */ #endif /* BRANCHLESS_CABAC_DECODER */
#else /* defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) */ #else /* defined(ARCH_X86_32) && !(defined(PIC) && defined(__GNUC__)) */
int s = *state; int s = *state;
int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s]; int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s];
int bit, lps_mask attribute_unused; int bit, lps_mask attribute_unused;
...@@ -574,7 +574,7 @@ static int always_inline get_cabac_inline(CABACContext *c, uint8_t * const state ...@@ -574,7 +574,7 @@ static int always_inline get_cabac_inline(CABACContext *c, uint8_t * const state
if(!(c->low & CABAC_MASK)) if(!(c->low & CABAC_MASK))
refill2(c); refill2(c);
#endif /* BRANCHLESS_CABAC_DECODER */ #endif /* BRANCHLESS_CABAC_DECODER */
#endif /* defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) */ #endif /* defined(ARCH_X86_32) && !(defined(PIC) && defined(__GNUC__)) */
return bit; return bit;
} }
...@@ -683,7 +683,7 @@ static always_inline int get_cabac_bypass_sign(CABACContext *c, int val){ ...@@ -683,7 +683,7 @@ static always_inline int get_cabac_bypass_sign(CABACContext *c, int val){
//FIXME the x86 code from this file should be moved into i386/h264 or cabac something.c/h (note ill kill you if you move my code away from under my fingers before iam finished with it!) //FIXME the x86 code from this file should be moved into i386/h264 or cabac something.c/h (note ill kill you if you move my code away from under my fingers before iam finished with it!)
//FIXME use some macros to avoid duplicatin get_cabac (cant be done yet as that would make optimization work hard) //FIXME use some macros to avoid duplicatin get_cabac (cant be done yet as that would make optimization work hard)
#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) #if defined(ARCH_X86_32) && !(defined(PIC) && defined(__GNUC__))
static int decode_significance_x86(CABACContext *c, int max_coeff, uint8_t *significant_coeff_ctx_base, int *index){ static int decode_significance_x86(CABACContext *c, int max_coeff, uint8_t *significant_coeff_ctx_base, int *index){
void *end= significant_coeff_ctx_base + max_coeff - 1; void *end= significant_coeff_ctx_base + max_coeff - 1;
int minusstart= -(int)significant_coeff_ctx_base; int minusstart= -(int)significant_coeff_ctx_base;
...@@ -789,7 +789,7 @@ static int decode_significance_8x8_x86(CABACContext *c, uint8_t *significant_coe ...@@ -789,7 +789,7 @@ static int decode_significance_8x8_x86(CABACContext *c, uint8_t *significant_coe
); );
return coeff_count; return coeff_count;
} }
#endif /* defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) */ #endif /* defined(ARCH_X86_32) && !(defined(PIC) && defined(__GNUC__)) */
/** /**
* *
......
...@@ -6139,7 +6139,7 @@ static int decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n ...@@ -6139,7 +6139,7 @@ static int decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n
index[coeff_count++] = last;\ index[coeff_count++] = last;\
} }
const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD]; const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD];
#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) #if defined(ARCH_X86_32) && !(defined(PIC) && defined(__GNUC__))
coeff_count= decode_significance_8x8_x86(CC, significant_coeff_ctx_base, index, sig_off); coeff_count= decode_significance_8x8_x86(CC, significant_coeff_ctx_base, index, sig_off);
} else { } else {
coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index); coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#ifndef MATHOPS_H #ifndef MATHOPS_H
#define MATHOPS_H #define MATHOPS_H
#ifdef ARCH_X86 #ifdef ARCH_X86_32
#include "i386/mathops.h" #include "i386/mathops.h"
......
...@@ -344,7 +344,7 @@ static inline uint64_t read_time(void) ...@@ -344,7 +344,7 @@ static inline uint64_t read_time(void)
); );
return (d << 32) | (a & 0xffffffff); return (d << 32) | (a & 0xffffffff);
} }
#elif defined(ARCH_X86) #elif defined(ARCH_X86_32)
static inline long long read_time(void) static inline long long read_time(void)
{ {
long long l; long long l;
......
...@@ -217,7 +217,7 @@ if((y)<(x)){\ ...@@ -217,7 +217,7 @@ if((y)<(x)){\
static always_inline long int lrintf(float x) static always_inline long int lrintf(float x)
{ {
#ifdef __MINGW32__ #ifdef __MINGW32__
# ifdef ARCH_X86 # ifdef ARCH_X86_32
int32_t i; int32_t i;
asm volatile( asm volatile(
"fistpl %0\n\t" "fistpl %0\n\t"
...@@ -227,7 +227,7 @@ static always_inline long int lrintf(float x) ...@@ -227,7 +227,7 @@ static always_inline long int lrintf(float x)
# else # else
/* XXX: incorrect, but make it compile */ /* XXX: incorrect, but make it compile */
return (int)(x + (x < 0 ? -0.5 : 0.5)); return (int)(x + (x < 0 ? -0.5 : 0.5));
# endif /* ARCH_X86 */ # endif /* ARCH_X86_32 */
#else #else
return (int)(rint(x)); return (int)(rint(x));
#endif /* __MINGW32__ */ #endif /* __MINGW32__ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment