mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
arm64 neon optimization building is enabled
git-svn-id: http://libyuv.googlecode.com/svn/trunk@1042 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
9453f7c494
commit
1afdfb3da8
@ -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"
|
||||||
|
|||||||
17
libyuv.gyp
17
libyuv.gyp
@ -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,8 +38,12 @@
|
|||||||
'-mfpu=vfpv3',
|
'-mfpu=vfpv3',
|
||||||
'-mfpu=vfpv3-d16',
|
'-mfpu=vfpv3-d16',
|
||||||
],
|
],
|
||||||
'cflags': [
|
'conditions': [
|
||||||
|
['target_arch != "arm64"', {
|
||||||
|
'cflags': [
|
||||||
'-mfpu=neon',
|
'-mfpu=neon',
|
||||||
|
],
|
||||||
|
}],
|
||||||
],
|
],
|
||||||
'include_dirs': [
|
'include_dirs': [
|
||||||
'include',
|
'include',
|
||||||
@ -101,9 +108,15 @@
|
|||||||
'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
|
||||||
|
|||||||
@ -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");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user