Compile-Time Target CPU Feature Detection in C
Comments
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Summary
This article explains how C programs can detect, at compile time, which instruction set features the compiler's target supports, as opposed to runtime CPU detection via CPUID or Linux auxiliary vectors.