Hi Everyone,

Currently we are determining cpu feature by trying to execute an 
instruction, and catching a SIGILL. It has been part of the library as long 
as I can remember.

I checked in some code on my testing fork that uses getauxvalue(3) on Linux 
and Android to query the runtime for features. One of the reasons I avoided 
it in the past was, its not documented well. The Glibc folks recently 
answered some questions for us, so we know how to handle Aarch32 and 
Aarch64. Also see "When to use AT_HWCAP or AT_HWCAP2", 
https://sourceware.org/ml/libc-help/2017-08/msg00012.html.

We fall back to CPU probing if we can't find an alternate or approved 
implementation.

We need something for the BSDs and Apple. I believe the BSDs provide 
sysctl, but its not clear to me what Apple "officially" uses on iOS and OS 
X. iOS is very important because of acceleration on the smartphones and 
tablets.

Apple is critical because their signal handling/longjump stuff appears 
broken. Uri and I had troubles with it last year or so. And OpenSSL 
recently moved away from the probes on Apple platforms because of 
unexplained crashes after a SIGILL.

An interesting footnote is, some benchmarks sped-up by 0.1 cpb. I'm 
guessing its related to spatial and temporal locality of code and data. Its 
a lot easier to test a flag in a bitmask vector; and invoking a signal 
handler is expensive.

You can see what the code looks like at 
https://github.com/noloader/cryptopp/blob/master/rijndael-simd.cpp#L106 and 
https://github.com/noloader/cryptopp/blob/master/neon.cpp#L75.

Jeff

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to cryptopp-users-unsubscr...@googlegroups.com.
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to