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 disables -msse2 switch. Maybe it makes sense to add new switch, --no-force-sse2 or --disable-force-sse2 or similar? And replace if test "x$asm_optimisation$sse_os" = "xyesyes" ; then XIPH_ADD_CFLAGS([-msse2]) fi with if test "x$force_sse2" = "xyes" ; then XIPH_ADD_CFLAGS([-msse2]) fi ?
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 cuch CPUs only because it disables -msse2 switch. > > Maybe it makes sense to add new switch, --no-force-sse2 or > --disable-force-sse2 or similar? And replace > > if test "x$asm_optimisation$sse_os" = "xyesyes" ; then > XIPH_ADD_CFLAGS([-msse2]) > fi > > with > > if test "x$force_sse2" = "xyes" ; then > XIPH_ADD_CFLAGS([-msse2]) > fiNo, what is needed is a way to disable SSE at run time even if it has been compiled in at build time. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
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 disable all intrinsics for GCC 4.8 and older (and afaik for clang): only if a file was compiled with -msse option then sse intrinsics are allowed. -msse2 enables sse and sse2 intrinsics, and so on. The common way is to compile different files with different options. For libFLAC it means that all *_sse.c files should be compiled with -msse switch, all *_sse2.c files should be compiled with -msse2, and so on. But unfortunately it's not supported in the current build system. OTOH, GCC 4.9 (and newer) doesn't require those switches: now it's possible to set supported instruction set on a per-function basis. That's what libFLAC does with FLAC__SSE_TARGET(x) macro.