Hardware/CPU/IntelCPU.cs
changeset 250 c19d56a0bcad
parent 249 3b5be5dce071
child 264 718555482989
     1.1 --- a/Hardware/CPU/IntelCPU.cs	Fri Jan 21 21:41:14 2011 +0000
     1.2 +++ b/Hardware/CPU/IntelCPU.cs	Sat Jan 22 17:58:32 2011 +0000
     1.3 @@ -255,15 +255,21 @@
     1.4            {
     1.5              newBusClock = 
     1.6                TimeStampCounterFrequency / timeStampCounterMultiplier;
     1.7 -            if (microarchitecture == Microarchitecture.Nehalem ||
     1.8 -                microarchitecture == Microarchitecture.SandyBridge) 
     1.9 -            {
    1.10 -              uint multiplier = eax & 0xff;
    1.11 -              coreClocks[i].Value = (float)(multiplier * newBusClock);
    1.12 -            } else {
    1.13 -              double multiplier = ((eax >> 8) & 0x1f) + 0.5 * ((eax >> 14) & 1);
    1.14 -              coreClocks[i].Value = (float)(multiplier * newBusClock);
    1.15 -            }            
    1.16 +            switch (microarchitecture) {
    1.17 +              case Microarchitecture.Nehalem: {
    1.18 +                  uint multiplier = eax & 0xff;
    1.19 +                  coreClocks[i].Value = (float)(multiplier * newBusClock);
    1.20 +                } break;
    1.21 +              case Microarchitecture.SandyBridge: {
    1.22 +                  uint multiplier = (eax >> 8) & 0xff;
    1.23 +                  coreClocks[i].Value = (float)(multiplier * newBusClock);
    1.24 +                } break;
    1.25 +              default: {
    1.26 +                  double multiplier = 
    1.27 +                    ((eax >> 8) & 0x1f) + 0.5 * ((eax >> 14) & 1);
    1.28 +                  coreClocks[i].Value = (float)(multiplier * newBusClock);
    1.29 +                } break;
    1.30 +            }         
    1.31            } else { 
    1.32              // if IA32_PERF_STATUS is not available, assume TSC frequency
    1.33              coreClocks[i].Value = (float)TimeStampCounterFrequency;