October 25, 2006
Did another update with bunch of fixes. I took the time to read the official cpuid specs from intel and amd and I was not doing it 100% correctly.
October 25, 2006
Tomas Lindquist Olsen kirjoitti:
> notknown wrote:
>>
>> Vendor string:    AuthenticAMD
>> Processor string: AMD Sempron(tm)
>> Features:         MMX SSE 3DNow! 3DNow!+ MMX+
>> Multithreading:   0 threads / 0 cores
>>
>> 0 threads sounds weird, I am on Linux though.
> 
> Weird indeed. The thread and core fields are initialised to one, and only if HTT is available is the code that set them invoked. As you dont have HTT on the list this really does not make sense. Can you try printing the value of those fields before the 'if (hyperThreading)' in CPUID.this ?

Okay,

I added these lines right before that if:

    writefln("flags=", flags);
    writefln("misc=", misc);
    writefln("exflags=", exflags);
    writefln("apic=", apic);
    writefln("vendorStr=", vendorStr);
    writefln("processorStr=", processorStr);
    writefln("maxThreads=", maxThreads);
    writefln("maxCores=", maxCores);
    writefln("manufac=", manufac);


It prints now:

flags=58981375
misc=0
exflags=3251371007
apic=0
vendorStr=AuthenticAMD
processorStr=AMD Sempron(tm)
maxThreads=0
maxCores=0
manufac=2
Vendor string:    AuthenticAMD
Processor string: AMD Sempron(tm)
Features:         MMX SSE 3DNow! 3DNow!+ MMX+
Multithreading:   0 threads / 0 cores
October 25, 2006
On Wed, 25 Oct 2006 05:13:08 -0400, Tomas Lindquist Olsen <tomas@famolsen.dk> wrote:

> Did another update with bunch of fixes. I took the time to read the official cpuid specs from intel and amd and I was not doing it 100% correctly.

Vendor string:    GenuineIntel
Processor string: Intel(R) Pentium(R) 4 CPU 2.66GHz
Signature:        Family=15 Model=2 Stepping=7
Features:         MMX FXSR SSE SSE2 HTT
Multithreading:   4095 threads / 64 cores

Wooohooo!
October 25, 2006
Chris Miller wrote:
> On Wed, 25 Oct 2006 05:13:08 -0400, Tomas Lindquist Olsen <tomas@famolsen.dk> wrote:
> 
>> Did another update with bunch of fixes. I took the time to read the official cpuid specs from intel and amd and I was not doing it 100% correctly.
> 
> Vendor string:    GenuineIntel
> Processor string: Intel(R) Pentium(R) 4 CPU 2.66GHz
> Signature:        Family=15 Model=2 Stepping=7
> Features:         MMX FXSR SSE SSE2 HTT
> Multithreading:   4095 threads / 64 cores
> 
> Wooohooo!
aiii. I messed it up :(
Try again?
October 25, 2006
Carlos Santander wrote:

>> It seems that there is actually some interest in this module so I will accept feature requests.
> 
> I have one: support other processors ;)

Here is something that supports Mac OS X (Darwin):

http://www.algonet.se/~afb/d/cpuinfo.zip

Name:             ppc7450
CPU Type:         CPU_TYPE_POWERPC
CPU Subtype:      CPU_SUBTYPE_POWERPC_7450
Description:      PowerPC 7450
Vector Unit:      true

Name:             i486
CPU Type:         CPU_TYPE_I386
CPU Subtype:      CPU_SUBTYPE_486
Description:      Intel 80486
Vector Unit:      true

It's not public domain but copyrighted*, though...


But sysctl(3) should be all that a "cpuid" needs ?
Maybe that can be used to write a portable version:

hw.cpufrequency: 800000000
hw.optional.altivec: 1

--anders


* Since it needs to use the Mac OS X system headers.
October 25, 2006
On Wed, 25 Oct 2006 06:57:14 -0400, Tomas Lindquist Olsen <tomas@famolsen.dk> wrote:

