aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2016-01-30 10:52:44 -0800
committerTimothy Gu <timothygu99@gmail.com>2016-02-08 16:25:44 -0800
commitcb8646af24bd8e9627cc5e1c62b049a00fe0b07b (patch)
tree7094dfe5af383a9c8435b1678b8f8851f6c3466b
parent8e46c7c1e7f5e775a152f6d75a08e93ddb9f7565 (diff)
downloadandroid_external_ffmpeg-cb8646af24bd8e9627cc5e1c62b049a00fe0b07b.tar.gz
android_external_ffmpeg-cb8646af24bd8e9627cc5e1c62b049a00fe0b07b.tar.bz2
android_external_ffmpeg-cb8646af24bd8e9627cc5e1c62b049a00fe0b07b.zip
configure: Enable GCC vectorization on ≥4.9 on x86
4.9 was released precisely nine years after the first GCC version with autovectorizer (4.0) and six years after the first GCC version with `-ftree-vectorize` default to enabled on `-O3` (4.3). We've given GCC enough time to fix those bugs. FATE passes here on a x86-64 machine with both GCC 4.9.2 and 5.3.1. Some optimization hotspots benefit greatly from this change, especially those without handwritten assembly. For instance, the main function in vf_phase is now 1.6x faster (1.2x overall) on my machine.
-rwxr-xr-xconfigure6
1 files changed, 5 insertions, 1 deletions
diff --git a/configure b/configure
index 1000cb1766..2148f11044 100755
--- a/configure
+++ b/configure
@@ -5935,7 +5935,11 @@ elif enabled ccc; then
add_cflags -msg_disable nonstandcast
add_cflags -msg_disable unsupieee
elif enabled gcc; then
- check_optflags -fno-tree-vectorize
+ case $gcc_basever in
+ 4.9*) enabled x86 || check_optflags -fno-tree-vectorize ;;
+ 4.*) check_optflags -fno-tree-vectorize ;;
+ *) enabled x86 || check_optflags -fno-tree-vectorize ;;
+ esac
check_cflags -Werror=format-security
check_cflags -Werror=implicit-function-declaration
check_cflags -Werror=missing-prototypes