Commit 90fbb5c4 authored by diego's avatar diego

Proper armv5te instructions support detection.

patch by Siarhei Siamashka, siarhei dot siamashka gmail com


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6246 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 4405639f
...@@ -78,6 +78,7 @@ show_help(){ ...@@ -78,6 +78,7 @@ show_help(){
echo " --powerpc-perf-enable enable performance report on PPC" echo " --powerpc-perf-enable enable performance report on PPC"
echo " (requires enabling PMC)" echo " (requires enabling PMC)"
echo " --disable-mmx disable MMX usage" echo " --disable-mmx disable MMX usage"
echo " --disable-armv5te disable armv5te usage"
echo " --disable-iwmmxt disable iwmmxt usage" echo " --disable-iwmmxt disable iwmmxt usage"
echo " --disable-altivec disable AltiVec usage" echo " --disable-altivec disable AltiVec usage"
echo " --disable-audio-oss disable OSS audio support [default=no]" echo " --disable-audio-oss disable OSS audio support [default=no]"
...@@ -345,6 +346,7 @@ cpu=`uname -m` ...@@ -345,6 +346,7 @@ cpu=`uname -m`
tune="generic" tune="generic"
powerpc_perf="no" powerpc_perf="no"
mmx="default" mmx="default"
armv5te="default"
iwmmxt="default" iwmmxt="default"
altivec="default" altivec="default"
mmi="default" mmi="default"
...@@ -362,7 +364,7 @@ case "$cpu" in ...@@ -362,7 +364,7 @@ case "$cpu" in
fi fi
;; ;;
# armv4l is a subset of armv5tel # armv4l is a subset of armv5tel
armv4l|armv5tel) arm|armv4l|armv5tel)
cpu="armv4l" cpu="armv4l"
;; ;;
alpha) alpha)
...@@ -719,6 +721,8 @@ for opt do ...@@ -719,6 +721,8 @@ for opt do
;; ;;
--disable-mmx) mmx="no" --disable-mmx) mmx="no"
;; ;;
--disable-armv5te) armv5te="no"
;;
--disable-iwmmxt) iwmmxt="no" --disable-iwmmxt) iwmmxt="no"
;; ;;
--disable-altivec) altivec="no" --disable-altivec) altivec="no"
...@@ -999,6 +1003,16 @@ if test $mmx = "default"; then ...@@ -999,6 +1003,16 @@ if test $mmx = "default"; then
fi fi
fi fi
# check armv5te instructions support
if test $armv5te = "default" -a $cpu = "armv4l"; then
armv5te=no
check_cc <<EOF && armv5te=yes
int main(void) {
__asm__ __volatile__ ("qadd r0, r0, r0");
}
EOF
fi
# check iwmmxt support # check iwmmxt support
if test $iwmmxt = "default" -a $cpu = "armv4l"; then if test $iwmmxt = "default" -a $cpu = "armv4l"; then
iwmmxt=no iwmmxt=no
...@@ -1526,6 +1540,7 @@ if test $cpu = "x86" -o $cpu = "x86_64"; then ...@@ -1526,6 +1540,7 @@ if test $cpu = "x86" -o $cpu = "x86_64"; then
echo "3DNow! Builtins $mm3dnow" echo "3DNow! Builtins $mm3dnow"
fi fi
if test $cpu = "armv4l"; then if test $cpu = "armv4l"; then
echo "ARMv5TE enabled $armv5te"
echo "IWMMXT enabled $iwmmxt" echo "IWMMXT enabled $iwmmxt"
fi fi
if test $cpu = "mips"; then if test $cpu = "mips"; then
...@@ -1711,6 +1726,10 @@ if test "$mm3dnow" = "yes" ; then ...@@ -1711,6 +1726,10 @@ if test "$mm3dnow" = "yes" ; then
echo "TARGET_BUILTIN_3DNOW=yes" >> config.mak echo "TARGET_BUILTIN_3DNOW=yes" >> config.mak
echo "#define HAVE_MM3DNOW 1" >> $TMPH echo "#define HAVE_MM3DNOW 1" >> $TMPH
fi fi
if test "$armv5te" = "yes" ; then
echo "TARGET_ARMV5TE=yes" >> config.mak
echo "#define HAVE_ARMV5TE 1" >> $TMPH
fi
if test "$iwmmxt" = "yes" ; then if test "$iwmmxt" = "yes" ; then
echo "TARGET_IWMMXT=yes" >> config.mak echo "TARGET_IWMMXT=yes" >> config.mak
echo "#define HAVE_IWMMXT 1" >> $TMPH echo "#define HAVE_IWMMXT 1" >> $TMPH
......
...@@ -27,11 +27,6 @@ ...@@ -27,11 +27,6 @@
#include "bitstream.h" #include "bitstream.h"
#include "dsputil.h" #include "dsputil.h"
/* Assume that all Intel XScale processors support armv5 edsp instructions */
#if defined(ARCH_ARMV4L) && defined (HAVE_IWMMXT)
#define ARCH_ARM5E
#endif
/* /*
* TODO: * TODO:
* - in low precision mode, use more 16 bit multiplies in synth filter * - in low precision mode, use more 16 bit multiplies in synth filter
...@@ -797,7 +792,7 @@ static inline int round_sample(int *sum) ...@@ -797,7 +792,7 @@ static inline int round_sample(int *sum)
# define MULS(ra, rb) \ # define MULS(ra, rb) \
({ int __rt; asm ("mullhw %0, %1, %2" : "=r" (__rt) : "r" (ra), "r" (rb)); __rt; }) ({ int __rt; asm ("mullhw %0, %1, %2" : "=r" (__rt) : "r" (ra), "r" (rb)); __rt; })
# elif defined(ARCH_ARM5E) # elif defined(HAVE_ARMV5TE)
/* signed 16x16 -> 32 multiply add accumulate */ /* signed 16x16 -> 32 multiply add accumulate */
# define MACS(rt, ra, rb) \ # define MACS(rt, ra, rb) \
......
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