On Thu, Jul 07, 2016 at 10:52:01AM +0200, Riccardo Mottola wrote: > I wonder if you can have different cores? e.g. how is a Cell processor seen > in cpuinfo? Just out of curiosity.
I don't think it is, since it needs special handling to dispatch jobs. As long as any core in cpuinfo has altivec, it would use altivec. > Anyway, I think the best of two worlds would be to use getauxval() when > available (most probably any currently supported OS) and fall back to > cpuinfo if not. A configure test I suppose is quite simple. A configure test would be easy to do, and make the code not require /proc mounted. Of course ARM should do that too, and anyone else doing /proc parsing. If getauxval is not available, then you have to fall back to /proc in some manner. It would also be possible to have the library to an init function to capture the envp value and hence the auxv value when the process starts, and use that, which makes it independant of /proc even if glibc is too old, but that makes some slightly ugly weird code using functionality most people stay away from (for good reasons). libauxv did that, but is no longer maintained since glibc now has this built in instead. It might even be possible to just use a #if to check the glibc version, but I don't know if that is considered ugly compared to a configure test. -- Len Sorensen