Re: [flac-dev] FLAC__SSE_OS change

2016-06-28 Thread lvqcl
Erik de Castro Lopo wrote: No, what is needed is a way to disable SSE at run time even if it has been compiled in at build time. It's not possible if ALL flac/libFLAC files are built with -msse2 option. So the only solution is to remove -msse2 option from configure.ac. Unfortunately it will d

Re: [flac-dev] FLAC__SSE_OS change

2016-06-28 Thread Erik de Castro Lopo
lvqcl wrote: > Thomas Zander wrote: > > > In any case, the disable-SSE matter is still important. People are > > still using flac on x86 machines without SSE, for instance AMD Geode > > CPUs seem to live forever. > > libFLAC detects CPU SSE support in runtime, so --disable-sse is > necessary for

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread lvqcl
Thomas Zander wrote: In any case, the disable-SSE matter is still important. People are still using flac on x86 machines without SSE, for instance AMD Geode CPUs seem to live forever. libFLAC detects CPU SSE support in runtime, so --disable-sse is necessary for cuch CPUs only because it disabl

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread Erik de Castro Lopo
lvqcl wrote: > MSVC 2005 win32: OK > MSVC 2010 win32: OK > MSVC 2015 win32: OK > MSVC 2010 x64: failed > MSVC 2015 x64: failed > > error C4235: nonstandard extension used: '__asm' keyword not supported on > this architecture > > MSVC doesn't support inline asm for x86_64 code. That's why it > c

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread Thomas Zander
On 26 June 2016 at 10:17, Erik de Castro Lopo wrote: > For OS support, I'm not sure. Didn't later version of SSE add new > registers? No, SSE instructions operate on XMM0-8 on i386 and XMM0-15 on amd64, respectively. Register width was increased to 256 bit with the introduction of AVX (YMM0-8 on

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread lvqcl
Erik de Castro Lopo wrote: Ok, I think I've fixed it in: commit a08e90c425343630d820b8775d5a2a63a02689ee Author: Erik de Castro Lopo Date: Sun Jun 26 21:09:08 2016 +1000 libFLAC/cpu.c: Fixes for MSVC Please test. MSVC 2005 win32: OK MSVC 2010 win32: OK MSVC 2015 win3

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread lvqcl
Erik de Castro Lopo wrote: lvqcl wrote: No, MSVC 2015 is also affected. I renamed __cpuid() to __cpuid22(), I thought the original problem was with `___cpuidex`, not `__cpuid`! VC2005 generates code that uses __cpuid() because VC2005 has no __cpuidex(). VC2015 generates code that uses __

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread Erik de Castro Lopo
lvqcl wrote: > No, FLAC__AVX_SUPPORTED is 0 (initially it's undefined, then inside cpu.h > it's defined as 0). > > MSVC cannot discard unused references in debug builds and when LTCG is on, > for example: > > > And currentl

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread Erik de Castro Lopo
lvqcl wrote: > No, MSVC 2015 is also affected. I renamed __cpuid() to __cpuid22(), I thought the original problem was with `___cpuidex`, not `__cpuid`! Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ _

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread lvqcl
Erik de Castro Lopo wrote: The question is, what to do with the debug configuration. Is this only a problem with MSVS2005? No, MSVC 2015 is also affected. I renamed __cpuid() to __cpuid22(), and it wrote: error LNK2019: unresolved external symbol ___cpuid22 referenced in function _FLAC__

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread Erik de Castro Lopo
lvqcl wrote: > Sure. > > The question is, what to do with the debug configuration. Is this only a problem with MSVS2005? If so, I'd be inclined to jsut drop support for it. Its over 10 years old and aren't there free versions of more recent MSVCs available? Erik -- --

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread lvqcl
Erik de Castro Lopo wrote: MSVC cannot discard unused references in debug builds and when LTCG is on, for example: And currently LTCG is enabled for release builds. Ok, thats a problem. A large chunk of the cleanup I was

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread Erik de Castro Lopo
lvqcl wrote: > No, FLAC__AVX_SUPPORTED is 0 (initially it's undefined, then inside cpu.h > it's defined as 0). > > MSVC cannot discard unused references in debug builds and when LTCG is on, > for example: > > > And currentl

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread Erik de Castro Lopo
Erik de Castro Lopo wrote: > That suggests that FLAC__AVX_SUPPORTED is true. Can you set it to false > for MSVC2005? Maybe we need something like: #if defined _MSC_VER && _MSC_VER < X #undef FLAC__AVX_SUPPORTED #define FLAC__AVX_SUPPORTED 0 #endif You need to provide me with

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread lvqcl
Erik de Castro Lopo wrote: lvqcl wrote: error LNK2019: unresolved external symbol ___cpuidex referenced in function _FLAC__cpu_info_x86 libflac_static.lib fatal error LNK1120: 1 unresolved externals flac.exe The code if (FLAC__AVX_SUPPORTED) __cpuidex(cpuinfo, level, 0); /

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread Erik de Castro Lopo
lvqcl wrote: > Dave Yeo wrote: > > >>> >on other OSes: > >>> > --enable-sse: > >>> > add -msse2 to the compiler switches > >>> > test SSE OS support (why?) > > >>> >It's a bit contradictory: why test whether *BSD etc support SSE or not > >>> >but at the same time allow co

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread lvqcl
Dave Yeo wrote: >on other OSes: > --enable-sse: > add -msse2 to the compiler switches > test SSE OS support (why?) >It's a bit contradictory: why test whether *BSD etc support SSE or not >but at the same time allow compiler to use SSE/SSE2 unconditionally? Yes, that n

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread Erik de Castro Lopo
lvqcl wrote: > It doesn't know about uint32_t type, so the definition of cpu_xgetbv_x86() > fails. > It can be fixed by adding "#include share/compat.h" to cpu.c (or by using > FLAC__uint32 from FLAC/ordinals.h). Ok, added share/compat.h. > When I fix this, the following problem occurs: > > er

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread lvqcl
Erik de Castro Lopo wrote: MSVC 2015: builds OK. Great. Thanks. The current code builds OK on MSVC 2015 and 2010 but not on MSVC 2005: error C2059: syntax error : ';' cpu.c 153 error C2059: syntax error : 'type' cpu.c 153 error C2061: syntax error : identifier 'cpu_xgetbv_x86' cpu.

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread Erik de Castro Lopo
Dave Yeo wrote: > Doesn't SSE support imply SSE2+ support? Not for the CPU. Just because a CPU supports SSE, does not mean it is guaranteed to support SSE2+. For OS support, I'm not sure. Didn't later version of SSE add new registers? > I have a '96 install of an OS, it has been upgraded until

Re: [flac-dev] FLAC__SSE_OS change

2016-06-26 Thread Dave Yeo
On 06/25/16 10:43 PM, Erik de Castro Lopo wrote: First off, this code is horrible to read and work on. The recent commits are the first of what I hope is a massive clean up of this code. lvqcl wrote: >So if I understand things correctly, the current meaning of --(en|dis)able-sse is: > >on Lin

Re: [flac-dev] FLAC__SSE_OS change

2016-06-25 Thread Erik de Castro Lopo
First off, this code is horrible to read and work on. The recent commits are the first of what I hope is a massive clean up of this code. lvqcl wrote: > So if I understand things correctly, the current meaning of > --(en|dis)able-sse is: > > on Linux: > --enable-sse: > add -msse2

Re: [flac-dev] FLAC__SSE_OS change

2016-06-25 Thread lvqcl
yErik de Castro Lopo wrote: I think I've fixed both those in: commit 23778a3a6018f5dcb5fc1ad6ac97ad8391afc69d Author: Erik de Castro Lopo Date: Sat Jun 25 17:02:06 2016 +1000 libFLAC/cpu.c: More pre-processor cleanups I've tested on this in x86, x86_64, powerpc and arm

Re: [flac-dev] FLAC__SSE_OS change

2016-06-25 Thread Erik de Castro Lopo
lvqcl wrote: > 1) if FLAC__SSE_OS==1 then MSVC cannot compile current cpu.c: > "#include " line is inactive and MSVC complains: > cpu.c(278): error C2065: 'EXCEPTION_EXECUTE_HANDLER': undeclared identifier > cpu.c(279): error C2065: 'STATUS_ILLEGAL_INSTRUCTION': undeclared identifier > > 2) the c

