N-body bench

Stanislav Blinov stanislav.blinov at gmail.com
Wed Jan 29 09:11:38 PST 2014


On Wednesday, 29 January 2014 at 16:54:54 UTC, bearophile wrote:
> Stanislav Blinov:
>
>> I meant how to make it compile with ldc2? I've translated the 
>> code, it compiles and works with dmd (although segfaults in 
>> -release mode for some reason, probably a bug somewhere).
>>
>> But with ldc2:
>>
>> nbody.d(68): Error: undefined identifier __simd
>> nbody.d(68): Error: undefined identifier XMM
>>
>> those are needed for that sqrt reciprocal call.
>
> Usually for me ldc2 works with simd. Perhaps you have to show 
> us the code, ask for help in the ldc newsgoup, or ask for help 
> in the #ldc IRC channel.

It's a direct translation of that C++ code:

http://dpaste.dzfl.pl/89517fd0bf8fa

This line:

distance = __simd(XMM.CVTPS2PD, __simd(XMM.RSQRTPS, 
__simd(XMM.CVTPD2PS, dsquared)));

The XMM enum and __simd functions are defined only when D_SIMD 
version is set. ldc2 doesn't seem to set this, unless I'm missing 
some sort of compiler switch.

>
> Regarding dmd with -release, I suggest you to minimize the code 
> and put the problem in Bugzilla. Benchmarks are also useful to 
> find and fix compiler bugs.

I'm already onto it :)


More information about the Digitalmars-d-learn mailing list