Discussion:
x86: Remove some legacy CPU detection hacks
(too old to reply)
Henrik Gramner
2017-12-25 19:40:01 UTC
Permalink
x264 | branch: master | Henrik Gramner <***@gramner.com> | Wed Oct 11 18:02:26 2017 +0200| [344699fd386890ac1cf80a70a68a3ae16767ed62] | committer: Anton Mitrofanov

x86: Remove some legacy CPU detection hacks

Some ancient Pentium-M and Core 1 CPU:s had slow SSE units, and using MMX
was preferable. Nowadays many assembly functions in x264 completely lack MMX
implementations and falling back to C code will likely make things worse.

Some misconfigured virtualized systems could sometimes also trigger this code
path and cause assertions.
http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=344699fd386890ac1cf80a70a68a3ae16767ed62
---

common/cpu.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/common/cpu.c b/common/cpu.c
index fc233b62..516c3c8e 100644
--- a/common/cpu.c
+++ b/common/cpu.c
@@ -235,16 +235,8 @@ uint32_t x264_cpu_detect( void )
int model = ((eax>>4)&0xf) + ((eax>>12)&0xf0);
if( family == 6 )
{
- /* 6/9 (pentium-m "banias"), 6/13 (pentium-m "dothan"), and 6/14 (core1 "yonah")
- * theoretically support sse2, but it's significantly slower than mmx for
- * almost all of x264's functions, so let's just pretend they don't. */
- if( model == 9 || model == 13 || model == 14 )
- {
- cpu &= ~(X264_CPU_SSE2|X264_CPU_SSE3);
- assert(!(cpu&(X264_CPU_SSSE3|X264_CPU_SSE4)));
- }
/* Detect Atom CPU */
- else if( model == 28 )
+ if( model == 28 )
{
cpu |= X264_CPU_SLOW_ATOM;
cpu |= X264_CPU_SLOW_PSHUFB;

Loading...