ARM: optimised mid_pred()

Originally committed as revision 16819 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2009-01-27 16:06:38 +00:00
parent 1214bd86dc
commit 4f928a4d2d
1 changed files with 18 additions and 0 deletions

View File

@ -90,4 +90,22 @@ static inline av_const MUL16(int ra, int rb)
#endif
#define mid_pred mid_pred
static inline av_const int mid_pred(int a, int b, int c)
{
int m;
__asm__ volatile (
"mov %0, %2 \n\t"
"cmp %1, %2 \n\t"
"movgt %0, %1 \n\t"
"movgt %1, %2 \n\t"
"cmp %1, %3 \n\t"
"movle %1, %3 \n\t"
"cmp %0, %1 \n\t"
"movgt %0, %1 \n\t"
: "=&r"(m), "+r"(a)
: "r"(b), "r"(c));
return m;
}
#endif /* AVCODEC_ARM_MATHOPS_H */