N-body bench

Stanislav Blinov stanislav.blinov at gmail.com
Thu Jan 30 14:21:44 PST 2014


On Thursday, 30 January 2014 at 21:54:17 UTC, bearophile wrote:

> You seem to have a quite recent CPU,

An aging i3?

> as the G++ code contains instructions like vmovsd. So you can 
> try to do the same with ldc2, and use AVX or AVX2.

Hmm...


This is getting a bit silly now. I must have some compile 
switches for g++ wrong:

g++ -Ofast -fkeep-inline-functions -fomit-frame-pointer 
-march=native -mfpmath=sse -mavx -mssse3 -flto --std=c++11 
-fopenmp nbody.cpp -o nbody-cpp

time ./nbody-cpp 50000000:
-0.169075164
-0.169059907
0:05.09 real, 5.07 user, 0.00 sys, 1140 kb, 99% cpu

ldc2 -release -O3 -disable-boundscheck -vectorize 
-vectorize-loops -ofnbody-ldc -mattr=+avx,+ssse3 nbody.d

time ./nbody-ldc 50000000:
-0.169075164
-0.169059907
0:04.02 real, 4.01 user, 0.00 sys, 1304 kb, 99% cpu


More information about the Digitalmars-d-learn mailing list