--- /dev/null
+#include <cpuid.h>
+#include "cpu.h"
+
+// Great article https://wiki.osdev.org/CPUID
+// GCC ref in gcc/config/i386/cpuid.h
+enum CPU_opti CPU_fetch_opti() {
+ unsigned int eax, ebx, ecx, edx;
+ __get_cpuid(1, &eax, &ebx, &ecx, &edx); // We gather the CPU specs
+
+ if (ebx & bit_AVX2) // gold tier
+ return AVX2;
+ else if (ecx & bit_AVX)
+ return AVX;
+ else if ((ecx & bit_SSE4_1) || (ecx & bit_SSE4_2)) // No idea why there are two lol
+ return SSE4;
+ else if (ecx & bit_SSE3) // Not a complete piece of trash
+ return SSE3;
+ else
+ return POTATO; // Bruh... You in the 50s or wat ?
+}