target_clones constexpr

Matthias Kretz m.kretz@gsi.de
Mon Jan 15 15:23:00 GMT 2018


On Donnerstag, 11. Januar 2018 20:37:55 CET Schulz, Roland wrote:
> I would like to do something like: [...]

+1

> I would like to use width to do manual strip-mining or instantiate SIMD C++
> templates. The problem is that this doesn't compile because
> __builtin_cpu_supports isn't constexpr. For every clone of foo, the
> compiler knows the SIMD support at compile time. I'm looking for a builtin
> which lets me query that in a constexpr way.
 
AFAIK there is nothing (I'd be happy to be proven wrong). I also can't think 
of any hack that would produce the value as a constant expression. (I tried 
`using v64 [[gnu::vector_size(64)]] = float; alignof(v64)`, but its alignment 
is 64, independent of the register size it uses.)

Cheers,
  Matthias
-- 
──────────────────────────────────────────────────────────────────────────
 Dr. Matthias Kretz
 GSI Helmholtzzentrum für Schwerionenforschung             https://gsi.de
 SIMD easy and portable                     https://github.com/VcDevel/Vc
──────────────────────────────────────────────────────────────────────────


More information about the Gcc-help mailing list