Re: [flac-dev] FLAC__SSE_OS change

2016-06-23 Thread lvqcl
Martin Leese wrote: lvqcl wrote: ... P.S. I wonder what's the point to test OS SSE support in 2016? I believe that users of Windows 95 and Windows NT4 don't expect new software to work on their OSes. I do (although I am often disappointed). There are developers that still support such OSe

Re: [flac-dev] FLAC__SSE_OS change

2016-06-23 Thread lvqcl
lvqcl wrote: Erik de Castro Lopo wrote: I actually think my change is correct. It should be easier to see if you look at the github version of the change: https://github.com/xiph/flac/commit/e120037f3c67b23fd9eef7ccd04d2df57fa1a9a6#diff-9f048b83ff55071de36263cf0f403b2eL209 P.P.S. 1)

Re: [flac-dev] FLAC__SSE_OS change

2016-06-22 Thread Martin Leese
lvqcl wrote: ... > P.S. I wonder what's the point to test OS SSE support in 2016? I believe > that > users of Windows 95 and Windows NT4 don't expect new software to work on > their > OSes. I do (although I am often disappointed). Regards, Martin -- Martin J Leese E-mail: martin.leese stanforda

Re: [flac-dev] FLAC__SSE_OS change

2016-06-21 Thread lvqcl
Erik de Castro Lopo wrote: I actually think my change is correct. It should be easier to see if you look at the github version of the change: https://github.com/xiph/flac/commit/e120037f3c67b23fd9eef7ccd04d2df57fa1a9a6#diff-9f048b83ff55071de36263cf0f403b2eL209 FLAC__NO_SSE_OS was never

Re: [flac-dev] FLAC__SSE_OS change

2016-06-21 Thread Erik de Castro Lopo
lvqcl wrote: > About the commit > > > I admit I don't understand the following lines: > > #if !FLAC__SSE_OS > /* assume user knows better than us; turn it off */ > disable_sse(info); >

[flac-dev] FLAC__SSE_OS change

2016-06-20 Thread lvqcl
About the commit I admit I don't understand the following lines: #if !FLAC__SSE_OS /* assume user knows better than us; turn it off */ disable_sse(info); #elif defined(__FreeBSD__) || def