Created
February 27, 2023 07:00
-
-
Save maneesh29s/340634f9390754bf80446a3bb26a0ecf to your computer and use it in GitHub Desktop.
Gist to check which intrinsics are present in a machine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| int main(int argc, char const *argv[]) | |
| { | |
| #ifdef __amd64__ | |
| std::cout << "__amd64__ detected" << std::endl; | |
| #endif | |
| #ifdef __x86_64__ | |
| std::cout << "__x86_64__ detected" << std::endl; | |
| #endif | |
| #ifdef __arm__ | |
| std::cout << "__arm__ detected" << std::endl; | |
| // #ifdef __ARM_ARCH_'V'__ | |
| // std::cout << " Arm version is: " << __ARM_ARCH_'V'__ << std::endl; | |
| // #endif | |
| #endif | |
| #ifdef __aarch64__ | |
| std::cout << "__aarch64__ detected" << std::endl; | |
| #endif | |
| #ifdef __SSE__ | |
| std::cout << "__SSE__ detected" << std::endl; | |
| #endif | |
| #ifdef __SSE2__ | |
| std::cout << "__SSE2__ detected" << std::endl; | |
| #endif | |
| #ifdef __SSE3__ | |
| std::cout << "__SSE3__ detected" << std::endl; | |
| #endif | |
| #ifdef __AVX2__ | |
| std::cout << "__AVX2__ detected" << std::endl; | |
| #endif | |
| #ifdef __AVX2__ | |
| std::cout << "__AVX2__ detected" << std::endl; | |
| #endif | |
| #ifdef __ARM_NEON__ | |
| std::cout << "__ARM_NEON__ detected" << std::endl; | |
| #endif | |
| #ifdef __SSE2__ | |
| std::cout << "__SSE2__ detected" << std::endl; | |
| #endif | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment