File arm.patch of Package x265 (Revision 1046007d483222360bfec929fd1f35d3)
Currently displaying revision 1046007d483222360bfec929fd1f35d3 , Show latest
88
1
Index: x265_2.2/source/CMakeLists.txt
2
===================================================================
3
--- x265_2.2.orig/source/CMakeLists.txt
4
+++ x265_2.2/source/CMakeLists.txt
5
6
add_definitions(-DPPC64=1)
7
message(STATUS "Detected POWER PPC64 target processor")
8
endif()
9
-elseif(ARMMATCH GREATER "-1")
10
- if(CROSS_COMPILE_ARM)
11
- message(STATUS "Cross compiling for ARM arch")
12
- else()
13
- set(CROSS_COMPILE_ARM 0)
14
- endif()
15
- message(STATUS "Detected ARM target processor")
16
- set(ARM 1)
17
- add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
18
+elseif(${SYSPROC} MATCHES "armv5.*")
19
+ message(STATUS "Detected ARMV5 system processor")
20
+ set(ARMV5 1)
21
+ add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=0 -DHAVE_NEON=0)
22
+elseif(${SYSPROC} STREQUAL "armv6l")
23
+ message(STATUS "Detected ARMV6 system processor")
24
+ set(ARMV6 1)
25
+ add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1 -DHAVE_NEON=0)
26
+elseif(${SYSPROC} STREQUAL "armv7l")
27
+ message(STATUS "Detected ARMV7 system processor")
28
+ set(ARMV7 1)
29
+ add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1 -DHAVE_NEON=0)
30
+elseif(${SYSPROC} STREQUAL "aarch64")
31
+ message(STATUS "Detected AArch64 system processor")
32
+ set(ARMV7 1)
33
+ add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1 -DHAVE_NEON=0)
34
else()
35
message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
36
message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
37
38
endif()
39
endif()
40
endif()
41
- if(ARM AND CROSS_COMPILE_ARM)
42
- set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
43
- elseif(ARM)
44
- find_package(Neon)
45
- if(CPU_HAS_NEON)
46
- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
47
- add_definitions(-DHAVE_NEON)
48
- else()
49
- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
50
- endif()
51
+ if(ARMV7)
52
+ add_definitions(-fPIC)
53
endif()
54
- add_definitions(${ARM_ARGS})
55
if(FPROFILE_GENERATE)
56
if(INTEL_CXX)
57
add_definitions(-prof-gen -prof-dir="${CMAKE_CURRENT_BINARY_DIR}")
58
Index: x265_2.2/source/common/cpu.cpp
59
===================================================================
60
--- x265_2.2.orig/source/common/cpu.cpp
61
+++ x265_2.2/source/common/cpu.cpp
62
63
#include <machine/cpu.h>
64
#endif
65
66
-#if X265_ARCH_ARM && !defined(HAVE_NEON)
67
+#if X265_ARCH_ARM && (!defined(HAVE_NEON) || HAVE_NEON==0)
68
#include <signal.h>
69
#include <setjmp.h>
70
static sigjmp_buf jmpbuf;
71
72
}
73
74
canjump = 1;
75
- PFX(cpu_neon_test)();
76
canjump = 0;
77
signal(SIGILL, oldsig);
78
#endif // if !HAVE_NEON
79
80
// which may result in incorrect detection and the counters stuck enabled.
81
// right now Apple does not seem to support performance counters for this test
82
#ifndef __MACH__
83
- flags |= PFX(cpu_fast_neon_mrc_test)() ? X265_CPU_FAST_NEON_MRC : 0;
84
+ //flags |= PFX(cpu_fast_neon_mrc_test)() ? X265_CPU_FAST_NEON_MRC : 0;
85
#endif
86
// TODO: write dual issue test? currently it's A8 (dual issue) vs. A9 (fast mrc)
87
#endif // if HAVE_ARMV6
88