PKGBUILDs/extra/x265/arm.patch

66 lines
2.5 KiB
Diff
Raw Normal View History

2014-03-30 04:59:56 +00:00
diff -urN a/source/CMakeLists.txt b/source/CMakeLists.txt
2015-02-12 13:26:25 +00:00
--- a/source/CMakeLists.txt 2015-02-10 14:15:13.000000000 -0700
+++ b/source/CMakeLists.txt 2015-02-12 06:25:01.334927114 -0700
@@ -46,10 +46,18 @@
2014-03-30 04:59:56 +00:00
set(X64 1)
add_definitions(-DX86_64=1)
endif()
2014-05-06 12:46:34 +00:00
+elseif(${SYSPROC} MATCHES "armv5.*")
2014-03-30 04:59:56 +00:00
+ message(STATUS "Detected ARMV5 system processor")
+ set(ARMV5 1)
+ add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=0 -DHAVE_NEON=0)
2014-04-10 13:34:31 +00:00
elseif(${SYSPROC} STREQUAL "armv6l")
2014-09-10 12:13:16 +00:00
- message(STATUS "Detected ARM target processor")
2014-03-30 04:59:56 +00:00
- set(ARM 1)
- add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
+ message(STATUS "Detected ARMV6 system processor")
+ set(ARMV6 1)
+ add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1 -DHAVE_NEON=0)
2014-04-10 13:34:31 +00:00
+elseif(${SYSPROC} STREQUAL "armv7l")
2014-03-30 04:59:56 +00:00
+ message(STATUS "Detected ARMV7 system processor")
+ set(ARMV7 1)
+ add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1 -DHAVE_NEON=0)
else()
message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
2015-02-12 13:26:25 +00:00
@@ -133,8 +141,8 @@
2014-03-30 04:59:56 +00:00
if(X86 AND NOT X64)
add_definitions(-march=i686)
endif()
- if(ARM)
- add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
+ if(ARMV7)
+ add_definitions(-fPIC)
endif()
2014-09-10 12:13:16 +00:00
check_cxx_compiler_flag(-Wno-narrowing CC_HAS_NO_NARROWING)
2015-02-12 13:26:25 +00:00
check_cxx_compiler_flag(-Wno-array-bounds CC_HAS_NO_ARRAY_BOUNDS)
2014-03-30 04:59:56 +00:00
diff -urN a/source/common/cpu.cpp b/source/common/cpu.cpp
2015-02-12 13:26:25 +00:00
--- a/source/common/cpu.cpp 2015-02-10 14:15:13.000000000 -0700
+++ b/source/common/cpu.cpp 2015-02-12 06:25:01.334927114 -0700
2014-04-10 13:34:31 +00:00
@@ -37,7 +37,7 @@
2014-03-30 04:59:56 +00:00
#include <machine/cpu.h>
#endif
-#if X265_ARCH_ARM && !defined(HAVE_NEON)
+#if X265_ARCH_ARM && (!defined(HAVE_NEON) || HAVE_NEON==0)
#include <signal.h>
#include <setjmp.h>
static sigjmp_buf jmpbuf;
2014-04-10 13:34:31 +00:00
@@ -340,7 +340,6 @@
2014-03-30 04:59:56 +00:00
}
canjump = 1;
- x265_cpu_neon_test();
canjump = 0;
signal(SIGILL, oldsig);
#endif // if !HAVE_NEON
2014-04-10 13:34:31 +00:00
@@ -356,7 +355,7 @@
2014-03-30 04:59:56 +00:00
// which may result in incorrect detection and the counters stuck enabled.
// right now Apple does not seem to support performance counters for this test
#ifndef __MACH__
- flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
+ //flags |= x265_cpu_fast_neon_mrc_test() ? X265_CPU_FAST_NEON_MRC : 0;
#endif
// TODO: write dual issue test? currently it's A8 (dual issue) vs. A9 (fast mrc)
#endif // if HAVE_ARMV6