---

So here's an RFC for solving finicky issues when inline and standalone
assemblers have different capabilities.  It implements the idea Mans
proposed last month.

Note that this is a draft and I am now tired, but the general idea
should be sound.  I did some basic tests; both inline and yasm checks
disable extensions as expected.  Passing --disable-foo on the configure
command line disables both inline and yasm for foo and up.

issues that will need to be addressed eventually:
- this is just the infrastructure, no code changes yet
- new options exposed on the command line
- several implementation warts remain

 configure |   77 ++++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 61 insertions(+), 16 deletions(-)

diff --git a/configure b/configure
index 052b51a..c9554ee 100755
--- a/configure
+++ b/configure
@@ -664,8 +664,8 @@ check_inline_asm(){
     name="$1"
     code="$2"
     shift 2
-    disable $name
-    check_as "$@" <<EOF && enable $name
+    disable inline_${name}
+    check_as "$@" <<EOF && enable inline_${name}
 void foo(void){ __asm__ volatile($code); }
 EOF
 }
@@ -1048,26 +1048,39 @@ ARCH_LIST='
     x86_64
 '
 
-ARCH_EXT_LIST='
-    altivec
+ARCH_EXT_LIST_X86='
     amd3dnow
     amd3dnowext
+    avx
+    fma4
+    mmx
+    mmxext
+    sse
+    sse2
+    sse3
+    sse4
+    sse42
+    ssse3
+'
+
+ARCH_EXT_LIST_X86_INLINE=$(map "echo inline_\${v}"  $ARCH_EXT_LIST_X86)
+ARCH_EXT_LIST_X86_YASM=$(map "echo yasm_\${v}"  $ARCH_EXT_LIST_X86)
+
+ARCH_EXT_LIST="
+    $ARCH_EXT_LIST_X86
+    $ARCH_EXT_LIST_X86_INLINE
+    $ARCH_EXT_LIST_X86_YASM
+    altivec
     armv5te
     armv6
     armv6t2
     armvfp
-    avx
-    fma4
     mmi
-    mmx
-    mmxext
     neon
     ppc4xx
-    sse
-    ssse3
     vfpv3
     vis
-'
+"
 
 HAVE_LIST_PUB='
     bigendian
@@ -1318,15 +1331,47 @@ ppc4xx_deps="ppc"
 vis_deps="sparc"
 
 x86_64_suggest="cmov fast_cmov"
+
 amd3dnow_deps="mmx"
 amd3dnowext_deps="amd3dnow"
 mmx_deps="x86"
 mmxext_deps="mmx"
-sse_deps="mmx"
-ssse3_deps="sse"
-avx_deps="ssse3"
+sse_deps="mmxext"
+sse2_deps="sse"
+sse3_deps="sse2"
+ssse3_deps="sse3"
+sse4_deps="ssse3"
+sse42_deps="sse4"
+avx_deps="sse42"
 fma4_deps="avx"
 
+inline_amd3dnow_deps="inline_mmx amd3dnow"
+inline_amd3dnowext_deps="inline_amd3dnow amd3dnowext"
+inline_mmx_deps="inline_asm mmx"
+inline_mmxext_deps="inline_mmx mmxext"
+inline_sse_deps="inline_mmxext sse"
+inline_sse2_deps="inline_sse sse2"
+inline_sse3_deps="inline_sse2 sse3"
+inline_ssse3_deps="inline_sse3 ssse3"
+inline_sse4_deps="inline_ssse3 sse4"
+inline_sse42_deps="inline_sse4 sse42"
+inline_avx_deps="inline_sse42 avx"
+inline_fma4_deps="inline_avx fma4"
+
+yasm_amd3dnow_deps="yasm_mmx amd3dnow"
+yasm_amd3dnowext_deps="yasm_amd3dnow amd3dnowext"
+yasm_mmx_deps="yasm mmx"
+yasm_mmxext_deps="yasm_mmx mmxext"
+yasm_sse_deps="yasm_mmxext sse"
+yasm_sse2_deps="yasm_sse sse2"
+yasm_sse3_deps="yasm_sse2 sse3"
+yasm_ssse3_deps="yasm_sse3 ssse3"
+yasm_sse4_deps="yasm_ssse3 sse4"
+yasm_sse42_deps="yasm_sse4 sse42"
+yasm_avx_deps="yasm_sse42 avx"
+yasm_fma4_deps="yasm_avx fma4"
+
+
 aligned_stack_if_any="ppc x86"
 fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
 fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
@@ -2956,8 +3001,8 @@ EOF
 
         check_yasm "pextrd [eax], xmm0, 1" && enable yasm ||
             die "yasm not found, use --disable-yasm for a crippled build"
-        check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx
-        check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4
+        check_yasm "vextractf128 xmm0, ymm0, 0"      || disable yasm_avx
+        check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable yasm_fma4
         check_yasm "CPU amdnop" && enable cpunop
     fi
 
-- 
1.7.1

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to