[vlc-devel] [PATCH] yadif : Add SSSE3 and SSE2 support. porting from FFmpeg.

Naohiro KORIYAMA nkoriyama at gmail.com
Tue Dec 6 15:50:48 CET 2011

2011/12/6 Jean-Baptiste Kempf <jb at videolan.org>:
> http://pastebin.com/4uMWVbRV

I noticed the issue recently when I stated building my own win32 builds
for chasing the problem around UPnP.
Both OSX's clang and GCC don't complain  mm and xmm are in the clobber list.

GCC never allows the registers of unsupported instructions in the clobber list.
GCC with -mmmx (or -march=pentium-mmx or above), "unknown register mm"
errors disappear.
GCC with -msse (or -march=pentium3 or above), "unknown register xmm"
errors disappear.
GCC with -mtune doesn't help.

Here is the short test log on Mac OS X, native GCC vs cross mingw32 GCC.

I found a discussion about the clobber.
As a result of the discussion,
- Check whether xmm clobbers are supported in configure like:
int main()
   asm volatile( "" ::: "xmm0");
- Define a macro that put xmm registers to the clobber list only if
xmm clobbers are supported.

But for this case, I don't need to think on a large scale.
I attached the new patch.
On this patch, checking GCC's predefined macro __MMX__ and __SSE__
to detect whether mm/xmm clobbers are supported.
These macros are set when GCC can use MMX/SSE instructions.

If it's better to check it properly with C program  like the above in
configure, I can easily rewrite.

nkoriyama at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-yadif-Add-SSSE3-and-SSE2-support.-porting-from-FFmpe.patch
Type: application/octet-stream
Size: 30788 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20111206/02b5b345/attachment.obj>

More information about the vlc-devel mailing list