No Issue - Only explicitly enforce GCC SSE2 optimizations when building on Intel 32-bit architectures

SSE2 optimizations are used by default on 64-bit platforms. By no longer explicitly enabling SSE2 on 64-bit GCC, we can more easily enable other optimizations (e.g. AVX) without worrying about them being overridden by the SSE2 flags.
This commit is contained in:
trav90
2024-03-22 10:28:06 -05:00
committed by roytam1
parent 9ca2104248
commit 2aa7dc2652
+11 -9
View File
@@ -176,22 +176,24 @@ if test "$GNU_CC"; then
CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
fi
CFLAGS="$CFLAGS -fno-math-errno"
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno"
CFLAGS="$CFLAGS -fno-math-errno -pipe"
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno -pipe"
if test "$CPU_ARCH" = "x86" -o "$CPU_ARCH" = "x86_64"; then
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
fi
case "${host_cpu}" in
i*86)
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
;;
esac
if test -z "$CLANG_CC"; then
case "$CC_VERSION" in
4.* | 5.*)
;;
*)
# Lifetime Dead Store Elimination level 2 (default in GCC6+) breaks Gecko.
# Instead of completely disabling this optimization on newer GCC's,
# we'll force them to use level 1 optimization with -flifetime-dse=1.
# Lifetime Dead Store Elimination level 2 (default in GCC) breaks Goanna.
# Instead of completely disabling this optimization, we force level 1
# optimization instead with -flifetime-dse=1.
# Add it first so that a mozconfig can override by setting CFLAGS/CXXFLAGS.
CFLAGS="-flifetime-dse=1 $CFLAGS"
CXXFLAGS="-flifetime-dse=1 $CXXFLAGS"