Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!apollo!rehrauer From: rehrauer@apollo.HP.COM (Steve Rehrauer) Newsgroups: comp.sys.apollo Subject: Re: Floating point (was Re: cc -g makes programs run faster?) Message-ID: <4ce8cf0c.20b6d@apollo.HP.COM> Date: 19 Sep 90 22:40:00 GMT References: <9009181421.AA22513@richter.mit.edu> <4ce36164.12c9a@digital.sps.mot.com> Sender: root@apollo.HP.COM Reply-To: rehrauer@apollo.HP.COM (Steve Rehrauer) Organization: Hewlett-Packard Apollo Division - Chelmsford, MA Lines: 41 In article <4ce36164.12c9a@digital.sps.mot.com> chen@digital.sps.mot.com (Jinfu Chen) writes: >>A factor of three speed increase (for floating point code) is usually >>what I get from going from a " cpu any" (the default) to a "cpu 3000" >>(which turns on the use of inline floating point code and the 68020 >>specific addressing modes). > >There is another compiler switch (cc 6.7 only) that can make floating point >code run faster, "-def BUILTINS" (or "-D_BUITLINS" in /bin/cc). With >combination of the "cpu 3000", performance can be sped up significantly. "_BUILTINS" causes some common math functions to be emitted as inline code, if the CPU model permits (3000 does): abs sin cos tan log exp atan atan2 sqrt Also note that "_BUILTINS" doesn't only control floating-point, it also enables inline coding of some common C string functions: strcpy strncpy strcat strncat strcmp strncmp strlen You can get significant performance improvements with "_BUILTINS" if you do a lot of string operations. You can get good improvements for strings when compiling for any CPU model (even "any" :). At 6.7, you always get the definitions for _builtin_routines sucked in by virtue of apollo_$std.h, which the compiler always included. (The definitions are surrounded by #ifdef _BUILTINS, so saying "-def _BUILTINS" or "-D_BUILTINS" on the command-line simply enables them. Enabling them tells the code-generator that if it believes it can do better than a library-call, to go ahead and do so.) However, I believe that the 6.8 (cr1.0) compiler, which will include a new ANSI preprocessor, won't by default understand what to do with "_BUILTINS". I believe that in order to have the old _builtins_routines behaviour happen, that you'll either need to compile with the new "-nansi" (no ANSI behaviour) switch, or to specifically include and/or include-files. Perhaps John Vasta can correct and/or supplement what I've said about the ANSI changes. -- >>"Aaiiyeeee! Death from above!"<< | (Steve) rehrauer@apollo.hp.com "Spontaneous human combustion - what luck!"| Apollo Computer (Hewlett-Packard)