From: Ayabusa Date: Thu, 4 Jun 2026 18:49:55 +0000 (+0200) Subject: Added cpu name helper X-Git-Url: https://git.ayabusa.dev/?a=commitdiff_plain;h=35811734db33e213a9e2ae90a056a25ddd2e4c6e;p=thoryum.git Added cpu name helper --- diff --git a/src/cpu.c b/src/cpu.c index 33cfdeb..791b964 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -1,4 +1,5 @@ #include +#include #include "cpu.h" // Great article https://wiki.osdev.org/CPUID @@ -18,3 +19,16 @@ enum CPU_opti CPU_fetch_opti() { else return POTATO; // Bruh... You in the 50s or wat ? } + +void CPU_opti_name(char[5] buf, enum CPU_opti opti) { + if (opti == AVX2) + strcpy(buf, "AVX2"); + else if (opti == AVX) + strcpy(buf, "AVX\0"); + else if (opti == SSE4) + strcpy(buf, "SSE4"); + else if (opti == SSE3) + strcpy(buf, "SSE3"); + else + strcpy(buf, "i386"); +} diff --git a/src/cpu.h b/src/cpu.h index b6ee415..dd7eeb8 100644 --- a/src/cpu.h +++ b/src/cpu.h @@ -10,5 +10,6 @@ enum CPU_opti { }; enum CPU_opti CPU_fetch_opti(); +void CPU_opti_name(char[5] buf, enum CPU_opti opti); #endif