Skip to content

Instantly share code, notes, and snippets.

@toddlipcon
Created April 14, 2020 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toddlipcon/573a9e5563d22ed56e38cac5aba26b30 to your computer and use it in GitHub Desktop.
Save toddlipcon/573a9e5563d22ed56e38cac5aba26b30 to your computer and use it in GitHub Desktop.
todd@va1022:/tmp$ cat test.cc
int main() {
return __builtin_cpu_supports("bmi") ? 0 : 1;
}
todd@va1022:/tmp$ g++ ./test.cc -O2 ; ./a.out && echo "supports bmi" || echo "no bmi"
no bmi
todd@va1022:/tmp$ g++ ./test.cc -O2 /opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/libgcc.a ; ./a.out && echo "supports bmi" || echo "no bmi"
supports bmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment