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]; ...@@ -465,7 +465,7 @@ typedef uint8 uvec8[16];
#opcode " " #offset "(%" #base ",%" #index "," #scale "),%" #arg "\n" #opcode " " #offset "(%" #base ",%" #index "," #scale "),%" #arg "\n"
#endif // defined(__native_client__) && defined(__x86_64__) #endif // defined(__native_client__) && defined(__x86_64__)
#if defined(__arm__) #if defined(__arm__) || defined(__aarch64__)
#undef MEMACCESS #undef MEMACCESS
#if defined(__native_client__) #if defined(__native_client__)
#define MEMACCESS(base) ".p2align 3\nbic %" #base ", #0xc0000000\n" #define MEMACCESS(base) ".p2align 3\nbic %" #base ", #0xc0000000\n"
......
...@@ -15,7 +15,10 @@ ...@@ -15,7 +15,10 @@
'libyuv_disable_jpeg%': 0, 'libyuv_disable_jpeg%': 0,
'build_neon': 0, 'build_neon': 0,
'conditions': [ '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, 'build_neon': 1,
}], }],
], ],
...@@ -35,9 +38,13 @@ ...@@ -35,9 +38,13 @@
'-mfpu=vfpv3', '-mfpu=vfpv3',
'-mfpu=vfpv3-d16', '-mfpu=vfpv3-d16',
], ],
'conditions': [
['target_arch != "arm64"', {
'cflags': [ 'cflags': [
'-mfpu=neon', '-mfpu=neon',
], ],
}],
],
'include_dirs': [ 'include_dirs': [
'include', 'include',
'.', '.',
...@@ -101,10 +108,16 @@ ...@@ -101,10 +108,16 @@
'dependencies': [ 'dependencies': [
'libyuv_neon', 'libyuv_neon',
], ],
'conditions': [
#TODO LIBYUV_NEON is temporary disabled. When all arm64 port has
# been done, enable it.
['target_arch !="arm64"', {
'defines': [ 'defines': [
'LIBYUV_NEON', 'LIBYUV_NEON',
] ]
}], }],
],
}],
# MemorySanitizer does not support assembly code yet. # MemorySanitizer does not support assembly code yet.
# http://crbug.com/344505 # http://crbug.com/344505
[ 'msan == 1', { [ 'msan == 1', {
......
...@@ -256,12 +256,17 @@ int InitCpuFlags(void) { ...@@ -256,12 +256,17 @@ int InitCpuFlags(void) {
if (getenv("LIBYUV_DISABLE_MIPS_DSPR2")) { if (getenv("LIBYUV_DISABLE_MIPS_DSPR2")) {
cpu_info_ &= ~kCpuHasMIPS_DSPR2; cpu_info_ &= ~kCpuHasMIPS_DSPR2;
} }
#elif defined(__arm__) #elif defined(__arm__) || defined(__aarch64__)
// gcc -mfpu=neon defines __ARM_NEON__ // gcc -mfpu=neon defines __ARM_NEON__
// __ARM_NEON__ generates code that requires Neon. NaCL also requires Neon. // __ARM_NEON__ generates code that requires Neon. NaCL also requires Neon.
// For Linux, /proc/cpuinfo can be tested but without that assume Neon. // For Linux, /proc/cpuinfo can be tested but without that assume Neon.
#if defined(__ARM_NEON__) || defined(__native_client__) || !defined(__linux__) #if defined(__ARM_NEON__) || defined(__native_client__) || !defined(__linux__)
cpu_info_ = kCpuHasNEON; 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 #else
// Linux arm parse text file for neon detect. // Linux arm parse text file for neon detect.
cpu_info_ = ArmCpuCaps("/proc/cpuinfo"); 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