Revised CPUID/cache info - for review

Bruno Medeiros brunodomedeiros+spam at com.gmail
Tue Sep 23 10:38:25 PDT 2008


Don wrote:
> The attached code is a revision of my cache detection code, and also 
> serves as a replacement for std.cpuid.
> With the 'toString' function removed, it should also be suitable for 
> Tango, as it has no dependencies and generates no heap activity.
> 
> It fixes several problems with std.cpuid. Most importantly, it works for 
> non-Intel/non-AMD X86 processors (yes, they do exist), and has a 
> reasonable degree of future-proofing.
> I've removed some bad-practice functions (eg, you should NEVER test if 
> the vendor is Intel) and replaced them with more appropriate ones.
> 
> I've included stubs for PowerPC and Sparc, and most of the logic should 
> also work with Itanium.
> 
> But I don't have much free time, and the code is rather messy.
> Please confirm that it works on your system. If anyone has the time to 
> tidy it up, that would be most appreciated.
> 
> -Don
> 

(Didn't notice you had this new cache.d version in my previous post)

Vendor string:    AuthenticAMD
Processor string: AMD Athlon(tm) 64 X2 Dual Core Processor 5000+
Signature:        Family = F Model = 6B Stepping = 2
Features:         MMX SSE SSE2 SSE3 3DNow! 3DNow!+ MMX+ X86-64 FXSR
Multithreading:   2 cores / 2 threads
Data caches per CPU:
L1 ways = 2 linesize = 64 size = 64K
L2 ways = 16 linesize = 64 size = 512K



-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list