mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 08:46:47 +08:00
Untangle arm and aarch64 #ifdefs in GetCpuFlags()
Change-Id: I5df39c20a700aee38954bc9288fdee116138645d Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5879350 Reviewed-by: George Steed <george.steed@arm.com> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
parent
f1b28b3510
commit
85e55115f0
@ -451,8 +451,8 @@ static SAFEBUFFERS int GetCpuFlags(void) {
|
||||
cpu_info = LoongarchCpuCaps();
|
||||
cpu_info |= kCpuHasLOONGARCH;
|
||||
#endif
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
#if defined(__aarch64__) && defined(__linux__)
|
||||
#if defined(__aarch64__)
|
||||
#if defined(__linux__)
|
||||
// getauxval is supported since Android SDK version 18, minimum at time of
|
||||
// writing is 21, so should be safe to always use this. If getauxval is
|
||||
// somehow disabled then getauxval returns 0, which will leave Neon enabled
|
||||
@ -460,9 +460,12 @@ static SAFEBUFFERS int GetCpuFlags(void) {
|
||||
unsigned long hwcap = getauxval(AT_HWCAP);
|
||||
unsigned long hwcap2 = getauxval(AT_HWCAP2);
|
||||
cpu_info = AArch64CpuCaps(hwcap, hwcap2);
|
||||
#elif defined(__aarch64__)
|
||||
cpu_info = AArch64CpuCaps();
|
||||
#else
|
||||
cpu_info = AArch64CpuCaps();
|
||||
#endif
|
||||
cpu_info |= kCpuHasARM;
|
||||
#endif // __aarch64__
|
||||
#if defined(__arm__)
|
||||
// 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.
|
||||
@ -473,7 +476,6 @@ static SAFEBUFFERS int GetCpuFlags(void) {
|
||||
cpu_info = kCpuHasNEON;
|
||||
#else
|
||||
cpu_info = 0;
|
||||
#endif
|
||||
#endif
|
||||
cpu_info |= kCpuHasARM;
|
||||
#endif // __arm__
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user