[FFmpeg-devel] [RFC]Move is-align-a-power-of-two test up

Carl Eugen Hoyos cehoyos
Fri Apr 2 16:45:06 CEST 2010


Hi!

FFmpeg compilation with icc's interprocedural optimization between files 
(-ipo) improves performance by 10% (h264) to 20% (theora).
(Only tested with --enable-shared.)
Unfortunately, it currently does not work out-of-the-box, because 
compilation with -ipo does not fail if an invalid value for .align is 
given ("linking" fails):

$ cat align.c
void foo(void){ __asm__ volatile(".align 3"); }
$ icc align.c -c
/tmp/iccgyMZFzas_.s: Assembler messages:
/tmp/iccgyMZFzas_.s:13: Error: alignment not a power of 2
$ icc align.c -c -ipo
(succeeds and builds align.o)
$ icc align.o
ipo: remark #11001: performing single-file optimizations
ipo: remark #11005: generating object file /tmp/ipo_iccWkeAyV.o
/tmp/iccTgD2V5as_.s: Assembler messages:
/tmp/iccTgD2V5as_.s:13: Error: alignment not a power of 2
icc: error #10014: problem during multi-file optimization compilation 
(code 1)

Attached is a possible solution, to be applied in two parts.

Please comment, Carl Eugen
-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 22773)
+++ configure	(working copy)
@@ -2750,6 +2750,9 @@
 check_cflags -fno-math-errno
 check_cflags -fno-signed-zeros
 
+# Find out if the .align argument is a power of two or not.
+check_asm asmalign_pot '".align 3"'
+
 if enabled icc; then
     # Just warnings, no remarks
     check_cflags -w1
@@ -2765,6 +2768,8 @@
     check_ldflags -march=$cpu
     # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
     enable ebp_available
+    # if -ipo is used, the alignment test always passes
+    disable asmalign_pot
 elif enabled ccc; then
     # disable some annoying warnings
     add_cflags -msg_disable cvtu32to64
@@ -2792,9 +2797,6 @@
     add_ldflags -p
 fi
 
-# Find out if the .align argument is a power of two or not.
-check_asm asmalign_pot '".align 3"'
-
 enabled_any $DECODER_LIST      && enable decoders
 enabled_any $ENCODER_LIST      && enable encoders
 enabled_any $HWACCEL_LIST      && enable hwaccels



More information about the ffmpeg-devel mailing list