This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/83875] [feature request] target_clones compatible SIMD capability/length check
- From: "roland at rschulz dot eu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 16 Jan 2018 17:51:59 +0000
- Subject: [Bug c++/83875] [feature request] target_clones compatible SIMD capability/length check
- Auto-submitted: auto-generated
- References: <bug-83875-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83875
--- Comment #2 from Roland Schulz <roland at rschulz dot eu> ---
The main problem is that it already gets resolved in the preprocessor stage.
Thus if you have:
__attribute__((target_clones("avx","default")))
void foo(){
#if __AVX__
...
#endif
}
, it doesn't work. __AVX__ is set depending on default even for the avx clone.
Outside of target_clones it would have only a very minor advantage, that it
would work directly because it would be 1/0 rather than 1/undef, and thus
wouldn't require wrapping to be used in a constexpr context.