Commit 87ea51e0 authored by Luca Barbato's avatar Luca Barbato

fix the dcbz check and move it in configure

Originally committed as revision 6580 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 104f8c10
...@@ -349,6 +349,7 @@ mmx="default" ...@@ -349,6 +349,7 @@ mmx="default"
armv5te="default" armv5te="default"
iwmmxt="default" iwmmxt="default"
altivec="default" altivec="default"
dcbzl="no"
mmi="default" mmi="default"
case "$cpu" in case "$cpu" in
i386|i486|i586|i686|i86pc|BePC) i386|i486|i586|i686|i86pc|BePC)
...@@ -1139,6 +1140,19 @@ if test "$?" != 0; then ...@@ -1139,6 +1140,19 @@ if test "$?" != 0; then
die "C compiler test failed." die "C compiler test failed."
fi fi
# check for assembler specific support
if test $cpu = "powerpc"; then
check_cc <<EOF && dcbzl=yes
int main(void) {
register long zero = 0;
char data[1024];
asm volatile("dcbzl %0, %1" : : "b" (data), "r" (zero));
return 0;
}
EOF
fi
# check for SIMD availability # check for SIMD availability
# AltiVec flags: The FSF version of GCC differs from the Apple version # AltiVec flags: The FSF version of GCC differs from the Apple version
...@@ -1572,6 +1586,7 @@ if test $cpu = "mips"; then ...@@ -1572,6 +1586,7 @@ if test $cpu = "mips"; then
fi fi
if test $cpu = "powerpc"; then if test $cpu = "powerpc"; then
echo "AltiVec enabled $altivec" echo "AltiVec enabled $altivec"
echo "dcbzl available $dcbzl"
fi fi
echo "gprof enabled $gprof" echo "gprof enabled $gprof"
echo "zlib enabled $zlib" echo "zlib enabled $zlib"
...@@ -1763,6 +1778,13 @@ if test "$mmi" = "yes" ; then ...@@ -1763,6 +1778,13 @@ if test "$mmi" = "yes" ; then
echo "TARGET_MMI=yes" >> config.mak echo "TARGET_MMI=yes" >> config.mak
echo "#define HAVE_MMI 1" >> $TMPH echo "#define HAVE_MMI 1" >> $TMPH
fi fi
if test "$dcbzl" = "yes" ; then
echo "#define HAVE_DCBZL 1" >> $TMPH
else
echo "#undef HAVE_DCBZL" >> $TMPH
fi
if test "$altivec" = "yes" ; then if test "$altivec" = "yes" ; then
echo "TARGET_ALTIVEC=yes" >> config.mak echo "TARGET_ALTIVEC=yes" >> config.mak
echo "#define HAVE_ALTIVEC 1" >> $TMPH echo "#define HAVE_ALTIVEC 1" >> $TMPH
......
...@@ -175,7 +175,7 @@ POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz32, 1); ...@@ -175,7 +175,7 @@ POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz32, 1);
/* same as above, when dcbzl clear a whole 128B cache line /* same as above, when dcbzl clear a whole 128B cache line
i.e. the PPC970 aka G5 */ i.e. the PPC970 aka G5 */
#ifndef NO_DCBZL #ifdef HAVE_DCBZL
void clear_blocks_dcbz128_ppc(DCTELEM *blocks) void clear_blocks_dcbz128_ppc(DCTELEM *blocks)
{ {
POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz128, 1); POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz128, 1);
...@@ -205,7 +205,7 @@ void clear_blocks_dcbz128_ppc(DCTELEM *blocks) ...@@ -205,7 +205,7 @@ void clear_blocks_dcbz128_ppc(DCTELEM *blocks)
} }
#endif #endif
#ifndef NO_DCBZL #ifdef HAVE_DCBZL
/* check dcbz report how many bytes are set to 0 by dcbz */ /* check dcbz report how many bytes are set to 0 by dcbz */
/* update 24/06/2003 : replace dcbz by dcbzl to get /* update 24/06/2003 : replace dcbz by dcbzl to get
the intended effect (Apple "fixed" dcbz) the intended effect (Apple "fixed" dcbz)
......
...@@ -21,17 +21,6 @@ ...@@ -21,17 +21,6 @@
#ifndef _DSPUTIL_PPC_ #ifndef _DSPUTIL_PPC_
#define _DSPUTIL_PPC_ #define _DSPUTIL_PPC_
#ifdef CONFIG_DARWIN
/* The Apple assembler shipped w/ gcc-3.3 knows about DCBZL, previous assemblers don't
We assume here that the Darwin GCC is from Apple.... */
#if (__GNUC__ * 100 + __GNUC_MINOR__ < 303)
#define NO_DCBZL
#endif
#else /* CONFIG_DARWIN */
/* I don't think any non-Apple assembler knows about DCBZL */
#define NO_DCBZL
#endif /* CONFIG_DARWIN */
#ifdef POWERPC_PERFORMANCE_REPORT #ifdef POWERPC_PERFORMANCE_REPORT
void powerpc_display_perf_report(void); void powerpc_display_perf_report(void);
/* the 604* have 2, the G3* have 4, the G4s have 6, /* the 604* have 2, the G3* have 4, the G4s have 6,
......
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