> Chris Miller wrote:
>> On Wed, 25 Oct 2006 05:13:08 -0400, Tomas Lindquist Olsen <tomas@famolsen.dk> wrote:
>>
>>> Did another update with bunch of fixes. I took the time to read the official cpuid specs from intel and amd and I was not doing it 100% correctly.
>>  Vendor string:    GenuineIntel
>> Processor string: Intel(R) Pentium(R) 4 CPU 2.66GHz
>> Signature:        Family=15 Model=2 Stepping=7
>> Features:         MMX FXSR SSE SSE2 HTT
>> Multithreading:   4095 threads / 64 cores
>>  Wooohooo!
> aiii. I messed it up :(
> Try again?

Vendor string:    GenuineIntel
Processor string: Intel(R) Pentium(R) 4 CPU 2.66GHz
Signature:        Family=15 Model=2 Stepping=7
Features:         MMX FXSR SSE SSE2 HTT
Multithreading:   1 threads / 1 cores

Give me back my supercomputer ;)
October 25, 2006
notknown wrote:
> Tomas Lindquist Olsen kirjoitti:
>> notknown wrote:
>>>
>>> Vendor string:    AuthenticAMD
>>> Processor string: AMD Sempron(tm)
>>> Features:         MMX SSE 3DNow! 3DNow!+ MMX+
>>> Multithreading:   0 threads / 0 cores
>>>
>>> 0 threads sounds weird, I am on Linux though.
>>
>> Weird indeed. The thread and core fields are initialised to one, and only if HTT is available is the code that set them invoked. As you dont have HTT on the list this really does not make sense. Can you try printing the value of those fields before the 'if (hyperThreading)' in CPUID.this ?
> 
> Okay,
> 
> I added these lines right before that if:
> 
>     writefln("flags=", flags);
>     writefln("misc=", misc);
>     writefln("exflags=", exflags);
>     writefln("apic=", apic);
>     writefln("vendorStr=", vendorStr);
>     writefln("processorStr=", processorStr);
>     writefln("maxThreads=", maxThreads);
>     writefln("maxCores=", maxCores);
>     writefln("manufac=", manufac);
> 
> 
> It prints now:
> 
> flags=58981375
> misc=0
> exflags=3251371007
> apic=0
> vendorStr=AuthenticAMD
> processorStr=AMD Sempron(tm)
> maxThreads=0
> maxCores=0
> manufac=2
> Vendor string:    AuthenticAMD
> Processor string: AMD Sempron(tm)
> Features:         MMX SSE 3DNow! 3DNow!+ MMX+
> Multithreading:   0 threads / 0 cores
This seems like a compiler bug. It's declared:
uint maxThreads=1;

Am I missing something?
October 25, 2006
Tomas Lindquist Olsen kirjoitti:
> notknown wrote:
>> Tomas Lindquist Olsen kirjoitti:
>>> notknown wrote:
>>>>
>>>> Vendor string:    AuthenticAMD
>>>> Processor string: AMD Sempron(tm)
>>>> Features:         MMX SSE 3DNow! 3DNow!+ MMX+
>>>> Multithreading:   0 threads / 0 cores
>>>>
>>>> 0 threads sounds weird, I am on Linux though.
>>>
>>> Weird indeed. The thread and core fields are initialised to one, and only if HTT is available is the code that set them invoked. As you dont have HTT on the list this really does not make sense. Can you try printing the value of those fields before the 'if (hyperThreading)' in CPUID.this ?
>>
>> Okay,
>>
>> I added these lines right before that if:
>>
>>     writefln("flags=", flags);
>>     writefln("misc=", misc);
>>     writefln("exflags=", exflags);
>>     writefln("apic=", apic);
>>     writefln("vendorStr=", vendorStr);
>>     writefln("processorStr=", processorStr);
>>     writefln("maxThreads=", maxThreads);
>>     writefln("maxCores=", maxCores);
>>     writefln("manufac=", manufac);
>>
>>
>> It prints now:
>>
>> flags=58981375
>> misc=0
>> exflags=3251371007
>> apic=0
>> vendorStr=AuthenticAMD
>> processorStr=AMD Sempron(tm)
>> maxThreads=0
>> maxCores=0
>> manufac=2
>> Vendor string:    AuthenticAMD
>> Processor string: AMD Sempron(tm)
>> Features:         MMX SSE 3DNow! 3DNow!+ MMX+
>> Multithreading:   0 threads / 0 cores
> This seems like a compiler bug. It's declared:
> uint maxThreads=1;
> 
> Am I missing something?

Could it be because you run the code from constructor?
Maybe it is not yet set at that point, just guessing?
October 25, 2006
>> This seems like a compiler bug. It's declared:
>> uint maxThreads=1;
>>
>> Am I missing something?
> 
> Could it be because you run the code from constructor?
> Maybe it is not yet set at that point, just guessing?

Okay, must be compiler bug, just checked and it is not touched anywhere except the initialization.
October 26, 2006
notknown wrote:
>>> This seems like a compiler bug. It's declared:
>>> uint maxThreads=1;
>>>
>>> Am I missing something?
>>
>> Could it be because you run the code from constructor?
>> Maybe it is not yet set at that point, just guessing?
> 
> Okay, must be compiler bug, just checked and it is not touched anywhere except the initialization.

Do you think you could narrow this down? Seems it's not happening for Windows users. Might as well report it if it's a real bug.

Basically some testing of class member initialisers.