Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

__builtin_shuffle, GCC compatibility, and __has_builtin

$
0
0

I recently tried to build one of my projects (SIMDe) with ICC, and it failed due to __builtin_shuffle not being supported. There are ifdefs around the code in question which use __GNUC__ and __GNUC_MINOR__ to check for GCC ≥ 4.7 before using __builtin_shuffle, but ICC 18.0 masquerades as GCC 7 so the code was enabled.

I don't have any objection to ICC not supporting every feature GCC does, but masquerading as a version of GCC which supports something then not supporting it is quite frustrating. Clang has resolved this by simply only claiming to support the extensions provided by GCC 4.2, and added __has_builtin (among others) to check for support for specific builtins. Is there any hope of ICC adopting this method? Is there some other way to identify which features are actually present?


Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>