[FFmpeg-devel] [libav-commits] checkasm: add fmtconvert tests

Janne Grunau janne-libav at jannau.net
Tue Dec 22 17:41:27 CET 2015

On 2015-12-21 19:06:15 +0100, Janne Grunau  wrote:
> Module: libav
> Branch: master
> Commit: 489e6add4478b0f5717dbf644234c6f3a3baf02c
> Author:    Janne Grunau <janne-libav at jannau.net>
> Committer: Janne Grunau <janne-libav at jannau.net>
> Date:      Tue Dec  8 16:24:57 2015 +0100
> checkasm: add fmtconvert tests

This test fails unfortunately under valgrind but only under valgrind.  
Besides all the fate configs which are probably recent Intel CPUs I 
tested it also on a Core 2 Duo and an AMD K8 (the two oldest CPU I have 
available). My checkasm emms check is triggered under valgrind by 
'cvtpi2ps xmm1 mem64'. Valgrind does a x87 FPU to MMX state transition 
which all tested CPUs don't do. According to the current "IntelĀ® 64 and 
IA-32 Architectures Software Developer's Manual Volume 2" from September 
2015 valgrinds behaviour is correct. But I think it is actually a bug in 
the documentation.

I found HTML copy from 1999 of Intel's manual(1) which says that 
cvtpi2ps with a memory location as source doesn't cause a transition to 
MMX state. The current documentation for cvtpi2pd (packed int to packed 
double conversion) says the same. Valgrind wasn't following that that 
until Vitor reported it as #210264(2) in 2009 and it was fixed in (3).  
As Julian Seward says in the commit message the situation is a little 
bit fishy.

I don't see a reason why the instruction should clobber mmx/fpu 
registers so I think it's probably a bug in the documentation (and 
valgrind). Since it will take a while to get fixed valgrind binaries on 
all fate hosts, I'd like to hide this failure temporarily by annotating 
the SSE versions of int32_to_float_fmul_scalar and 
int32_to_float_fmul_array8 as requiring an emms.


(2): https://bugs.kde.org/show_bug.cgi?id=210264
(3): http://sourceforge.net/p/valgrind/mailman/message/24606437/

More information about the ffmpeg-devel mailing list