www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics



D.gnu - GDC's std.math does not take advantage of GCC intrinsics

↑ ↓ ← downs <default_357-line yahoo.de> writes:
I'm seeing huge speed-ups in a benchmark between std.math's sqrt and

 import gcc.builtins;
 real sqrt(real r) { return __builtin_sqrtl(r); }.

I presume this is because GDC's std.math uses library functions, which become function calls; whereas __builtin_sqrtl is compiled as a single assembler instruction. Is there any specific reason why GDC's current std.math does not take advantage of GCC's built-in functions? If there isn't, I'd suggest std.math be changed to call these functions instead, which could lead to significant speed gains in math-heavy programs. See also: http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Other-Builtins.html#Other-Builtins Looking forward to opinions/explanations, --downs
Nov 13 2007
↑ ↓ Bill Baxter <dnewsgroup billbaxter.com> writes:
downs wrote:
 I'm seeing huge speed-ups in a benchmark between std.math's sqrt and
 
 import gcc.builtins;
 real sqrt(real r) { return __builtin_sqrtl(r); }.

I presume this is because GDC's std.math uses library functions, which become function calls; whereas __builtin_sqrtl is compiled as a single assembler instruction. Is there any specific reason why GDC's current std.math does not take advantage of GCC's built-in functions? If there isn't, I'd suggest std.math be changed to call these functions instead, which could lead to significant speed gains in math-heavy programs. See also: http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Other-Builtins.html#Other-Builtins Looking forward to opinions/explanations, --downs

So was that the main culprit for the slowdowns in your raytracer test? --bb
Nov 13 2007
↑ ↓ → downs <default_357-line yahoo.de> writes:
Bill Baxter wrote:
 So was that the main culprit for the slowdowns in your raytracer test?
 
 --bb

Nope, afraid not. Would have been nice though :) --downs, still clueless about gdc performance
Nov 13 2007