4 ms·
On iOS you can compile code that uses SIMD instructions, but querying whether the CPU supports them is privileged, and iOS does not provide an API to do that.
by fluffything 7y ago
On iOS you can compile code that uses SIMD instructions, but querying whether the CPU supports them is privileged, and iOS does not provide an API to do that.
So if you want to write code that uses SIMD instructions depending on whether they are available, you need to use Apple math libraries, which is super messed up.
- nightfly 7y agoCan you try and run SIMD instructions and catch the failure if they aren't available?
- johncolanduoni 7y agoIt’s been a while since there was an iOS device without NEON support. Unless you’re supporting something like iOS 4 (which is a whole other headache) you can use the SIMD instructions unconditionally. This is the armv6/armv7 distinction you can find in the XCode settings. For 64-bit slices of your app, you’re in even safer territory.
- stephencanon 7y agoarm64 CPUs support NEON unconditionally. arm64e implies the armv8.2 and armv8.3 extensions (but not SVE), notably half-precision arithmetic and interleaved complex ops. You generally should not need to do runtime selection.