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.

Originally committed as revision 6852 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Diego Biurrun 2006-11-01 17:01:33 +00:00
parent 6c02f9e7ee
commit 419b878494
6 changed files with 19 additions and 15 deletions

14
configure vendored
View File

@ -355,10 +355,10 @@ dcbzl="no"
mmi="default"
case "$arch" in
i386|i486|i586|i686|i86pc|BePC)
arch="x86"
arch="x86_32"
;;
x86_64|amd64)
arch="x86"
arch="x86"_32
canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
@ -1002,7 +1002,7 @@ fi
# compute MMX state
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"
else
mmx="no"
@ -1567,7 +1567,7 @@ fi
echo "big-endian $bigendian"
echo "inttypes.h $inttypes"
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 "CMOV enabled $cmov"
echo "CMOV is fast $cmov_is_fast"
@ -1684,9 +1684,13 @@ echo "SLIBPREF=$SLIBPREF" >> config.mak
echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
echo "EXESUF=\${BUILDSUF}$EXESUF" >> 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 "#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
echo "TARGET_ARCH_X86_64=yes" >> config.mak
echo "#define ARCH_X86_64 1" >> $TMPH

View File

@ -379,7 +379,7 @@ static int always_inline get_cabac_inline(CABACContext *c, uint8_t * const state
#define BYTE "16"
#define BYTEEND "20"
#endif
#if defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__))
#if defined(ARCH_X86_32) && !(defined(PIC) && defined(__GNUC__))
int bit;
#ifndef BRANCHLESS_CABAC_DECODER
@ -535,7 +535,7 @@ static int always_inline get_cabac_inline(CABACContext *c, uint8_t * const state
);
bit&=1;
#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 RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s];
int bit, lps_mask attribute_unused;
@ -574,7 +574,7 @@ static int always_inline get_cabac_inline(CABACContext *c, uint8_t * const state
if(!(c->low & CABAC_MASK))
refill2(c);
#endif /* BRANCHLESS_CABAC_DECODER */
#endif /* defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) */
#endif /* defined(ARCH_X86_32) && !(defined(PIC) && defined(__GNUC__)) */
return bit;
}
@ -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 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){
void *end= significant_coeff_ctx_base + max_coeff - 1;
int minusstart= -(int)significant_coeff_ctx_base;
@ -789,7 +789,7 @@ static int decode_significance_8x8_x86(CABACContext *c, uint8_t *significant_coe
);
return coeff_count;
}
#endif /* defined(ARCH_X86) && !(defined(PIC) && defined(__GNUC__)) */
#endif /* defined(ARCH_X86_32) && !(defined(PIC) && defined(__GNUC__)) */
/**
*

View File

@ -6139,7 +6139,7 @@ static int decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n
index[coeff_count++] = last;\
}
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);
} else {
coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index);

View File

@ -22,7 +22,7 @@
#ifndef MATHOPS_H
#define MATHOPS_H
#ifdef ARCH_X86
#ifdef ARCH_X86_32
#include "i386/mathops.h"

View File

@ -344,7 +344,7 @@ static inline uint64_t read_time(void)
);
return (d << 32) | (a & 0xffffffff);
}
#elif defined(ARCH_X86)
#elif defined(ARCH_X86_32)
static inline long long read_time(void)
{
long long l;

View File

@ -217,7 +217,7 @@ if((y)<(x)){\
static always_inline long int lrintf(float x)
{
#ifdef __MINGW32__
# ifdef ARCH_X86
# ifdef ARCH_X86_32
int32_t i;
asm volatile(
"fistpl %0\n\t"
@ -227,7 +227,7 @@ static always_inline long int lrintf(float x)
# else
/* XXX: incorrect, but make it compile */
return (int)(x + (x < 0 ? -0.5 : 0.5));
# endif /* ARCH_X86 */
# endif /* ARCH_X86_32 */
#else
return (int)(rint(x));
#endif /* __MINGW32__ */