Revision 199436b9 libavcodec/x86/mathops.h

View differences:

libavcodec/x86/mathops.h
22 22
#ifndef AVCODEC_X86_MATHOPS_H
23 23
#define AVCODEC_X86_MATHOPS_H
24 24

  
25
#include "config.h"
26
#include "libavutil/common.h"
27

  
25 28
#define MULL(ra, rb, shift) \
26 29
        ({ int rt, dummy; __asm__ (\
27 30
            "imull %3               \n\t"\
......
40 43
     __asm__ ("imull %2\n\t" : "=A"(rt) : "a" ((int)ra), "g" ((int)rb));\
41 44
     rt; })
42 45

  
46
#if HAVE_CMOV
47
/* median of 3 */
48
#define mid_pred mid_pred
49
static inline av_const int mid_pred(int a, int b, int c)
50
{
51
    int i=b;
52
    __asm__ volatile(
53
        "cmp    %2, %1 \n\t"
54
        "cmovg  %1, %0 \n\t"
55
        "cmovg  %2, %1 \n\t"
56
        "cmp    %3, %1 \n\t"
57
        "cmovl  %3, %1 \n\t"
58
        "cmp    %1, %0 \n\t"
59
        "cmovg  %1, %0 \n\t"
60
        :"+&r"(i), "+&r"(a)
61
        :"r"(b), "r"(c)
62
    );
63
    return i;
64
}
65
#endif
66

  
43 67
#endif /* AVCODEC_X86_MATHOPS_H */

Also available in: Unified diff