Skip to content

Commit 3618308

Browse files
committed
enhance cpuid output internal type and print max level
1 parent 71ab28c commit 3618308

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/cpucounters.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,7 @@ bool PCM::detectModel()
657657
std::cerr << "IBRS and IBPB supported : " << ((cpuinfo.reg.edx & (1 << 26)) ? "yes" : "no") << "\n";
658658
std::cerr << "STIBP supported : " << ((cpuinfo.reg.edx & (1 << 27)) ? "yes" : "no") << "\n";
659659
std::cerr << "Spec arch caps supported : " << ((cpuinfo.reg.edx & (1 << 29)) ? "yes" : "no") << "\n";
660+
std::cerr << "Max CPUID level : " << max_cpuid << "\n";
660661

661662
return true;
662663
}
@@ -2163,7 +2164,7 @@ PCM::PCM() :
21632164
cpu_model(-1),
21642165
cpu_stepping(-1),
21652166
cpu_microcode_level(-1),
2166-
max_cpuid(-1),
2167+
max_cpuid(0),
21672168
threads_per_core(0),
21682169
num_cores(0),
21692170
num_sockets(0),

src/cpucounters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class PCM_API PCM
568568
bool hybrid = false;
569569
int32 cpu_stepping;
570570
int64 cpu_microcode_level;
571-
int32 max_cpuid;
571+
uint32 max_cpuid;
572572
int32 threads_per_core;
573573
int32 num_cores;
574574
int32 num_sockets;

src/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ uint64 read_number(const char* str);
379379

380380
union PCM_CPUID_INFO
381381
{
382-
int array[4];
382+
unsigned int array[4];
383383
struct { unsigned int eax, ebx, ecx, edx; } reg;
384384
};
385385

0 commit comments

Comments
 (0)