Preliminary support for ARMv7:
[deb_x265.git] / debian / patches / armv7l-support.patch
1 --- a/source/CMakeLists.txt
2 +++ b/source/CMakeLists.txt
3 @@ -49,9 +49,13 @@ if("${SYSPROC}" STREQUAL "" OR X86MATCH
4 message(STATUS "Detected x86 system processor")
5 endif()
6 elseif(${SYSPROC} STREQUAL "armv6l")
7 - message(STATUS "Detected ARM target processor")
8 - set(ARM 1)
9 + message(STATUS "Detected ARMV6 target processor")
10 + set(ARMV6 1)
11 add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
12 +elseif(${SYSPROC} STREQUAL "armv7l")
13 + message(STATUS "Detected ARMV7 target processor")
14 + set(ARMV7 1)
15 + add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1 -DHAVE_NEON=1)
16 else()
17 message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
18 message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
19 @@ -129,9 +133,12 @@ if(GCC)
20 if(X86 AND NOT X64)
21 add_definitions(-march=i686)
22 endif()
23 - if(ARM)
24 + if(ARMV6)
25 add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
26 endif()
27 + if(ARMV7)
28 + add_definitions(-fPIC -march=armv7 -mfloat-abi=hard -mfpu=neon)
29 + endif()
30 check_cxx_compiler_flag(-Wno-narrowing CC_HAS_NO_NARROWING)
31 check_cxx_compiler_flag(-Wno-array-bounds CC_HAS_NO_ARRAY_BOUNDS)
32 if (CC_HAS_NO_ARRAY_BOUNDS)
33 --- a/source/common/cpu.cpp
34 +++ b/source/common/cpu.cpp
35 @@ -356,7 +356,7 @@ uint32_t cpu_detect(void)
36 // which may result in incorrect detection and the counters stuck enabled.
37 // right now Apple does not seem to support performance counters for this test
38 #ifndef __MACH__
39 - flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
40 + //flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
41 #endif
42 // TODO: write dual issue test? currently it's A8 (dual issue) vs. A9 (fast mrc)
43 #endif // if HAVE_ARMV6