libFLAC for Windows compiled with GCC/MinGW can't detect SSE OS support: it can't use GCC+Linux detection code and can't use MSVC+Win32 code that uses SEH (__try/__except). So it doesn't use any SSE/SSE2/etc routines. One way to fix it is to call configure script with --enable-sse (flac will probably crash on Win95/WinNT4 but who cares). Another way is to add a new code just for GCC+Win32 case. The patch is attached. ...One thing that worries me is the comment in cpu.c: /* sigill_handler flavor resulted in several crash reports on win32 */ but the corresponding ticket #307 ( http://sourceforge.net/p/flac/bugs/307/ ) doesn't reveal any details. -------------- next part -------------- A non-text attachment was scrubbed... Name: cpu_gcc_win32.patch Type: application/octet-stream Size: 3350 bytes Desc: not available Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20140310/347f5521/attachment.obj
Olivier Tristan
2014-Mar-11 14:57 UTC
[flac-dev] PATCH: OS SSE support detection for GCC on Windows
Le 09/03/2014 22:26, lvqcl a ?crit :> libFLAC for Windows compiled with GCC/MinGW can't detect SSE OS support: > it can't use GCC+Linux detection code and can't use MSVC+Win32 code that > uses SEH (__try/__except). So it doesn't use any SSE/SSE2/etc routines. > > One way to fix it is to call configure script with --enable-sse > (flac will probably crash on Win95/WinNT4 but who cares). > > Another way is to add a new code just for GCC+Win32 case. > The patch is attached.I may say something stupid but is this helpful ? http://stackoverflow.com/questions/6121792/how-to-check-if-a-cpu-supports-the-sse3-instruction-set -- Olivier TRISTAN uvi.net
Martijn van Beurden
2014-Mar-11 18:03 UTC
[flac-dev] PATCH: OS SSE support detection for GCC on Windows
op 11-03-14 15:57, Olivier Tristan schreef:> I may say something stupid but is this helpful ? > http://stackoverflow.com/questions/6121792/how-to-check-if-a-cpu-supports-the-sse3-instruction-setThat question on stackoverflow is about CPU support, the patch you replied to was about OS support. Because of the registers used (which must be saved and restored on a context switch), the OS must support a certain instruction set or the program will crash. AFAIK the detection of those things is unrelated. op 09-03-14 22:26, lvqcl schreef:> One way to fix it is to call configure script with --enable-sse > (flac will probably crash on Win95/WinNT4 but who cares).FLAC already wasn't working on Windows 98 and older because of the UTF-8 implementation that was merged for flac 1.3.0, so no one will care I guess.