Diego Biurrun <[email protected]> writes:

> There are two capabilities that are interesting in this context:
>
> a) cpu
> b) compiler
> c) assembler
>
> Our current HAVE_FOO macros indicate a mix of everything.  It seems to
> be the time to separate the capabilities.  So first off, do we need all
> three capabilities separately or do we just need to separate compiler
> from assembler capabilities or ...?

I'd like to put that a bit differently.  For each optimised function F
using CPU feature C, to build it requires two things:

1) the tool used to compile the language of F supports C
2) the user has not disabled C

The CPU itself is checked at runtime.

The problem at hand is that we have two tools (compiler and yasm) but
only one capability check.  Assuming we want to allow disabling CPU
features through configure, the obvious scheme looks something like
this:

amd3dnow_deps="mmx"
amd3dnowext_deps="amd3dnow"
mmx_deps="x86"
mmx2_deps="mmx"
sse_deps="mmx"
sse2_deps="sse"     # new
sse3_deps="sse2"    # new
ssse3_deps="sse3"   # changed
sse4_deps="ssse3"   # new
sse42_deps="sse4"   # new
avx_deps="sse42"    # new
fma4_deps="avx"

inline_mmx_deps="inline_asm mmx"
inline_sse_deps="inline_mmx"
# etc

yasm_mmx_deps="yasm mmx"
yasm_sse_deps="yasm_mmx"
# etc

Then set inline_foo and yasm_foo according to tests in configure.  Some
of them can perhaps be removed if they can be safely assumed supported.
In the source code, use only HAVE_{INLINE,YASM}_FOO.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to