[fpc-devel] AMD & Intel CPUCount

Ewald ewald at yellowcouch.org
Fri Dec 28 20:01:41 CET 2012

Once upon a time, on 12/28/2012 04:25 PM to be precise, Ludo Brands said:
> On 28/12/2012 15:46, Ewald wrote:
>> Hmmm, that's weird. The results of the Xeon are what I was expecting.
>> Quite frankly I don't know how to fix it. Maybe getting the maximum
>> amount of threads sharing the caches might prove helpfull, but then
>> again it is guesswork. Anyway, can you give this code a try?
>> Than if I take the highest value from this and the previous program it
>> *might* provide a sensible result. (?)
> Xeon:#max threads sharing caches: 16
> Atom:#max threads sharing caches: 2
> On Xeon cpuid 00000004 returns 0x1c004121 in rax ,  on Atom 0x4121 in
> eax. So both report 2 threads per cache. The cores per package (bits
> 31..26) is not coherent. Don't know how to solve that.
Well, it is as you say, the `max cores per packge` just doesn't make any
sense at all. How can a processor hav  e a maximum of one core per
physical package, while in reality it has two threads sharing the same
cache? Either I'm missing something here, or the behaviour of CPUID has
changed over the years.

Either way: it leaves me with a method that is not 100% reliable.


More information about the fpc-devel mailing list