On 10/22/2014 12:44 PM, "Ola Fosheim Grøstad" <ola.fosheim.grostad+dl...@gmail.com>" wrote:
On Wednesday, 22 October 2014 at 19:24:54 UTC, Walter Bright wrote:
On 10/22/2014 4:30 AM, "Ola Fosheim Grøstad"
<ola.fosheim.grostad+dl...@gmail.com>" wrote:
On a related note, how do you provide multiple execution paths based on cpuid
without making the code dirty?

https://github.com/D-Programming-Language/druntime/blob/master/src/rt/arrayfloat.d


Hmm… that looks a bit complicated. I was thinking about compiling the same
function with different backend settings, so you get myfunc_AVX() and
myfunc_SSE() from the same function body.

Make 3 modules:

1. myfunc() as a template function
2. avx.d that imports myfunc() and instantiates it with avx backend settings.
3. sse.d that imports myfunc() and instantiates it with sse backend settings.

Reply via email to