简体   繁体   中英

How do I Detect Availability of NEON and Helium Instruction Sets at Runtime

I'm working on a cross-platform parallel math library and I've made great progress implementing SSE, AVX, AVX2 and AVX-512 for x86/amd64 including runtime detection of ISA availability.

However, I've run into a major problem. There is no documentation for detecting NEON or Helium support at runtime on MSVC. It appears that there is no cpuid instruction on ARM or ARM64. It isn't clear whether there is a cross-platform way to accomplish this for Linux either.

Do you even need to detect it manually or can you just use preprocessor definitions (such as _M_ARM64 ) to check for runtime support? It is my understanding that preprocessor macros are ONLY evaluated at compile-time.

Are we just supposed to assume that every ARM CPU has NEON? What about Helium?

I'm hoping that someone here knows how to do it. Thank You in advance.

NEON as well as VFP is mandatory on armv8-a .

Hence there is no need to check the availability at runtime on aarch64 .

And I'd ditch aarch32 support altogether.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM