Update patch for ARM processors.
[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 @@ -65,11 +69,11 @@ if(UNIX)
20 endif()
21 endif(UNIX)
22
23 -if(X64 AND NOT WIN32)
24 +if(X64 OR ARMV7 AND NOT WIN32)
25 option(ENABLE_PIC "Enable Position Independent Code" ON)
26 else()
27 option(ENABLE_PIC "Enable Position Independent Code" OFF)
28 -endif(X64 AND NOT WIN32)
29 +endif(X64 OR ARMV7 AND NOT WIN32)
30
31 # Compiler detection
32 if(CMAKE_GENERATOR STREQUAL "Xcode")
33 @@ -135,9 +139,12 @@ if(GCC)
34 if(X86 AND NOT X64)
35 add_definitions(-march=i686)
36 endif()
37 - if(ARM)
38 + if(ARMV6)
39 add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
40 endif()
41 + if(ARMV7)
42 + add_definitions(-march=armv7 -mfloat-abi=hard -mfpu=neon)
43 + endif()
44 check_cxx_compiler_flag(-Wno-narrowing CC_HAS_NO_NARROWING)
45 check_cxx_compiler_flag(-Wno-array-bounds CC_HAS_NO_ARRAY_BOUNDS)
46 if (CC_HAS_NO_ARRAY_BOUNDS)
47 --- a/source/common/cpu.cpp
48 +++ b/source/common/cpu.cpp
49 @@ -356,7 +356,7 @@ uint32_t cpu_detect(void)
50 // which may result in incorrect detection and the counters stuck enabled.
51 // right now Apple does not seem to support performance counters for this test
52 #ifndef __MACH__
53 - flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
54 + //flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
55 #endif
56 // TODO: write dual issue test? currently it's A8 (dual issue) vs. A9 (fast mrc)
57 #endif // if HAVE_ARMV6