xyris icon indicating copy to clipboard operation
xyris copied to clipboard

Use GCC Builtins for CPUID Checks

Open Kfeavel opened this issue 2 years ago • 1 comments

See x86-Built-in-Functions for details.

__builtin_cpu_init();
if (__builtin_cpu_supports ("ssse3"))
    return ssse3_memcpy; // super fast memcpy with ssse3 instructions.
else
    return default_memcpy;

Other helpful functions:

int __builtin_cpu_is(const char* cpuname)

Not sure if these functions would be available during the bootloader to kernel bootstrap process, but if they are, then that will help a lot.

Kfeavel avatar Dec 17 '21 04:12 Kfeavel

They should be and it would make a lot of sense to use them

micahswitzer avatar Dec 21 '21 14:12 micahswitzer