Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GCC Builtins for CPUID Checks #343

Open
Kfeavel opened this issue Dec 17, 2021 · 1 comment
Open

Use GCC Builtins for CPUID Checks #343

Kfeavel opened this issue Dec 17, 2021 · 1 comment
Assignees
Labels
cleanup Reorganization and general cleanup

Comments

@Kfeavel
Copy link
Member

Kfeavel commented Dec 17, 2021

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 Kfeavel added the cleanup Reorganization and general cleanup label Dec 17, 2021
@Kfeavel Kfeavel self-assigned this Dec 17, 2021
@micahswitzer
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Reorganization and general cleanup
Projects
None yet
Development

No branches or pull requests

2 participants