On 6 April 2016 at 07:41, Johan Engelen via Digitalmars-d <digitalmars-d@puremagic.com> wrote: > On Tuesday, 5 April 2016 at 21:29:41 UTC, Walter Bright wrote: >> >> >> I want to make it clear that dmd does not generate AFX specific code, has >> no switch to enable AFX code generation and has no basis for setting >> predefined version identifiers for it. > > > How about adding a "__target(...)" compile-time function, that would return > false if the compiler doesn't know? > > __target("broadwell") --> true means: target cpu is broadwell, false means > compiler doesn't know or target cpu is not broadwell. > > Would that work for all?
With respect to SIMD, knowing a processor model like 'broadwell' is not helpful, since we really want to know 'sse4'. If we know processor model, then we need to keep a compile-time table in our code somewhere if every possible cpu ever known and it's associated feature set. Knowing the feature we're interested is what we need.