Any usable SIMD implementation?

Kai Nacke via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 7 03:52:42 PDT 2016


On Thursday, 7 April 2016 at 03:27:31 UTC, Walter Bright wrote:
> Then,
>
>     void app(int simd)() { ... my fabulous app ... }
>
>     int main() {
>       auto fpu = core.cpuid.getfpu();
>       switch (fpu) {
>         case SIMD: app!(SIMD)(); break;
>         case SIMD4: app!(SIMD4)(); break;
>         default: error("unsupported FPU"); exit(1);
>       }
>     }
>

glibc has a special mechanism for resolving the called function 
during loading. See the section on the GNU Indirect Function 
Mechanism here: 
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/W51a7ffcf4dfd_4b40_9d82_446ebc23c550/page/Optimized%20Libraries

Would be awesome to have something similar in druntime/Phobos.

Regards,
Kai


More information about the Digitalmars-d mailing list