File arm.patch of Package x265 (Revision 8c6cc14e99926b84895a849ec3cb7aa4)

Currently displaying revision 8c6cc14e99926b84895a849ec3cb7aa4 , Show latest

65
 
1
--- source/CMakeLists.txt.orig  2014-10-04 17:02:08.482815493 +0200
2
+++ source/CMakeLists.txt   2014-10-04 17:11:52.536865262 +0200
3
@@ -46,10 +46,18 @@
4
         set(X64 1)
5
         add_definitions(-DX86_64=1)
6
     endif()
7
-elseif(${SYSPROC} STREQUAL "armv6l")
8
-    message(STATUS "Detected ARM target processor")
9
-    set(ARM 1)
10
-    add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
11
+elseif(${SYSPROC} MATCHES "armv5.*")
12
+    message(STATUS "Detected ARMV5 system processor")
13
+    set(ARMV5 1)
14
+    add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=0 -DHAVE_NEON=0)
15
+   elseif(${SYSPROC} STREQUAL "armv6l")
16
+    message(STATUS "Detected ARMV6 system processor")
17
+    set(ARMV6 1)
18
+    add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1 -DHAVE_NEON=0)
19
+elseif(${SYSPROC} STREQUAL "armv7l")
20
+    message(STATUS "Detected ARMV7 system processor")
21
+    set(ARMV7 1)
22
+    add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1 -DHAVE_NEON=0)
23
 else()
24
     message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
25
     message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
26
@@ -127,8 +135,8 @@
27
     if(X86 AND NOT X64)
28
         add_definitions(-march=i686)
29
     endif()
30
-    if(ARM)
31
-        add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
32
+    if(ARMV7)
33
+        add_definitions(-fPIC)
34
     endif()
35
     check_cxx_compiler_flag(-Wno-narrowing CC_HAS_NO_NARROWING) 
36
     check_cxx_compiler_flag(-ffast-math CC_HAS_FAST_MATH) 
37
--- source/common/cpu.cpp.orig  2014-10-04 17:13:58.507875996 +0200
38
+++ source/common/cpu.cpp   2014-10-04 17:21:11.170912864 +0200
39
@@ -37,7 +37,7 @@
40
 #include <machine/cpu.h>
41
 #endif
42
 
43
-#if X265_ARCH_ARM && !defined(HAVE_NEON)
44
+#if X265_ARCH_ARM && (!defined(HAVE_NEON) || HAVE_NEON==0)
45
 #include <signal.h>
46
 #include <setjmp.h>
47
 static sigjmp_buf jmpbuf;
48
@@ -340,7 +340,6 @@
49
     }
50
 
51
     canjump = 1;
52
-    x265_cpu_neon_test();
53
     canjump = 0;
54
     signal(SIGILL, oldsig);
55
 #endif // if !HAVE_NEON
56
@@ -356,7 +355,7 @@
57
     // which may result in incorrect detection and the counters stuck enabled.
58
     // right now Apple does not seem to support performance counters for this test
59
 #ifndef __MACH__
60
-    flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
61
+    //flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
62
 #endif
63
     // TODO: write dual issue test? currently it's A8 (dual issue) vs. A9 (fast mrc)
64
 #endif // if HAVE_ARMV6
65