diff options
author | Sigrid <ftrvxmtrx@gmail.com> | 2020-10-29 11:27:26 +0100 |
---|---|---|
committer | Sigrid <ftrvxmtrx@gmail.com> | 2020-10-29 11:27:26 +0100 |
commit | d541c7bfd32e007d9556befac2f26776a8dccc10 (patch) | |
tree | 059fbe60873eb4bd6baa19ee5b4ea76df4abfa56 /sys/src/cmd/aux/cpuid.c | |
parent | 02053924100ddb8617f2d3cbd5b3d5e842cef8c3 (diff) |
aux/cpuid: decode leaf 7; extend leaf 13 decoding
Diffstat (limited to 'sys/src/cmd/aux/cpuid.c')
-rw-r--r-- | sys/src/cmd/aux/cpuid.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/sys/src/cmd/aux/cpuid.c b/sys/src/cmd/aux/cpuid.c index 8d74d2ddc..3b81f53d5 100644 --- a/sys/src/cmd/aux/cpuid.c +++ b/sys/src/cmd/aux/cpuid.c @@ -107,11 +107,53 @@ func1(ulong) } void +func7(ulong) +{ + Res r; + static char *bitebx[32] = { + [0] "fsgsbase", nil, "sgx", "bmi1", + [4] "hle", "avx2", nil, "smep", + [8] "bmi2", "erms", "invpcid", "rtm", + [12] "pqm", nil, "mpx", "pqe", + [16] "avx512", "avx512dq", "rdseed", "adx", + [20] "smap", "avx512ifma", "pcommit", "clflushopt", + [24] "clwb", "intelpt", "avx512pf", "avx512er", + [28] "avx512cd", "sha", "avx512bw", "avx512vl", + }; + static char *bitecx[32] = { + [0] "prefetchwt1", "avx512vbmi", "umip", "pku", + [4] "ospke", "waitpkg", "avx512vbmi2", "cetss", + [8] "gfni", "vaes", "vpclmulqdq", "avx512vnni", + [12] "avx512bitalg", nil, "avx512vpopcntdq", nil, + [16] nil, nil, nil, nil, + [20] nil, nil, "rdpid", nil, + [24] nil, "cldemote", nil, "movdiri", + [28] "movdir64b", "enqcmd", "sgxlc", "pks", + }; + static char *bitedx[32] = { + [0] nil, nil, "avx512vnniw4", "avx512fmaps4", + [4] "fsrm", nil, nil, nil, + [8] "avx512vp2i", nil, nil, nil, + }; + static char *biteax[32] = { + [0] nil, nil, nil, nil, + [4] nil, "avx512bf16", nil, nil, + }; + + r = cpuid(7, 0); + printbits("features", r.bx, bitebx); + printbits("features", r.cx, bitecx); + printbits("features", r.dx, bitedx); + r = cpuid(7, 1); + printbits("features", r.ax, biteax); +} + +void func13(ulong) { Res r; static char *bitsax[32] = { - [0] "xsaveopt", + [0] "xsaveopt", "xsavec", "xgetbv1", "xsaves", }; r = cpuid(13, 1); @@ -188,6 +230,7 @@ extfunc8(ulong ax) void (*funcs[])(ulong) = { [0] func0, [1] func1, + [7] func7, [13] func13, }; |