[Botan-devel] A request to everyone: /proc/cpuinfo and uname information

Jack Lloyd lloyd at randombit.net
Mon Oct 6 18:42:51 EDT 2008


On Mon, Oct 06, 2008 at 03:25:52PM -0700, Nathaniel Smith wrote:

> <ignorant> Why does configure.pl care about /proc/cpuinfo?

configure.pl tries to guess what CPU you are using (unless you tell it
what CPU you want with --cpu)

> I would think the only time the information in /proc/cpuinfo
> mattered was when for choosing things like thread pool sizes or asm
> variants, and those are surely runtime decisions?

Well, which implementations will actually be compiled in has to be
done at compile time. For instance if you attempt to compile the SSE2
code with Intel C++ or GCC without the right CPU flags turned on, the
compiler will reject it ("SSE intrinsics unavailable").

In some cases, which implementation to use is made at run time.  For
instance (this is speaking only of very recent versions) all the SHA-1
implementations that configure.pl thinks can be compiled will be
available, and can be chosen among by the application (or just default
to letting the library choose one in a fixed priority).

However in other cases only one version is compiled. In particular
with BigInt only one implementation is chosen among the C++ and
assembly variants.

Also we want to know the CPU type as closely as possible for setting
compiler flags. In some cases getting it exactly right is pretty much
meaningless, but sometimes it makes a big difference (for example if
it can enable the compiler to do automatic vectorization or use
instructions only available in some processors (like conditional moves
on x86 or byte/word operations on the Alpha).

-Jack



More information about the botan-devel mailing list