Erik de Castro Lopo
2016-Jun-28 21:28 UTC
[flac-dev] Please test more libFLAC/cpu.c changes
lvqcl wrote:> Found a bug in Android OS SSE test.Sorry, what is the bug and how does this fix it? Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Erik de Castro Lopo wrote:>> Found a bug in Android OS SSE test. > > Sorry, what is the bug and how does this fix it?FLAC__cpu_info(FLAC__CPUInfo *info): detects CPU features that can be used and sets corresponding flags in the info struct. Feature detection algorithm for x86 arch: step 1: clear all flags (via memset(info, 0, ...) call) step 2: test if cpuid is available. If not, return. step 3: call cpuid, determine available CPU features and set corresponding flags to 1. step 4: test OS SSE support. If the OS doesn't support SSE (or if such test isn't possible) then set all sseN flags to 0. step 5: test OS AVX support. If the OS doesn't support AVX then set all avxN flags to 0. (currently there's some discrepancy: if FLAC__SSE_OS==1 then step 4 is skipped on Linux, and only on Linux) If the target OS is Android then step 4 can be skipped because all versions of Android for x86 support SSE. But the current code skips everything after the 1st step! All flags in the info struct are unset, and all accelerated functions are disabled. After my patch only the step 4 is skipped for Android, as it should be. And for x86-64 arch, there's no need in steps 2 and 4, for all CPUs and OSes.
Erik de Castro Lopo
2016-Jun-30 08:43 UTC
[flac-dev] Please test more libFLAC/cpu.c changes
lvqcl wrote:> Erik de Castro Lopo wrote: > > >> Found a bug in Android OS SSE test. > > > > Sorry, what is the bug and how does this fix it? > > FLAC__cpu_info(FLAC__CPUInfo *info): detects CPU features > that can be used and sets corresponding flags in the info > struct.This code is in flux and in the current state the logic probably has inconsistencies that will be fixed in due course. What I am very much more interested in is if the code in the wip/cpu branch currently compiles and passes the test on Windows with MSVS. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/