Revision b7195837

View differences:

libavutil/x86/cpu.c
109 109
            rval |= AV_CPU_FLAG_MMX;
110 110
        if (ext_caps & (1<<22))
111 111
            rval |= AV_CPU_FLAG_MMX2;
112

  
113
        /* Allow for selectively disabling SSE2 functions on AMD processors
114
           with SSE2 support but not SSE4a. This includes Athlon64, some
115
           Opteron, and some Sempron processors. MMX, SSE, or 3DNow! are faster
116
           than SSE2 often enough to utilize this special-case flag.
117
           AV_CPU_FLAG_SSE2 and AV_CPU_FLAG_SSE2SLOW are both set in this case
118
           so that SSE2 is used unless explicitly disabled by checking
119
           AV_CPU_FLAG_SSE2SLOW. */
120
        if (!strncmp(vendor.c, "AuthenticAMD", 12) &&
121
            rval & AV_CPU_FLAG_SSE2 && !(ecx & 0x00000040)) {
122
            rval |= AV_CPU_FLAG_SSE2SLOW;
123
        }
112 124
    }
113 125

  
114 126
    if (!strncmp(vendor.c, "GenuineIntel", 12) &&
115 127
        family == 6 && (model == 9 || model == 13 || model == 14)) {
116 128
        /* 6/9 (pentium-m "banias"), 6/13 (pentium-m "dothan"), and 6/14 (core1 "yonah")
117 129
         * theoretically support sse2, but it's usually slower than mmx,
118
         * so let's just pretend they don't. */
130
         * so let's just pretend they don't. AV_CPU_FLAG_SSE2 is disabled and
131
         * AV_CPU_FLAG_SSE2SLOW is enabled so that SSE2 is not used unless
132
         * explicitly enabled by checking AV_CPU_FLAG_SSE2SLOW. The same
133
         * situation applies for AV_CPU_FLAG_SSE3 and AV_CPU_FLAG_SSE3SLOW. */
119 134
        if (rval & AV_CPU_FLAG_SSE2) rval ^= AV_CPU_FLAG_SSE2SLOW|AV_CPU_FLAG_SSE2;
120 135
        if (rval & AV_CPU_FLAG_SSE3) rval ^= AV_CPU_FLAG_SSE3SLOW|AV_CPU_FLAG_SSE3;
121 136
    }

Also available in: Unified diff