identification as coreihwl

Emmanuel Thomé emmanuel.thome at
Fri Nov 15 14:59:58 CET 2013


I'm considering copying gmp's config{,fsf}.{sub,guess} sources for
another project (gf2x, to become GPLv3).

I just noticed that gmp-5.1.3 identifies Ivy bridge and Haswell cpus,
but gives them the moniker "coreisbr", leaving the impression that it
mixes up with Sandy bridge.

The corresponding lines are the following from a C file created by config.guess:

          else if (model == 0x2d)       cpu_64bit = 1, modelstr =
"coreisbr"; /* SBC-EP */
          else if (model == 0x2e)       cpu_64bit = 1, modelstr =
"coreinhm"; /* NHM Beckton */
          else if (model == 0x2f)       cpu_64bit = 1, modelstr =
"coreiwsm"; /* WSM Eagleton */
          else if (model == 0x3a)       cpu_64bit = 1, modelstr =
"coreisbr"; /* IBR */
          else if (model == 0x3c)       cpu_64bit = 1, modelstr =
"coreisbr"; /* Haswell */

This is fine as long as there is no haswell-specific code in the repo
anyway, so I understand this fusion as an effective way to use the
same code for all three microarchitectures. The development version
puts coreihwl instead, as expected (but leaves IBR as coreisbr).

I would like to know however the reason for this organization. I
understood that config.guess was sort of promising to do the cpu
detection down to the microarchitecture level, and the down the road
./configure takes decisions regarding which source files to use. E.g.
as is the case there:

      corei | coreinhm | coreiwsm)
        gcc_cflags_cpu="-mtune=corei7 -mtune=core2 -mtune=k8"
        gcc_cflags_arch="-march=corei7 -march=core2
-march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
        path="x86/coreinhm x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86"
        path_64="x86_64/coreinhm x86_64/core2 x86_64"

Why does westmere get properly detected by config.guess, even though
there is no westmere-specific code as far as I can see, and why isn't
it exactly so for IBR/HWL ?

Best regards,


More information about the gmp-devel mailing list