home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.programming
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uunet.ca!canrem!telly!druid!darcy
- From: darcy@druid.uucp (D'Arcy J.M. Cain)
- Subject: Re: floating point routines with double precision
- Message-ID: <1992Jul22.120724.3466@druid.uucp>
- Date: Wed, 22 Jul 1992 12:07:24 GMT
- References: <2A65BFF1.14443@noiro.acs.uci.edu> <54561@mentor.cc.purdue.edu>
- Organization: D'Arcy Cain Consulting
- Lines: 23
-
- hrubin@pop.stat.purdue.edu (Herman Rubin) writes:
- >Use assembler for you particular machine if you want any speed. Even
- >setting it up for the compiler will be a major headache, and you will
- >have just as many problems with object size.
-
- Here is how I set up my compiler to generate machine code for a floating
- point operation:
-
- result = value/4.586; /* Well it does :-) */
-
- Seriously, there may be cases where the compiler doesn't give the fastest
- code for a given operation but they are probably the rare exception. With
- modern compilers the chances are that hand coded assembly won't be as fast
- and are certainly longer to program. A much better method of speeding up
- critical sections of code is inlining. That's why the current Gnu compiler
- internally inlines some of the more common string functions. Function
- call overhead is still relatively expensive on most popular CPUs.
-
- --
- D'Arcy J.M. Cain (darcy@druid) |
- D'Arcy Cain Consulting | There's no government
- Toronto, Ontario, Canada | like no government!
- +1 416 424 2871 DoD#0082 |
-