[Scummvm-git-logs] scummvm master -> 0fb047fcc8e787c6bbd9b9a05335649e285b8df6

sev- noreply at scummvm.org
Mon Jan 8 22:37:44 UTC 2024


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9e374ec4ca GRAPHICS: Use target pragmas instead of compiler flags to prevent ODR problems.
0fb047fcc8 GRAPHICS: Disable SIMD extensions on GCC <4.9 (no #pragma GCC target support)


Commit: 9e374ec4caee3e7afeae2305f85ccddf8f827331
    https://github.com/scummvm/scummvm/commit/9e374ec4caee3e7afeae2305f85ccddf8f827331
Author: elasota (1137273+elasota at users.noreply.github.com)
Date: 2024-01-08T23:37:39+01:00

Commit Message:
GRAPHICS: Use target pragmas instead of compiler flags to prevent ODR problems.

Changed paths:
    graphics/blit/blit-avx2.cpp
    graphics/blit/blit-neon.cpp
    graphics/blit/blit-sse2.cpp
    graphics/module.mk


diff --git a/graphics/blit/blit-avx2.cpp b/graphics/blit/blit-avx2.cpp
index 8fd5a8f038f..72bebf8726d 100644
--- a/graphics/blit/blit-avx2.cpp
+++ b/graphics/blit/blit-avx2.cpp
@@ -20,11 +20,17 @@
  */
 
 #include "common/scummsys.h"
-#include <immintrin.h>
 
 #include "graphics/blit/blit-alpha.h"
 #include "graphics/pixelformat.h"
 
+#include <immintrin.h>
+
+#ifdef __GNUC__
+#pragma GCC push_options
+#pragma GCC target("avx2")
+#endif
+
 namespace Graphics {
 
 class BlendBlitImpl_AVX2 : public BlendBlitImpl_Base {
@@ -300,3 +306,7 @@ void BlendBlit::blitAVX2(Args &args, const TSpriteBlendMode &blendMode, const Al
 }
 
 } // End of namespace Graphics
+
+#ifdef __GNUC__
+#pragma GCC pop_options
+#endif
diff --git a/graphics/blit/blit-neon.cpp b/graphics/blit/blit-neon.cpp
index fcc4fd14f5d..52b8c50b617 100644
--- a/graphics/blit/blit-neon.cpp
+++ b/graphics/blit/blit-neon.cpp
@@ -22,11 +22,21 @@
 #include "common/scummsys.h"
 
 #ifdef SCUMMVM_NEON
-#include <arm_neon.h>
 
 #include "graphics/blit/blit-alpha.h"
 #include "graphics/pixelformat.h"
 
+#include <arm_neon.h>
+
+#ifdef __GNUC__
+#pragma GCC push_options
+
+#if !defined(__aarch64__)
+#pragma GCC target("fpu=neon")
+#endif // !defined(__aarch64__)
+
+#endif // __GNUC__
+
 namespace Graphics {
 
 class BlendBlitImpl_NEON : public BlendBlitImpl_Base {
@@ -299,4 +309,9 @@ void BlendBlit::blitNEON(Args &args, const TSpriteBlendMode &blendMode, const Al
 }
 
 } // end of namespace Graphics
+
+#ifdef __GNUC__
+#pragma GCC pop_options
+#endif
+
 #endif // SCUMMVM_NEON
diff --git a/graphics/blit/blit-sse2.cpp b/graphics/blit/blit-sse2.cpp
index 5fbe44b25f4..fed2f5f7901 100644
--- a/graphics/blit/blit-sse2.cpp
+++ b/graphics/blit/blit-sse2.cpp
@@ -20,11 +20,22 @@
  */
 
 #include "common/scummsys.h"
-#include <immintrin.h>
 
 #include "graphics/blit/blit-alpha.h"
 #include "graphics/pixelformat.h"
 
+#include <emmintrin.h>
+
+#ifdef __GNUC__
+#pragma GCC push_options
+
+#ifndef __x86_64__
+#pragma GCC target("sse2")
+#endif
+
+#endif
+
+
 namespace Graphics {
 
 static FORCEINLINE __m128i sse2_mul32(__m128i a, __m128i b) {
@@ -301,3 +312,8 @@ void BlendBlit::blitSSE2(Args &args, const TSpriteBlendMode &blendMode, const Al
 }
 
 } // End of namespace Graphics
+
+#ifdef __GNUC__
+#pragma GCC pop_options
+#endif
+
diff --git a/graphics/module.mk b/graphics/module.mk
index e548d7012fe..1013dfea3e0 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -144,17 +144,14 @@ endif
 ifdef SCUMMVM_NEON
 MODULE_OBJS += \
 	blit/blit-neon.o
-$(MODULE)/blit/blit-neon.o: CXXFLAGS += $(NEON_CXXFLAGS)
 endif
 ifdef SCUMMVM_SSE2
 MODULE_OBJS += \
 	blit/blit-sse2.o
-$(MODULE)/blit/blit-sse2.o: CXXFLAGS += -msse2
 endif
 ifdef SCUMMVM_AVX2
 MODULE_OBJS += \
 	blit/blit-avx2.o
-$(MODULE)/blit/blit-avx2.o: CXXFLAGS += -mavx2
 endif
 
 # Include common rules


Commit: 0fb047fcc8e787c6bbd9b9a05335649e285b8df6
    https://github.com/scummvm/scummvm/commit/0fb047fcc8e787c6bbd9b9a05335649e285b8df6
Author: elasota (1137273+elasota at users.noreply.github.com)
Date: 2024-01-08T23:37:39+01:00

Commit Message:
GRAPHICS: Disable SIMD extensions on GCC <4.9 (no #pragma GCC target support)

Changed paths:
    configure


diff --git a/configure b/configure
index a409d01c90c..5b4f0d44d2a 100755
--- a/configure
+++ b/configure
@@ -6979,6 +6979,15 @@ case $_host_cpu in
 		;;
 esac
 
+if test "$have_gcc" = yes; then
+	# Need 4.9 for pragma target
+	if (test $_cxx_major -lt 4) || (test $_cxx_major -eq 4 && test $_cxx_minor -lt 9); then
+		_ext_sse2=no
+		_ext_avx2=no
+		_ext_neon=no
+	fi
+fi
+
 define_in_config_if_yes "$_ext_sse2" 'SCUMMVM_SSE2'
 echo_n "Enabling x86/amd64 SSE2... "
 echo "$_ext_sse2"




More information about the Scummvm-git-logs mailing list