Memory barrier for fat initialization

Torbjörn Granlund tg at
Wed Jan 14 15:49:03 UTC 2015

Which architectures do you intend to target for fat nettle builds?

I really would want to move GMP towards fattyness for all current
platforms.  Unfortunately, this is not easy, and the problem is neither
writing the actual code (fat.c, fat_entry.asm) nor getting memory
ordering right.  The real problem is robust CPU identification.

One might think that if we can run config.guess while building the
library, we can run it, at least in essence, as part of the fat setup
process.  The actual CPU identification code of config.guess is simple
file reads, or C+asm code snippets; we could extract those, right?

But config.guess causes many instances of SIGILL and whatnot.  That is
part of its design.  Perhaps we could setup a signal handler in fat.c,
but that is not very attractive.  I wish all hardware manufacturers
provided a cpuid-style instruction that runs in user mode.

Please encrypt, key id 0xC8601622

More information about the gmp-devel mailing list