[x265] [PATCH] asm: properly disable x265_stack_align() when ENABLE_ASSEMBLY is OFF

Steve Borho steve at borho.org
Sat Mar 7 05:28:08 CET 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1425702474 21600
#      Fri Mar 06 22:27:54 2015 -0600
# Node ID 3f7ca64c8feb57a08801a963eaf64d917c71b825
# Parent  043c2418864b0a3ada6f597e6def6ead73d90b5f
asm: properly disable x265_stack_align() when ENABLE_ASSEMBLY is OFF

diff -r 043c2418864b -r 3f7ca64c8feb source/common/CMakeLists.txt
--- a/source/common/CMakeLists.txt	Fri Mar 06 13:15:55 2015 -0600
+++ b/source/common/CMakeLists.txt	Fri Mar 06 22:27:54 2015 -0600
@@ -1,7 +1,7 @@
 # vim: syntax=cmake
 
 if(ENABLE_ASSEMBLY)
-    set_source_files_properties(primitives.cpp PROPERTIES COMPILE_FLAGS -DENABLE_ASSEMBLY=1)
+    set_source_files_properties(threading.cpp primitives.cpp PROPERTIES COMPILE_FLAGS -DENABLE_ASSEMBLY=1)
 
     set(SSE3  vec/dct-sse3.cpp)
     set(SSSE3 vec/dct-ssse3.cpp)
diff -r 043c2418864b -r 3f7ca64c8feb source/common/common.h
--- a/source/common/common.h	Fri Mar 06 13:15:55 2015 -0600
+++ b/source/common/common.h	Fri Mar 06 22:27:54 2015 -0600
@@ -74,13 +74,6 @@
 #define ALIGN_VAR_16(T, var) T var __attribute__((aligned(16)))
 #define ALIGN_VAR_32(T, var) T var __attribute__((aligned(32)))
 
-#if X265_ARCH_X86 && !defined(X86_64)
-extern "C" intptr_t x265_stack_align(void (*func)(), ...);
-#define x265_stack_align(func, ...) x265_stack_align((void (*)())func, __VA_ARGS__)
-#else
-#define x265_stack_align(func, ...) func(__VA_ARGS__)
-#endif
-
 #if defined(__MINGW32__)
 #define fseeko fseeko64
 #endif
@@ -90,7 +83,6 @@
 #define ALIGN_VAR_8(T, var)  __declspec(align(8)) T var
 #define ALIGN_VAR_16(T, var) __declspec(align(16)) T var
 #define ALIGN_VAR_32(T, var) __declspec(align(32)) T var
-#define x265_stack_align(func, ...) func(__VA_ARGS__)
 #define fseeko _fseeki64
 
 #endif // if defined(__GNUC__)
diff -r 043c2418864b -r 3f7ca64c8feb source/common/threading.cpp
--- a/source/common/threading.cpp	Fri Mar 06 13:15:55 2015 -0600
+++ b/source/common/threading.cpp	Fri Mar 06 22:27:54 2015 -0600
@@ -26,6 +26,13 @@
 namespace x265 {
 // x265 private namespace
 
+#if X265_ARCH_X86 && !defined(X86_64) && ENABLE_ASSEMBLY && defined(__GNUC__)
+extern "C" intptr_t x265_stack_align(void (*func)(), ...);
+#define x265_stack_align(func, ...) x265_stack_align((void (*)())func, __VA_ARGS__)
+#else
+#define x265_stack_align(func, ...) func(__VA_ARGS__)
+#endif
+
 /* C shim for forced stack alignment */
 static void stackAlignMain(Thread *instance)
 {


More information about the x265-devel mailing list