diff options
Diffstat (limited to 'sample/test_util.cpp')
-rw-r--r-- | sample/test_util.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sample/test_util.cpp b/sample/test_util.cpp index 0e9387e..2488ce1 100644 --- a/sample/test_util.cpp +++ b/sample/test_util.cpp @@ -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"); + puts("32bit"); #else - puts("64bit"); + puts("64bit"); #endif - putCPUinfo(); + } + putCPUinfo(onlyCpuidFeature); } |