From 0861331ff70091fada813a72033760b33de0b358 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Wed, 2 Dec 2020 17:26:29 +0000 Subject: [PATCH] Revert "add CPU feature detection for iOS / ARM Mac" This reverts commit 51c01588f31ef0a1679b8d6fec19b39578c909b4. Reason for revert: doesn't work on iOS, not needed on Mac. Original change's description: > add CPU feature detection for iOS / ARM Mac > > My reference was mostly `man 3 sysctl`. > > I'm pretty sure 'neon_fp16' is the right bit for FP16 NEON compute and > 'neon_hpfp' just mean's its got f32<->f16 instructions, but I could be > mixed up. It'll become extremely obvious once I start using that bit. > > Bug: skia:11001 > Change-Id: I8bb73aef71b750b766aa1d0e29878fd7a8e8d6da > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339837 > Reviewed-by: Herb Derby > Commit-Queue: Mike Klein TBR=mtklein@google.com,herb@google.com,brianosman@google.com Change-Id: Ie93605514fd806a1c708f71c52e7d80a4ef34131 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:11001 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340176 Reviewed-by: Mike Klein Commit-Queue: Mike Klein --- src/core/SkCpu.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/core/SkCpu.cpp b/src/core/SkCpu.cpp index c1ada939ff..a88f49802f 100644 --- a/src/core/SkCpu.cpp +++ b/src/core/SkCpu.cpp @@ -115,24 +115,6 @@ return features; } -#elif defined(SK_CPU_ARM64) && __has_include() - #include - - static uint32_t read_cpu_features() { - auto has_feature = [](const char* name) { - int32_t feature = 0; - size_t size = sizeof(feature); - return 0 == sysctlbyname(name, &feature,&size, nullptr,0) - && size == sizeof(feature) - && feature; - }; - uint32_t features = 0; - if (has_feature("hw.optional.armv8_crc32")) { features |= SkCpu::CRC32; } - if (has_feature("hw.optional.neon_fp16" )) { features |= SkCpu::ASIMDHP; } - return features; - } - - #elif defined(SK_CPU_ARM32) && __has_include() && \ (!defined(__ANDROID_API__) || __ANDROID_API__ >= 18) // sys/auxv.h will always be present in the Android NDK due to unified