Motion - Bug Report 2005x 03x 23x 203016

BUG: Illegal Instruction

BugReport2005x01x30x190907 did not fix the compilation issue on certain VIA processors. When compiling for VIA Samuel 2, Ezra, Ezra T architectures the correct setting is "-march=c3". Note that other VIA architectures are not affected.

Using --without-optimizecpu solves the problem, but does not generate optimized code for these particular architectures. In particular, I'm pretty sure the mmx code is not built, as the target is a generic i386. When compiling with "-march=c3", __MMX__ is defined by gcc and should include those instructions.

The following information is taken from, which is down right now (I copied the Google cache):

13.2. Is the C3 Pentium compatible?

Yes. But Samuel 2, Ezra, Ezra T C3 processors have a problem with the cmpxchg8b (i.e. CMOV) opcode. Nehemiah and Antaur processors are not affected.

The identification issue is that the C3 is identifying itself as 686. According to the Intel IA32 documentation, this is correct: C3 does not implement conditional moves*, and do not pretend to implement conditional moves. The Intel documentation states that you should check before doing conditional moves, and that cmov implementation in the processor is optional. The GNU compiler people have assumed that all 686's implement cmov's, so code compiled for the i686 architecture may not execute on the C3. Code generated by GCC does not check for these optional features as the intel documentation says you should. When downloading binaries for the C3, don't go higher than the i586 level. When building, you may want to target the 586 or even the 486, because of the way the C3 is built internally: It's not an athlon, more like a 486-586 cross.

Test case

Running configure for both cases:
$ ./configure
Detected CPU: VIA Samuel 2
CPU optimization: -march=i686

$ ./configure --without-optimizecpu
<no detection, of course>


Motion version: 3.1.19, 3.2.1
ffmpeg version: N/A
Shared libraries: mysql, postgresql
Server OS: Debian GNU/Linux 3.1, kernel 2.6.8

-- ChristopherPrice - 23 Mar 2005

Follow up

Great info Christopher !

Please could you post the output from cat /proc/cpuinfo ?


-- AngelCarpintero - 28 Mar 2005

Sure, here's the output of a VIA C3 Eden (Samuel) based system. Unfortunately, I no longer have an Ezra based system so cannot provide that information.

cprice@cordie:~$ cat /proc/cpuinfo                                            
processor       : 0
vendor_id       : CentaurHauls
cpu family      : 6
model           : 7
model name      : VIA Samuel 2
stepping        : 3
cpu MHz         : 599.978
cache size      : 64 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu de tsc msr cx8 mtrr pge mmx pni 3dnow
bogomips        : 1187.84

-- ChristopherPrice - 28 Mar 2005

I have no chance to do anything on this one since I do not have such a machine. If noone will come forward with help I will have to reject it or put it in monitor or invent a new category.

-- KennethLavrsen - 11 Jul 2005

Fix record

No response from reporter or owners of this type of Mobo. Re-open if any of you wants this worked on again.

Remember that you can compile with --without-optimizecpu and get Motion working.

-- KennethLavrsen - 19 Jul 2005
Topic revision: r5 - 19 Jul 2005, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.