So it's fairly easy to figure out what kind of CPU an iOS device runs by querying sysctlbyname("hw.cpusubtype", ...)
, but there seems to be no obvious way to figure out what features the CPU actually has (think VFP, NEON, Thumb, ...). Can someone think of a way to do this?
Basically, what I need is something similar to getauxval(AT_HWCAP)
on Linux/Android, which returns a bit mask of features supported by the CPU.
A few things to note:
- The information must be retrieved at runtime from the OS. No preprocessor defines.
- Fat binaries is not a solution. I really do need to know this stuff in an ARM v6 binary.
Thanks in advance!