30 #if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
34 #include <sys/sysctl.h>
54 return getauxval(
type);
55 #elif HAVE_ELF_AUX_INFO
56 unsigned long aux = 0;
57 elf_aux_info(
type, &aux,
sizeof(aux));
68 return checkasm_get_x86_cpuid(buf, buflen);
69 #elif defined(__APPLE__)
70 if (sysctlbyname(
"machdep.cpu.brand_string", buf, &buflen,
NULL, 0) != 0) {
74 #elif (ARCH_ARM || ARCH_AARCH64) && defined(__linux__)
75 return checkasm_get_arm_cpuinfo(buf, buflen, affinity);
76 #elif (ARCH_ARM || ARCH_AARCH64) && defined(_WIN32)
77 return checkasm_get_arm_win32_reg(buf, buflen, affinity);
88 const int affinity =
config->cpu_affinity_set ? (int)
config->cpu_affinity : -1;
91 info_cb(priv,
"%s",
name);
95 uintptr_t archid, impid;
97 if (checkasm_get_cpuids(&vendorid, &archid, &impid) == 0) {
98 const char *vendor = checkasm_get_riscv_vendor_name(vendorid);
100 = checkasm_get_riscv_arch_name(buf,
sizeof(buf), vendorid, archid);
102 info_cb(priv,
"%s, %s, imp 0x%" PRIXPTR, vendor, arch, impid);
105 if (checkasm_has_vector()) {
106 const unsigned long vlen = checkasm_get_vlen();
107 info_cb(priv,
"VLEN = %lu bits", vlen);
112 if (checkasm_has_sve()) {
113 const unsigned sve_len = checkasm_sve_length();
114 info_cb(priv,
"SVE = %d bits", sve_len);
118 if (checkasm_has_sme()) {
119 const unsigned sme_len = checkasm_sme_length();
120 info_cb(priv,
"SME = %d bits", sme_len);
136 { 0, 0x09,
"Intel" },
137 { 0, 0x29,
"Microchip" },
138 { 0, 0x48,
"Apple" },
140 { 3, 0x6B,
"NVIDIA" },
142 { 6, 0x1E,
"Andes Tech" },
143 { 9, 0x09,
"SiFive Inc" },
144 { 10, 0x03,
"Codasip GmbH" },
145 { 11, 0x37,
"T-Head" },
146 { 14, 0x10,
"SpacemiT" },
147 { 15, 0x21,
"Tenstorrent" },
154 int b = (vb->bank << 7) | vb->offset;
165 return (v !=
NULL) ? v->
name :
"unknown";