diff options
author | Chris Robinson <[email protected]> | 2020-12-31 11:42:02 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-12-31 11:42:02 -0800 |
commit | 9d354f721c39dc643399b36297c57ef809451f6f (patch) | |
tree | 2a2f23833503b3667e253a972057ce455b7ef8d7 | |
parent | 78f3d8fcd89a422a1412143e6c431efa3ff7a1d7 (diff) |
Assume run-time NEON support if detected by cmake
-rw-r--r-- | alc/cpu_caps.cpp | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/alc/cpu_caps.cpp b/alc/cpu_caps.cpp index 1c176fa1..3e264f34 100644 --- a/alc/cpu_caps.cpp +++ b/alc/cpu_caps.cpp @@ -131,55 +131,12 @@ al::optional<CPUInfo> GetCPUInfo() #ifdef HAVE_NEON #ifdef __ARM_NEON ret.mCaps |= CPU_CAP_NEON; - #elif defined(_WIN32) && (defined(_M_ARM) || defined(_M_ARM64)) - if(IsProcessorFeaturePresent(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE)) ret.mCaps |= CPU_CAP_NEON; - #else - - al::ifstream file{"/proc/cpuinfo"}; - if(!file.is_open()) - return al::nullopt; - - auto getline = [](std::istream &f, std::string &output) -> bool - { - while(f.good() && f.peek() == '\n') - f.ignore(); - return std::getline(f, output) && !output.empty(); - }; - std::string features; - while(getline(file, features)) - { - if(features.compare(0, 10, "Features\t:", 10) == 0) - break; - } - file.close(); - - size_t extpos{9}; - while((extpos=features.find("neon", extpos+1)) != std::string::npos) - { - if(std::isspace(features[extpos-1]) - && (extpos+4 == features.length() || std::isspace(features[extpos+4]))) - { - ret.mCaps |= CPU_CAP_NEON; - break; - } - } - if(!(ret.mCaps&CPU_CAP_NEON)) - { - extpos = 9; - while((extpos=features.find("asimd", extpos+1)) != std::string::npos) - { - if(std::isspace(features[extpos-1]) - && (extpos+5 == features.length() || std::isspace(features[extpos+5]))) - { - ret.mCaps |= CPU_CAP_NEON; - break; - } - } - } +#warning "Assuming NEON run-time support!" + ret.mCaps |= CPU_CAP_NEON; #endif #endif |