rt.compiler.util.cpuid

Identify the characteristics of the host CPU.

Implemented according to:

- AP-485 Intel(C) Processor Identification and the CPUID Instruction http://www.intel.com/design/xeon/applnots/241618.htm

- Intel(R) 64 and IA-32 Architectures Software Developer's Manual, Volume 2A: Instruction Set Reference, A-M http://developer.intel.com/design/pentium4/manuals/index_new.htm

- AMD CPUID Specification Publication # 25481 http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/25481.pdf

Members

Functions

amd
bool amd()

Is this an AMD processor?

amd
bool amd()
Undocumented in source. Be warned that the author may not have intended to support it.
amd3dnow
bool amd3dnow()

Is AMD 3DNOW supported?

amd3dnow
bool amd3dnow()
Undocumented in source. Be warned that the author may not have intended to support it.
amd3dnowExt
bool amd3dnowExt()

Is AMD 3DNOW Ext supported?

amd3dnowExt
bool amd3dnowExt()
Undocumented in source. Be warned that the author may not have intended to support it.
amd64
bool amd64()

Is this an AMD 64?

amd64
bool amd64()
Undocumented in source. Be warned that the author may not have intended to support it.
amdMmx
bool amdMmx()

Is AMD MMX supported?

amdMmx
bool amdMmx()
Undocumented in source. Be warned that the author may not have intended to support it.
coresPerCPU
uint coresPerCPU()

Returns number of cores in CPU

coresPerCPU
uint coresPerCPU()
Undocumented in source. Be warned that the author may not have intended to support it.
family
uint family()

Returns family

family
uint family()
Undocumented in source. Be warned that the author may not have intended to support it.
fxsr
bool fxsr()

Is FXSR supported?

fxsr
bool fxsr()
Undocumented in source. Be warned that the author may not have intended to support it.
hyperThreading
bool hyperThreading()

Is hyperthreading supported?

hyperThreading
bool hyperThreading()
Undocumented in source. Be warned that the author may not have intended to support it.
ia64
bool ia64()

Is this an Intel Architecture IA64?

ia64
bool ia64()
Undocumented in source. Be warned that the author may not have intended to support it.
intel
bool intel()

Is this an Intel processor?

intel
bool intel()
Undocumented in source. Be warned that the author may not have intended to support it.
mmx
bool mmx()

Is MMX supported?

mmx
bool mmx()
Undocumented in source. Be warned that the author may not have intended to support it.
model
uint model()

Returns model

model
uint model()
Undocumented in source. Be warned that the author may not have intended to support it.
processor
char[] processor()

Returns processor string

processor
char[] processor()
Undocumented in source. Be warned that the author may not have intended to support it.
sse
bool sse()

Is SSE supported?

sse
bool sse()
Undocumented in source. Be warned that the author may not have intended to support it.
sse2
bool sse2()

Is SSE2 supported?

sse2
bool sse2()
Undocumented in source. Be warned that the author may not have intended to support it.
sse3
bool sse3()

Is SSE3 supported?

sse3
bool sse3()
Undocumented in source. Be warned that the author may not have intended to support it.
ssse3
bool ssse3()

Is SSSE3 supported?

ssse3
bool ssse3()
Undocumented in source. Be warned that the author may not have intended to support it.
stepping
uint stepping()

Returns stepping

stepping
uint stepping()
Undocumented in source. Be warned that the author may not have intended to support it.
threadsPerCPU
uint threadsPerCPU()

Returns number of threads per CPU

threadsPerCPU
uint threadsPerCPU()
Undocumented in source. Be warned that the author may not have intended to support it.
vendor
char[] vendor()

Returns vendor string

vendor
char[] vendor()
Undocumented in source. Be warned that the author may not have intended to support it.

Bugs

Only works on x86 CPUs

Examples

import std.cpuid;
import std.stdio;

void main()
{
    writefln(std.cpuid.toString());
}

Meta

Authors

Tomas Lindquist Olsen <tomas@famolsen.dk> (slightly altered by Walter Bright)