chore: Update build configurations to enable AVX optimization for different architectures

This commit is contained in:
Mauro Balades
2024-08-02 09:11:57 +02:00
parent babc34cc90
commit 8e19e74894
3 changed files with 61 additions and 1 deletions

View File

@@ -26,6 +26,26 @@ if test "$ZEN_RELEASE"; then
export MOZ_PGO=1
ac_add_options MOZ_PGO=1
if test "$SURFER_COMPAT" = "true"; then
ac_add_options --enable-optimize="-O3 -march=x86-64"
export CFLAGS="$CFLAGS -O3 -ffp-contract=fast -march=x86-64"
export CPPFLAGS="$CPPFLAGS -O3 -ffp-contract=fast -march=x86-64"
export CXXFLAGS="$CXXFLAGS -O3 -ffp-contract=fast -march=x86-64"
export LDFLAGS="$LDFLAGS -Wl,-O3 -Wl,-mllvm,-fp-contract=fast -march=x86-64"
export RUSTFLAGS="$RUSTFLAGS -C target-cpu=x86-64 -C codegen-units=1"
else
ac_add_options --enable-wasm-avx
ac_add_options --enable-optimize="-O3 -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes"
export CFLAGS="$CFLAGS -O3 -ffp-contract=fast -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes"
export CPPFLAGS="$CPPFLAGS -O3 -ffp-contract=fast -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes"
export CXXFLAGS="$CXXFLAGS -O3 -ffp-contract=fast -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes"
export LDFLAGS="$LDFLAGS -Wl,-O3 -Wl,-mllvm,-fp-contract=fast -march=x86-64-v3"
export RUSTFLAGS="$RUSTFLAGS -C target-cpu=x86-64-v3 -C target-feature=+sse4.1 -C target-feature=+avx2 -C codegen-units=1"
fi
export VERBOSE=1
fi
ac_add_options --target=x86_64-pc-linux

View File

@@ -4,6 +4,7 @@
unset MOZ_STDCXX_COMPAT
ac_add_options --enable-install-strip
ac_add_options --disable-dmd
export MOZ_MACBUNDLE_ID=${appId}
export MOZ_MACBUNDLE_NAME="Zen Browser.app"
@@ -16,10 +17,28 @@ if test "$SURFER_COMPAT" = "true"; then
# it crashes the builds
unset MOZ_LTO
ac_add_options --disable-lto
ac_add_options --enable-wasm-avx
ac_add_options --enable-optimize="-O3 -march=x86-64-v3"
export CFLAGS="-O3 -march=x86-64-v3"
export CPPFLAGS="-O3 -march=x86-64-v3"
export CXXFLAGS="-O3 -march=x86-64-v3"
export LDFLAGS="-Wl,-O3 -march=x86-64-v3"
export RUSTFLAGS="-C target-feature=+avx2 -C codegen-units=1"
else
ac_add_options --target=aarch64-apple-darwin
ac_add_options --enable-install-strip
ac_add_options --enable-strip
export STRIP_FLAGS="--strip-debug --strip-unneeded"
ac_add_options --enable-optimize="-O3 -march=armv8.3-a+simd"
export CFLAGS="-O3 -march=armv8.3-a+simd"
export CPPFLAGS="-O3 -march=armv8.3-a+simd"
export CXXFLAGS="-O3 -march=armv8.3-a+simd"
export LDFLAGS="-Wl,-O3 -march=armv8.3-a+simd"
export RUSTFLAGS="-C target-feature=+v8.3a -C codegen-units=1"
fi
export VERBOSE=1

View File

@@ -31,4 +31,25 @@ ac_add_options --target=x86_64-pc-windows-msvc
ac_add_options --disable-maintenance-service
ac_add_options --disable-bits-download
ac_add_options --enable-wasm-avx
if test "$SURFER_COMPAT" = "true"; then
ac_add_options --enable-optimize="-O3 -mavx -maes"
export CFLAGS="-O3 -mavx -maes"
export CPPFLAGS="-O3 -mavx -maes"
export CXXFLAGS="-O3 -mavx -maes"
export LDFLAGS="-Wl,-O3"
export RUSTFLAGS="-C target-feature=+avx -C codegen-units=1"
else
ac_add_options --enable-optimize="-O2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -Xclang -O3"
ac_add_options --enable-wasm-avx
export CFLAGS="-O2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes /clang:-O3 /arch:AVX"
export CPPFLAGS="-O2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes /clang:-O3 /arch:AVX"
export CXXFLAGS="-O2 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes /clang:-O3 /arch:AVX"
export LDFLAGS="-Wl,-O3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes"
POLLY="-mllvm -polly -mllvm -polly-2nd-level-tiling -mllvm -polly-loopfusion-greedy -mllvm -polly-pattern-matching-based-opts -mllvm -polly-position=before-vectorizer -mllvm -polly-vectorizer=stripmine"
export RUSTFLAGS="-C target-feature=+avx -C codegen-units=1"
fi
export VERBOSE=1