c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Implement @multitarget attribute

Open lerno opened this issue 3 years ago • 1 comments

This works similar to @cputarget but implements switching to be selected at runtime automatically.

void foo @multitarget("avx2;atom", "ivybridge", "default")
{ ... }

The above would create versions for avx2+atom, ivybridge and the default. At runtime the right one would be selected.

lerno avatar Sep 24 '22 22:09 lerno

This works like "target_clones" in Clang.

lerno avatar Sep 24 '22 22:09 lerno

There are problems with target clones in GCC/Clang as they don't work on all platforms. Better push this to userland.

lerno avatar Jun 10 '23 14:06 lerno