Hi,
I believe the way you are performing the available instruction sets on the function x86_64_cpu_info
is not correct. It fails to detect the instrunctions my CPU supports and, ironically, reports some it does not support as available.
I believe the problem lies on FLAC__cpu_info_x86. For some reason it is doing
int ext = level & 0x80000000;
__cpuid(cpuinfo, ext);
...
__cpuidex(cpuinfo, ext, 0);
__cpuid(cpuinfo, ext);
When you want to detect the available instructions one usually calls CPUID passing the value 1. And that is exactly what you do on x86_64_cpu_info. It will call FLAC__cpu_info_x86 with the value 1. But that line over there will clear that bit and will query the wrong information.
Just to be sure my OS (Windows 7 64) was not doing something fancy, I tested using my old CPU detection code and it reported the correct results. My CPU is an i7 980x, and should support everything up to SSE 4.2.
My code tells it does, libflac tells me
CPU info (x86-64):
SSE3 ....... n
SSSE3 ...... n
SSE41 ...... n
SSE42 ...... n
AVX ........ n
FMA ........ Y
AVX2 ....... n
AVX OS sup . n
Oh, how I wish it was possible to edit a previous message. But, since it isn't (or the button to perform such action is very well hidden), the corrected first paragraph should be:
I believe the way you are performing the available instruction sets detection on the function
x86_64_cpu_infois not correct. It fails to detect the instrunctions my CPU supports and, ironically, reports some it does not support as available.flac 1.3.2 release?
This was fixed in the very next commit after the release of this version.
See http://git.xiph.org/?p=flac.git;a=commitdiff;h=230cffe08ff0c965de2ce111afe4513286bfda89