Any usable SIMD implementation?

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 7 17:30:37 PDT 2016


On 4/7/2016 3:52 AM, Kai Nacke wrote:
> 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.

We already have core.cupid, which covers most of what that article talks about. 
The indirect function thing appears to be a way to selectively load from various 
dlls. But that can be done anyway with core.cpuid and dynamic dll loading, so 
I'm not sure what advantage it brings.



More information about the Digitalmars-d mailing list