Update patch for ARM processors.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 14 Jan 2015 17:23:51 +0000 (18:23 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 14 Jan 2015 17:23:51 +0000 (18:23 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
debian/patches/armv7l-support.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/armv7l-support.patch b/debian/patches/armv7l-support.patch
new file mode 100644 (file)
index 0000000..796ca45
--- /dev/null
@@ -0,0 +1,57 @@
+--- a/source/CMakeLists.txt
++++ b/source/CMakeLists.txt
+@@ -49,9 +49,13 @@ if("${SYSPROC}" STREQUAL "" OR X86MATCH
+         message(STATUS "Detected x86 system processor")
+     endif()
+ elseif(${SYSPROC} STREQUAL "armv6l")
+-    message(STATUS "Detected ARM target processor")
+-    set(ARM 1)
++    message(STATUS "Detected ARMV6 target processor")
++    set(ARMV6 1)
+     add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
++elseif(${SYSPROC} STREQUAL "armv7l")
++    message(STATUS "Detected ARMV7 target processor")
++    set(ARMV7 1)
++    add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1 -DHAVE_NEON=1)
+ else()
+     message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
+     message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
+@@ -65,11 +69,11 @@ if(UNIX)
+     endif()
+ endif(UNIX)
+-if(X64 AND NOT WIN32)
++if(X64 OR ARMV7 AND NOT WIN32)
+     option(ENABLE_PIC "Enable Position Independent Code" ON)
+ else()
+     option(ENABLE_PIC "Enable Position Independent Code" OFF)
+-endif(X64 AND NOT WIN32)
++endif(X64 OR ARMV7 AND NOT WIN32)
+ # Compiler detection
+ if(CMAKE_GENERATOR STREQUAL "Xcode")
+@@ -135,9 +139,12 @@ if(GCC)
+     if(X86 AND NOT X64)
+         add_definitions(-march=i686)
+     endif()
+-    if(ARM)
++    if(ARMV6)
+         add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
+     endif()
++    if(ARMV7)
++        add_definitions(-march=armv7 -mfloat-abi=hard -mfpu=neon)
++    endif()
+     check_cxx_compiler_flag(-Wno-narrowing CC_HAS_NO_NARROWING) 
+     check_cxx_compiler_flag(-Wno-array-bounds CC_HAS_NO_ARRAY_BOUNDS) 
+     if (CC_HAS_NO_ARRAY_BOUNDS)
+--- a/source/common/cpu.cpp
++++ b/source/common/cpu.cpp
+@@ -356,7 +356,7 @@ uint32_t cpu_detect(void)
+     // which may result in incorrect detection and the counters stuck enabled.
+     // right now Apple does not seem to support performance counters for this test
+ #ifndef __MACH__
+-    flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
++    //flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
+ #endif
+     // TODO: write dual issue test? currently it's A8 (dual issue) vs. A9 (fast mrc)
+ #endif // if HAVE_ARMV6
index 14223087bbe8d15803088214a1076ef92adfefa7..c0d876ee7aabb44c997c45adc831611b6d1df299 100644 (file)
@@ -1 +1,2 @@
 cpu-detection.patch
 cpu-detection.patch
+armv7l-support.patch