On Tuesday, 5 April 2016 at 21:41:46 UTC, Johan Engelen 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?

Yes, something like that is what I am looking for.
Two nitpicks:
1. __target("broadwell") is not well API. Something like that would be more efficient:
enum target = __target();
// .. use target
2. Is it possible to reflect additional settings about instruction set? Maybe "broadwell,-avx"?

Reply via email to