diff options
author | Loren Merritt <lorenm@u.washington.edu> | 2006-09-21 17:48:45 +0000 |
---|---|---|
committer | Loren Merritt <lorenm@u.washington.edu> | 2006-09-21 17:48:45 +0000 |
commit | 7e611a0e8ce978f8481531eb4f6988b19fabf5c5 (patch) | |
tree | a6ddc10fe6639240dd6d3bfeae3f02bb6861b436 /libavutil/common.h | |
parent | a4eb118a410a494aea4a9da77f84f01bf561fbce (diff) | |
download | ffmpeg-7e611a0e8ce978f8481531eb4f6988b19fabf5c5.tar.gz |
simplify asm mid_pred, as suggested by michaelni.
Originally committed as revision 6314 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/common.h')
-rw-r--r-- | libavutil/common.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/libavutil/common.h b/libavutil/common.h index c9bdd56b21..31142b9d25 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -236,18 +236,17 @@ static inline int av_log2_16bit(unsigned int v) static inline int mid_pred(int a, int b, int c) { #if (defined(ARCH_X86) && __CPU__ >= 686 || defined(ARCH_X86_64)) && !defined(RUNTIME_CPUDETECT) - int i=a, j=a; + int i=b; asm volatile( - "cmp %4, %2 \n\t" - "cmovg %4, %0 \n\t" - "cmovl %4, %1 \n\t" - "cmp %4, %3 \n\t" - "cmovg %3, %0 \n\t" + "cmp %2, %1 \n\t" + "cmovg %1, %0 \n\t" + "cmovg %2, %1 \n\t" + "cmp %3, %1 \n\t" "cmovl %3, %1 \n\t" - "cmp %3, %2 \n\t" - "cmovl %1, %0 \n\t" - :"+&r"(i), "+&r"(j) - :"r"(a), "r"(b), "r"(c) + "cmp %1, %0 \n\t" + "cmovg %1, %0 \n\t" + :"+&r"(i), "+&r"(a) + :"r"(b), "r"(c) ); return i; #elif 0 |