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

Dzung.Hoang at freescale.com Dzung.Hoang at freescale.com
Mon Mar 9 17:54:19 CET 2015


This patch works for me on the stable branch and should be checked in there. As of now the stable branch is broken for me because of this.

Regards,
- Dzung Hoang

________________________________________
From: x265-devel <x265-devel-bounces at videolan.org> on behalf of Steve Borho <steve at borho.org>
Sent: Friday, March 6, 2015 10:28 PM
To: x265-devel at videolan.org
Subject: [x265] [PATCH] asm: properly disable x265_stack_align() when ENABLE_ASSEMBLY is OFF

# 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)
 {
_______________________________________________
x265-devel mailing list
x265-devel at videolan.org
https://mailman.videolan.org/listinfo/x265-devel


More information about the x265-devel mailing list