mirror of
https://github.com/herumi/xbyak
synced 2024-11-21 16:09:11 -07:00
add -cpuid to test_util
This commit is contained in:
parent
cf7cb744c8
commit
66d62968d4
1 changed files with 9 additions and 5 deletions
|
@ -13,7 +13,7 @@ struct PopCountTest : public Xbyak::CodeGenerator {
|
|||
}
|
||||
};
|
||||
|
||||
void putCPUinfo()
|
||||
void putCPUinfo(bool onlyCpuidFeature)
|
||||
{
|
||||
using namespace Xbyak::util;
|
||||
Cpu cpu;
|
||||
|
@ -94,6 +94,7 @@ void putCPUinfo()
|
|||
if (cpu.has(tbl[i].type)) printf(" %s", tbl[i].str);
|
||||
}
|
||||
printf("\n");
|
||||
if (onlyCpuidFeature) return;
|
||||
if (cpu.has(Cpu::tPOPCNT)) {
|
||||
const int n = 0x12345678; // bitcount = 13
|
||||
const int ok = 13;
|
||||
|
@ -127,12 +128,15 @@ void putCPUinfo()
|
|||
printf("CoreLevel=%u\n", cpu.getNumCores(Xbyak::util::CoreLevel));
|
||||
}
|
||||
|
||||
int main()
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
bool onlyCpuidFeature = argc == 2 && strcmp(argv[1], "-cpuid") == 0;
|
||||
if (!onlyCpuidFeature) {
|
||||
#ifdef XBYAK32
|
||||
puts("32bit");
|
||||
#else
|
||||
puts("64bit");
|
||||
#endif
|
||||
putCPUinfo();
|
||||
}
|
||||
putCPUinfo(onlyCpuidFeature);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue