--- Asheesh Laroia <paulproteus@technologist.com> wrote:> Can't you write a script for ./configure that checks for this, rather > than > having the library do the check each time it's used? If not, perhaps > check /proc/cpuinfo or something. The DoIHaveSSE and DoIHave3DNow > checks > could fork() if the system provides fork(); if not, the checks would > return false. > > Couldn't you also just check for fork() in the configure script?cpu support for 3dnow and sse can be easily detected at runtime. I turned off 3dnow by default because it is implicated in some crashes. sse also requires operating system support. thanks to intel's brilliant design, the only real way to do this at flac runtime is for the library to fork() itself, run some sse instructions in the new process, and watch if it crashes. quietly forking in a library is bad since some library users may not want to fork (like if their process image is huge) for such a simple thing. you could detect at configure time, but that makes the resulting binary OK for the build machine but not for others. that's why I make it explicit with --sse-os. Josh __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com
On Wed, Nov 14, 2001 at 09:37:47AM -0800, Josh Coalson wrote:> sse also requires operating system support. thanks to intel's brilliant > design, the only real way to do this at flac runtime is for the library to > fork() itself, run some sse instructions in the new process, and watch if > it crashes. quietly forking in a library is bad since some library users > may not want to fork (like if their process image is huge) for such a > simple thing.One possible solution would be to add a FLAC API call to do the detection. That way, the client could ask for SSE autodetection (or perhaps force it on if it knows better) only when it is desired. How much are the SSE optimizations really worth, in terms of benchmarks? Is it worthwhile to try to make them available to everyone? -- - mdz
On Wed, Nov 14, 2001 at 09:37:47AM -0800, Josh Coalson wrote:> cpu support for 3dnow and sse can be easily detected at > runtime. I turned off 3dnow by default because it is > implicated in some crashes.Hmm, i never have any crash. Can i get more informations about these crases? Or you are talking about that ones posted in this list about month ago?> sse also requires operating system support. thanks to > intel's brilliant design, the only real way to do this > at flac runtime is for the library to fork() itself, > run some sse instructions in the new process, and watch > if it crashes. quietly forking in a library is bad > since some library users may not want to fork (like > if their process image is huge) for such a simple > thing.Another possible way is in using threads instead of fork/vfork (at least on UNIX systems). But linking flac with pthread library only for this stupid detection is ugly. BTW, line 394 in stream_encoder.c setting 3dnow function is still disabled. So configure --enable-use-3dnow in fact doesn't enable it. -- Miroslav Lichvar lichvarm@phoenix.inf.upol.cz
--- Miroslav Lichvar <lichvarm@phoenix.inf.upol.cz> wrote:> On Wed, Nov 14, 2001 at 09:37:47AM -0800, Josh Coalson wrote: > > cpu support for 3dnow and sse can be easily detected at > > runtime. I turned off 3dnow by default because it is > > implicated in some crashes. > > Hmm, i never have any crash. Can i get more informations about these > crases? Or you are talking about that ones posted in this list about > month ago?yes, the ones a month ago. it's not clear that this is even related to 3dnow but since it was happening on Matt's new AMD box and I don't have enough info I turned it off by default.> BTW, line 394 in stream_encoder.c setting 3dnow function is still > disabled. So configure --enable-use-3dnow in fact doesn't enable it.oops, ok, I fixed that and checked it in. I'm a little late with the release but it will be out today. Josh __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com