x64_cpu_info: Update test for latest xbyak

This commit is contained in:
Merry 2022-06-05 13:58:07 +01:00
parent 39e21920db
commit 11d12d0b84

View file

@ -10,7 +10,8 @@
#include <xbyak/xbyak_util.h> #include <xbyak/xbyak_util.h>
TEST_CASE("Host CPU supports", "[a64]") { TEST_CASE("Host CPU supports", "[a64]") {
Xbyak::util::Cpu cpu_info; using Cpu = Xbyak::util::Cpu;
Cpu cpu_info;
std::array<uint32_t, 4> cpu_name; std::array<uint32_t, 4> cpu_name;
for (uint32_t i = 2; i < 5; ++i) { for (uint32_t i = 2; i < 5; ++i) {
@ -20,62 +21,79 @@ TEST_CASE("Host CPU supports", "[a64]") {
std::putchar('\n'); std::putchar('\n');
cpu_info.putFamily(); cpu_info.putFamily();
static constexpr std::array types{ const std::array types{
std::make_pair(Xbyak::util::Cpu::t3DN, "3DN"), #define X(NAME) std::make_pair(Cpu::Type{Cpu::NAME}, &#NAME[1])
std::make_pair(Xbyak::util::Cpu::tADX, "ADX"), X(t3DN),
std::make_pair(Xbyak::util::Cpu::tAESNI, "AESNI"), X(tADX),
std::make_pair(Xbyak::util::Cpu::tAMD, "AMD"), X(tAESNI),
std::make_pair(Xbyak::util::Cpu::tAVX, "AVX"), X(tAMD),
std::make_pair(Xbyak::util::Cpu::tAVX2, "AVX2"), X(tAMX_BF16),
std::make_pair(Xbyak::util::Cpu::tAVX512_4FMAPS, "AVX5124FMAPS"), X(tAMX_INT8),
std::make_pair(Xbyak::util::Cpu::tAVX512_4VNNIW, "AVX5124VNNIW"), X(tAMX_TILE),
std::make_pair(Xbyak::util::Cpu::tAVX512_BITALG, "AVX512BITALG"), X(tAVX),
std::make_pair(Xbyak::util::Cpu::tAVX512_VBMI2, "AVX512VBMI2"), X(tAVX2),
std::make_pair(Xbyak::util::Cpu::tAVX512_VNNI, "AVX512VNNI"), X(tAVX512_4FMAPS),
std::make_pair(Xbyak::util::Cpu::tAVX512_VPOPCNTDQ, "AVX512VPOPCNTDQ"), X(tAVX512_4VNNIW),
std::make_pair(Xbyak::util::Cpu::tAVX512BW, "AVX512BW"), X(tAVX512_BF16),
std::make_pair(Xbyak::util::Cpu::tAVX512CD, "AVX512CD"), X(tAVX512_BITALG),
std::make_pair(Xbyak::util::Cpu::tAVX512DQ, "AVX512DQ"), X(tAVX512_FP16),
std::make_pair(Xbyak::util::Cpu::tAVX512ER, "AVX512ER"), X(tAVX512_IFMA),
std::make_pair(Xbyak::util::Cpu::tAVX512F, "AVX512F"), X(tAVX512_VBMI),
std::make_pair(Xbyak::util::Cpu::tAVX512IFMA, "AVX512IFMA"), X(tAVX512_VBMI2),
std::make_pair(Xbyak::util::Cpu::tAVX512PF, "AVX512PF"), X(tAVX512_VNNI),
std::make_pair(Xbyak::util::Cpu::tAVX512VBMI, "AVX512VBMI"), X(tAVX512_VP2INTERSECT),
std::make_pair(Xbyak::util::Cpu::tAVX512VL, "AVX512VL"), X(tAVX512_VPOPCNTDQ),
std::make_pair(Xbyak::util::Cpu::tBMI1, "BMI1"), X(tAVX512BW),
std::make_pair(Xbyak::util::Cpu::tBMI2, "BMI2"), X(tAVX512CD),
std::make_pair(Xbyak::util::Cpu::tCMOV, "CMOV"), X(tAVX512DQ),
std::make_pair(Xbyak::util::Cpu::tE3DN, "E3DN"), X(tAVX512ER),
std::make_pair(Xbyak::util::Cpu::tENHANCED_REP, "ENHANCED_REP"), X(tAVX512F),
std::make_pair(Xbyak::util::Cpu::tF16C, "F16C"), X(tAVX512IFMA),
std::make_pair(Xbyak::util::Cpu::tFMA, "FMA"), X(tAVX512PF),
std::make_pair(Xbyak::util::Cpu::tGFNI, "GFNI"), X(tAVX512VBMI),
std::make_pair(Xbyak::util::Cpu::tHLE, "HLE"), X(tAVX512VL),
std::make_pair(Xbyak::util::Cpu::tINTEL, "INTEL"), X(tAVX_VNNI),
std::make_pair(Xbyak::util::Cpu::tLZCNT, "LZCNT"), X(tBMI1),
std::make_pair(Xbyak::util::Cpu::tMMX, "MMX"), X(tBMI2),
std::make_pair(Xbyak::util::Cpu::tMMX2, "MMX2"), X(tCLDEMOTE),
std::make_pair(Xbyak::util::Cpu::tMOVBE, "MOVBE"), X(tCLFLUSHOPT),
std::make_pair(Xbyak::util::Cpu::tMPX, "MPX"), X(tCLZERO),
std::make_pair(Xbyak::util::Cpu::tOSXSAVE, "OSXSAVE"), X(tCMOV),
std::make_pair(Xbyak::util::Cpu::tPCLMULQDQ, "PCLMULQDQ"), X(tE3DN),
std::make_pair(Xbyak::util::Cpu::tPOPCNT, "POPCNT"), X(tENHANCED_REP),
std::make_pair(Xbyak::util::Cpu::tPREFETCHW, "PREFETCHW"), X(tF16C),
std::make_pair(Xbyak::util::Cpu::tPREFETCHWT1, "PREFETCHWT1"), X(tFMA),
std::make_pair(Xbyak::util::Cpu::tRDRAND, "RDRAND"), X(tGFNI),
std::make_pair(Xbyak::util::Cpu::tRDSEED, "RDSEED"), X(tHLE),
std::make_pair(Xbyak::util::Cpu::tRDTSCP, "RDTSCP"), X(tINTEL),
std::make_pair(Xbyak::util::Cpu::tRTM, "RTM"), X(tLZCNT),
std::make_pair(Xbyak::util::Cpu::tSHA, "SHA"), X(tMMX),
std::make_pair(Xbyak::util::Cpu::tSMAP, "SMAP"), X(tMMX2),
std::make_pair(Xbyak::util::Cpu::tSSE, "SSE"), X(tMOVBE),
std::make_pair(Xbyak::util::Cpu::tSSE2, "SSE2"), X(tMOVDIR64B),
std::make_pair(Xbyak::util::Cpu::tSSE3, "SSE3"), X(tMOVDIRI),
std::make_pair(Xbyak::util::Cpu::tSSE41, "SSE41"), X(tMPX),
std::make_pair(Xbyak::util::Cpu::tSSE42, "SSE42"), X(tOSXSAVE),
std::make_pair(Xbyak::util::Cpu::tSSSE3, "SSSE3"), X(tPCLMULQDQ),
std::make_pair(Xbyak::util::Cpu::tVAES, "VAES"), X(tPOPCNT),
std::make_pair(Xbyak::util::Cpu::tVPCLMULQDQ, "VPCLMULQDQ"), X(tPREFETCHW),
X(tPREFETCHWT1),
X(tRDRAND),
X(tRDSEED),
X(tRDTSCP),
X(tRTM),
X(tSHA),
X(tSMAP),
X(tSSE),
X(tSSE2),
X(tSSE3),
X(tSSE41),
X(tSSE42),
X(tSSSE3),
X(tVAES),
X(tVPCLMULQDQ),
X(tWAITPKG),
#undef X
}; };
constexpr size_t line_max = 80; constexpr size_t line_max = 80;