Description: POWER "support"
Author: Simon Richter <sjr@debian.org>
Last-Update: 2026-06-27

--- intel-gmmlib-22.10.0+ds1.orig/Source/GmmLib/CMakeLists.txt
+++ intel-gmmlib-22.10.0+ds1/Source/GmmLib/CMakeLists.txt
@@ -167,6 +167,8 @@ endif()
 
 if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch")
     set(GMMLIB_MARCH "armv8-a+fp+simd")
+elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^ppc")
+    set(GMMLIB_MARCH "power8")
 elseif("${GMMLIB_MARCH}" STREQUAL "")
     set(GMMLIB_MARCH "corei7")
 endif()
--- intel-gmmlib-22.10.0+ds1.orig/Source/GmmLib/Linux.cmake
+++ intel-gmmlib-22.10.0+ds1/Source/GmmLib/Linux.cmake
@@ -55,6 +55,43 @@ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^
     -fPIC
     -g
     )
+elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^ppc")
+    SET (GMMLIB_COMPILER_FLAGS_COMMON
+    #general warnings
+    #-Wall
+    -Winit-self
+    -Winvalid-pch
+    -Wpointer-arith
+    -Wno-unused
+    -Wno-unknown-pragmas
+    -Wno-comments
+    -Wno-narrowing
+    -Wno-overflow
+    -Wno-parentheses
+    -Wno-missing-braces
+    -Wno-sign-compare
+    -Werror=address
+    -Werror=format-security
+    -Werror=return-type
+
+    # General optimization options
+    -mpopcntb
+    -mpopcntd
+    -finline-functions
+    -fno-short-enums
+    -Wa,--noexecstack
+    -fno-strict-aliasing
+    # Common defines
+    -DNO_WARN_X86_INTRINSICS
+    # Other common flags
+    -fstack-protector
+    -fdata-sections
+    -ffunction-sections
+    -fmessage-length=0
+    -fvisibility=hidden
+    -fPIC
+    -g
+    )
 else()
     SET (GMMLIB_COMPILER_FLAGS_COMMON
     #general warnings
@@ -174,7 +211,7 @@ foreach (flag ${GMMLIB_COMPILER_CXX_FLAG
     SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
 endforeach()
 
-if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch")
+if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(aarch|ppc)")
     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
 else()
--- intel-gmmlib-22.10.0+ds1.orig/Source/GmmLib/Utility/CpuSwizzleBlt/CpuSwizzleBlt.c
+++ intel-gmmlib-22.10.0+ds1/Source/GmmLib/Utility/CpuSwizzleBlt/CpuSwizzleBlt.c
@@ -375,6 +375,9 @@ extern void CpuSwizzleBlt(CPU_SWIZZLE_BL
     #include <intrin.h>
 #elif defined(__ARM_ARCH)
     #include <sse2neon.h>
+#elif defined(__PPC__)
+    #include <xmmintrin.h>
+    #include <emmintrin.h>
 #elif((defined __clang__) ||(__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)))
     #include <cpuid.h>
     #include <x86intrin.h>
@@ -749,6 +752,9 @@ void CpuSwizzleBlt( // #################
                 #elif(defined(__ARM_ARCH))
                     #define MOVNTDQA_R(Reg, Src) ((Reg) = (Reg))
                     StreamingLoadSupported = 0;
+                #elif(defined(__PPC__))
+                    #define MOVNTDQA_R(Reg, Src) ((Reg) = (Reg))
+                    StreamingLoadSupported = 0;
                 #elif((defined __clang__) || (__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))
                     #define MOVNTDQA_R(Reg, Src) ((Reg) = _mm_stream_load_si128((__m128i *)(Src)))
                     unsigned int eax, ebx, ecx, edx;
