ldc (LLVM backend for the D Programming Language) has x86-64 support

Hello everyone,

I just thought I would let people here know that ldc (llvm backend for the D Programming Language) is getting pretty usable (a few larger libraries compile) and it now has x86-64 support added. I decided to run some timings on some D and C++ code to compare ldc to dmd (the mainline compiler), gdc (the gcc based D compiler) and g++. I used a ray tracing program found in this thread (make sure to use the code mentioned later in the thread as it has some optimizations):

Go to digitalmars.com/ webnews/ newsgroups.php?renew=1 and search for: “D slower than C++ by a factor of two for simple raytracer (gdc)”

There are versions of the tracer for D and C++ that are quite comparable. Here are some timings I got on an AMDx86-64 running Fedora Core Linux. Timings are averaged over 6 runs.

llvm-g++4.0.1 5.76 (build 5449…backend from svn today)
ldc-rev736 6.68
g++4.1.2 6.72
gdc0.24 7.45
g++4.3.1 7.66
dmd1.030 14.52

As you can see D is NOT that much slower for the ray tracer, when using the proper compiler and options :wink: Dmd doesn’t optimize very well here.

I think LLVM performs quite admirably here and I am glad ldc uses it for a backend. The thread mentions the optimizations used for each compiler (ldc uses the same options as dmd).

Just thought I would let people know,

K.Wilson

P.S. I am not sure if this counts as another “supported language” for LLVM yet, but I think it is getting close.

Hello everyone,

I just thought I would let people here know that ldc (llvm backend for the D Programming Language) is getting pretty usable (a few larger libraries compile) and it now has x86-64 support added. I decided to run some timings on some D and C++ code to compare ldc to dmd (the mainline compiler), gdc (the gcc based D compiler) and g++. I used a ray tracing program found in this thread (make sure to use the code mentioned later in the thread as it has some optimizations):

Go to digitalmars.com/ webnews/ newsgroups.php?renew=1 and search for: “D slower than C++ by a factor of two for simple raytracer (gdc)”

Wow, very very nice! Have you pointed this out to the other D users?

-Chris

Maybe we could get LDC added to the “User List”, under “Open Source Projects”?

“”
LDC - LLVM D Compiler
Compiler for the D programming language using LLVM as backend.
http://www.dsource.org/projects/ldc
“”

Something like that :slight_smile: