Commit 1afdfb3d authored by zhongwei.yao@arm.com's avatar zhongwei.yao@arm.com

arm64 neon optimization building is enabled

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1042 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 9453f7c4
......@@ -465,7 +465,7 @@ typedef uint8 uvec8[16];
#opcode " " #offset "(%" #base ",%" #index "," #scale "),%" #arg "\n"
#endif // defined(__native_client__) && defined(__x86_64__)
#if defined(__arm__)
#if defined(__arm__) || defined(__aarch64__)
#undef MEMACCESS
#if defined(__native_client__)
#define MEMACCESS(base) ".p2align 3\nbic %" #base ", #0xc0000000\n"
......
......@@ -15,7 +15,10 @@
'libyuv_disable_jpeg%': 0,
'build_neon': 0,
'conditions': [
[ '(target_arch == "armv7" or target_arch == "armv7s" or (target_arch == "arm" and arm_version >= 7)) and target_subarch != 64 and (arm_neon == 1 or arm_neon_optional == 1)', {
[ '(target_arch == "armv7" or target_arch == "armv7s" or \
(target_arch == "arm" and arm_version >= 7) or target_arch == "arm64")\
and target_subarch != 64 and (arm_neon == 1 or arm_neon_optional == 1)',
{
'build_neon': 1,
}],
],
......@@ -35,8 +38,12 @@
'-mfpu=vfpv3',
'-mfpu=vfpv3-d16',
],
'cflags': [
'conditions': [
['target_arch != "arm64"', {
'cflags': [
'-mfpu=neon',
],
}],
],
'include_dirs': [
'include',
......@@ -101,9 +108,15 @@
'dependencies': [
'libyuv_neon',
],
'conditions': [
#TODO LIBYUV_NEON is temporary disabled. When all arm64 port has
# been done, enable it.
['target_arch !="arm64"', {
'defines': [
'LIBYUV_NEON',
]
}],
],
}],
# MemorySanitizer does not support assembly code yet.
# http://crbug.com/344505
......
......@@ -256,12 +256,17 @@ int InitCpuFlags(void) {
if (getenv("LIBYUV_DISABLE_MIPS_DSPR2")) {
cpu_info_ &= ~kCpuHasMIPS_DSPR2;
}
#elif defined(__arm__)
#elif defined(__arm__) || defined(__aarch64__)
// gcc -mfpu=neon defines __ARM_NEON__
// __ARM_NEON__ generates code that requires Neon. NaCL also requires Neon.
// For Linux, /proc/cpuinfo can be tested but without that assume Neon.
#if defined(__ARM_NEON__) || defined(__native_client__) || !defined(__linux__)
cpu_info_ = kCpuHasNEON;
// For aarch64(arm64), /proc/cpuinfo's feature is not complete, e.g. no neon
// flag in it.
// So for aarch64, neon enabling is hard coded here.
#elif defined(__aarch64__)
cpu_info_ = kCpuHasNEON;
#else
// Linux arm parse text file for neon detect.
cpu_info_ = ArmCpuCaps("/proc/cpuinfo");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment