[flac-dev] [PATCH] simplify OS SSE support detection

lvqcl lvqcl.mail at gmail.com
Sun Jul 27 05:11:52 PDT 2014


This patch tries to simplify the code that tries to detect
whether OS supports SSE instructions.


a) Linux: "old" vs "new" sigaction

OBSOLETE_SIGCONTEXT_FLAVOR was disabled in Mar 2007 in commit
<http://git.xiph.org/?p=flac.git;a=commit;h=1ca3a445f832be5e8a99364fb38d9e2ea9a3a772>
According to <http://unixhelp.ed.ac.uk/CGI/man-cgi?sigaction>:
"Support for SA_SIGINFO was added in Linux 2.2" (released in Jan 1999).
If noone wants to use FLAC with Linux kernel 2.0 then it's safe to
delete this code.


b) MSVC: try/catch vs. sigill_handler

TRY_CATCH_FLAVOR was enabled in Jan 2009 in commit
<http://git.xiph.org/?p=flac.git;a=commit;h=a832ef32fb2a888674659097f40c1f8efb72c1a4>
According to the comment in cpu.c, "sigill_handler flavor resulted in
several crash reports on win32". Also this sigill_handler flavor is not thread-safe.


c) MinGW: fxsave/fxrestore vs. sigill_handler

The code was added Mar 2014 in commit
<http://git.xiph.org/?p=flac.git;a=commit;h=99d5154f436b389758d6a9020e448b8dbedb14bc>
It's better to use FXSR flavor instead of sigill_handler flavor. The reasons
are the same as for MSVC.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpu_sse_os.patch
Type: application/octet-stream
Size: 5767 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20140727/9580c777/attachment.obj 


More information about the flac-dev mailing list