1. Overview of found issues --------------------------- 1.1 missing "memory" clobber (x 8) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Memory keyword is missing breaking data dependencies. Every operation initializing memory blocks pointed by the input pointers can be discarded. Every read of those blocks may return the same value as before the chunk was executed. 1.2 xmm registers are clobbered (x 2) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ xmm registers are not declared in clobbers (wherease other chunks using XMM register have listed them in clobbers). 1.3 mmx registers are clobbered (x56) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mmx registers are never listed in clobbers. 1.4 inter-chunk dependency with mmx register (x 23) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Some mmx registers are initialized by a chunk and used by another. Even if the chunk are volatile and contiguous in the sources, the compiler is still able to insert some instructions between them. 1.5 static symbols are hard written in assembly (x 27) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Some static const values are accessed by name in the chunk without being stated in the interface. The risk here is that the compiler deem the value as never used and get rid of it. If so, the compilation will fail so, not a "big" issue but a bad practice. 2. Proposed patches (x 3 functions) ------------------- Refactor assembly chunk contained in: - libavcodec/x86/lossless_videoencdsp_init.c - libavcodec/x86/rnd_template.c Following GNU inline assembly guidelines, the patch: - add missing MMX clobbers - replace positional placeholder (%[0-9]) by symbolic names - replace volatile keyword and "memory" clobber by corresponding i/o entries - replace register clobbering (ex: FF_REG_a) by scratch registers - refine some macros - [Cosmetic] mnemonic alignment [build] HAVE_MMX_CLOBBERS have been added to configure following the XMM scheme --- configure | 3 + libavcodec/x86/hpeldsp_init.c | 8 + libavcodec/x86/inline_asm.h | 30 ++- libavcodec/x86/lossless_videoencdsp_init.c | 55 ++-- libavcodec/x86/rnd_template.c | 282 +++++++++++---------- libavutil/x86/asm.h | 20 ++ 6 files changed, 231 insertions(+), 167 deletions(-)