[x265-commits] [x265] cmake: fix testbench linkage in multilib default build

Steve Borho steve at borho.org
Mon Jul 13 23:38:26 CEST 2015


details:   http://hg.videolan.org/x265/rev/0d8c2fcb86cb
branches:  
changeset: 10811:0d8c2fcb86cb
user:      Steve Borho <steve at borho.org>
date:      Mon Jul 13 15:33:23 2015 -0500
description:
cmake: fix testbench linkage in multilib default build
Subject: [x265] asm: fix saoCuStatsE0 segmentation fault in linux

details:   http://hg.videolan.org/x265/rev/fbfe1d0c586f
branches:  
changeset: 10812:fbfe1d0c586f
user:      Dnyaneshwar G <dnyaneshwar at multicorewareinc.com>
date:      Mon Jul 13 18:00:30 2015 +0530
description:
asm: fix saoCuStatsE0 segmentation fault in linux

diffstat:

 source/common/x86/loopfilter.asm |  14 +++++++-------
 source/test/CMakeLists.txt       |   7 ++++++-
 2 files changed, 13 insertions(+), 8 deletions(-)

diffs (62 lines):

diff -r 39f5205c28d0 -r fbfe1d0c586f source/common/x86/loopfilter.asm
--- a/source/common/x86/loopfilter.asm	Mon Jul 13 10:47:22 2015 -0500
+++ b/source/common/x86/loopfilter.asm	Mon Jul 13 18:00:30 2015 +0530
@@ -2049,8 +2049,9 @@ cglobal saoCuStatsBO, 7,12,6
 ;-----------------------------------------------------------------------------------------------------------------------
 %if ARCH_X86_64
 INIT_XMM sse4
-cglobal saoCuStatsE0, 5,8,8, 0-32
+cglobal saoCuStatsE0, 5,9,8, 0-32
     mov         r3d, r3m
+    mov         r8, r5mp
 
     ; clear internal temporary buffer
     pxor        m0, m0
@@ -2132,7 +2133,6 @@ cglobal saoCuStatsE0, 5,8,8, 0-32
     jnz         .loopH
 
     ; sum to global buffer
-    mov         r1, r5mp
     mov         r0, r6mp
 
     ; s_eoTable = {1, 2, 0, 3, 4}
@@ -2148,15 +2148,15 @@ cglobal saoCuStatsE0, 5,8,8, 0-32
     add         [r0 + 4 * 4], r5d
 
     mov         r6d, [rsp + 5 * 2 + 0 * 4]
-    add         [r1 + 1 * 4], r6d
+    add         [r8 + 1 * 4], r6d
     mov         r5d, [rsp + 5 * 2 + 1 * 4]
-    add         [r1 + 2 * 4], r5d
+    add         [r8 + 2 * 4], r5d
     mov         r6d, [rsp + 5 * 2 + 2 * 4]
-    add         [r1 + 0 * 4], r6d
+    add         [r8 + 0 * 4], r6d
     mov         r5d, [rsp + 5 * 2 + 3 * 4]
-    add         [r1 + 3 * 4], r5d
+    add         [r8 + 3 * 4], r5d
     mov         r6d, [rsp + 5 * 2 + 4 * 4]
-    add         [r1 + 4 * 4], r6d
+    add         [r8 + 4 * 4], r6d
     RET
 %endif
 
diff -r 39f5205c28d0 -r fbfe1d0c586f source/test/CMakeLists.txt
--- a/source/test/CMakeLists.txt	Mon Jul 13 10:47:22 2015 -0500
+++ b/source/test/CMakeLists.txt	Mon Jul 13 18:00:30 2015 +0530
@@ -1,3 +1,4 @@
+# vim: syntax=cmake
 enable_language(ASM_YASM)
 
 if(MSVC_IDE)
@@ -24,5 +25,9 @@ add_executable(TestBench ${YASM_SRC}
     intrapredharness.cpp intrapredharness.h)
 target_link_libraries(TestBench x265-static ${PLATFORM_LIBS})
 if(LINKER_OPTIONS)
-    set_target_properties(TestBench PROPERTIES LINK_FLAGS ${LINKER_OPTIONS})
+    if(EXTRA_LIB)
+        list(APPEND LINKER_OPTIONS "-L..")
+    endif(EXTRA_LIB)
+    string(REPLACE ";" " " LINKER_OPTION_STR "${LINKER_OPTIONS}")
+    set_target_properties(TestBench PROPERTIES LINK_FLAGS "${LINKER_OPTION_STR}")
 endif()


More information about the x265-commits mailing list