File arm.patch of Package x265 (Revision 2d9502f277a4c3f3cb9b89981ac99dca)

Currently displaying revision 2d9502f277a4c3f3cb9b89981ac99dca , Show latest

66
 
1
diff -urN a/source/CMakeLists.txt b/source/CMakeLists.txt
2
--- a/source/CMakeLists.txt 2015-02-10 14:15:13.000000000 -0700
3
+++ b/source/CMakeLists.txt 2015-02-12 06:25:01.334927114 -0700
4
@@ -46,10 +46,18 @@
5
         set(X64 1)
6
         add_definitions(-DX86_64=1)
7
     endif()
8
+elseif(${SYSPROC} MATCHES "armv5.*")
9
+    message(STATUS "Detected ARMV5 system processor")
10
+    set(ARMV5 1)
11
+    add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=0 -DHAVE_NEON=0)
12
 elseif(${SYSPROC} STREQUAL "armv6l")
13
-    message(STATUS "Detected ARM target processor")
14
-    set(ARM 1)
15
-    add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
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
@@ -133,8 +141,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(-Wno-array-bounds CC_HAS_NO_ARRAY_BOUNDS) 
37
diff -urN a/source/common/cpu.cpp b/source/common/cpu.cpp
38
--- a/source/common/cpu.cpp 2015-02-10 14:15:13.000000000 -0700
39
+++ b/source/common/cpu.cpp 2015-02-12 06:25:01.334927114 -0700
40
@@ -37,7 +37,7 @@
41
 #include <machine/cpu.h>
42
 #endif
43
 
44
-#if X265_ARCH_ARM && !defined(HAVE_NEON)
45
+#if X265_ARCH_ARM && (!defined(HAVE_NEON) || HAVE_NEON==0)
46
 #include <signal.h>
47
 #include <setjmp.h>
48
 static sigjmp_buf jmpbuf;
49
@@ -340,7 +340,6 @@
50
     }
51
 
52
     canjump = 1;
53
-    x265_cpu_neon_test();
54
     canjump = 0;
55
     signal(SIGILL, oldsig);
56
 #endif // if !HAVE_NEON
57
@@ -356,7 +355,7 @@
58
     // which may result in incorrect detection and the counters stuck enabled.
59
     // right now Apple does not seem to support performance counters for this test
60
 #ifndef __MACH__
61
-    flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
62
+    //flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
63
 #endif
64
     // TODO: write dual issue test? currently it's A8 (dual issue) vs. A9 (fast mrc)
65
 #endif // if HAVE_ARMV6
66