Hi everyone,<br>If I'm with GCC and I want to check at runtime if a given machine got a given instruction set, I use something like that<br><pre style class="lang-c prettyprint prettyprinted"><code><span class="com">#include</span><span class="pln"> </span><span class="str"><stdio.h></span><span class="pln">

</span><span class="typ">int</span><span class="pln"> main</span><span class="pun">()</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">__builtin_cpu_supports</span><span class="pun">(</span><span class="str">"mmx"</span><span class="pun">))</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
        printf</span><span class="pun">(</span><span class="str">"\nOK\n"</span><span class="pun">);</span><span class="pln">
    </span><span class="pun">}</span><span class="pln"> </span><span class="kwd">else</span><span class="pln">
        printf</span><span class="pun">(</span><span class="str">"\nKO\n"</span><span class="pun">);</span><span class="pln">
    </span><span class="kwd">return</span><span class="pln"> </span><span class="pun">(</span><span class="lit">0</span><span class="pun">);</span><span class="pln">
</span><span class="pun">}</span></code></pre>as documented here <a href="http://gcc.gnu.org/onlinedocs/gcc/X86-Built_002din-Functions.html">http://gcc.gnu.org/onlinedocs/gcc/X86-Built_002din-Functions.html</a><br><br>Now under clang I can't find something similar, I can't find built-in functions at all to tell you the <span id="result_box" class="short_text" lang="en"><span class="hps">truth, I noticed that there are "strange" functions named llvm.xxx.xxx but they don't really look like builtin functions at all, at least they don't offer the same functionality of what is offered by this simple GCC function.<br>
<br>Notice that I want function to check this at runtime, I'm not considering solving this with preprocessor macro or anything at compile-time.<br>How I can solve this with Clang ? How do I check for support for a given set of instructions ?<br>
<br>Thanks.<br></span></span>