Apparently Windows 7 without SP1 has O/S support for XSAVE but not for
YMM registers, and this exposed a bug in our usage of xgetbv. The test
instruction will set ZF only if none of the bits match between the two
operarands, so in effect, we were enabling AVX2 instructions if the O/S
supported XSAVE and the CPU supported AVX2 but the O/S only supported
XMM registers. This bug was not exposed on, for instance, Windows XP or
RHEL 5 because those O/S's do not support XSAVE.
Fixes #288
if the soft float ABI is enabled. Those functions use instructions that are
incompatible with the soft float ABI.
+3. Fixed an issue in the SIMD feature detection code that caused libjpeg-turbo
+to crash on Windows 7 if Service Pack 1 was not installed.
+
2.0.0
=====
xor ecx, ecx
xgetbv
- test eax, 6 ; O/S does not manage XMM/YMM state
+ and eax, 6
+ cmp eax, 6 ; O/S does not manage XMM/YMM state
; using XSAVE
- jz short .no_avx2
+ jnz short .no_avx2
or edi, JSIMD_AVX2
.no_avx2:
xor rcx, rcx
xgetbv
- test rax, 6 ; O/S does not manage XMM/YMM state
+ and rax, 6
+ cmp rax, 6 ; O/S does not manage XMM/YMM state
; using XSAVE
- jz short .return
+ jnz short .return
or rdi, JSIMD_AVX2