Xref: utzoo comp.sys.intel:503 comp.lang.c:12084 comp.arch:6157 Path: utzoo!attcan!uunet!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.sys.intel,comp.lang.c,comp.arch Subject: Re: Moving floating point values around Message-ID: <11983@steinmetz.ge.com> Date: 25 Aug 88 18:14:09 GMT References: <4256@lynx.UUCP> <13148@mimsy.UUCP> <1121@scolex> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Distribution: na Organization: General Electric CRD, Schenectady, NY Lines: 31 Please excuse the long quote, I couldn't take out much more and have anyone understand what the topic was. In article <1121@scolex> seanf@sco.COM (Sean Fagan) writes: | In article <4256@lynx.UUCP> m5@lynx.UUCP (Mike McNally) writes: | > [ could you use integer load and store to move float on 80*86? ] | | If I remember correctly, both our '286 and '386 compilers will generate MOVS | instructions to push FP-values on the stack; they might (I haven't checked) | even generate them for non-stack-pushes. Yep, just dropped into a subshell | and checked: neither compiler will uses FLD and FSTP if possible (what if | you don't have an FPU?! Horror!). I just logged onto a machine running SCO 2.2.2 for 386, and tried this for both 286 and 386 compilers. While the code: a = b; generates the more efficient code with integer moves or movs, initializing auto variables is still done with floating operations. Perhaps that could be mentioned to the people who try to look better on benchmarks. Example: float flt1, flt2 = 1.23; /* done with FLD, FSTP */ flt1 = flt2; /* mov eax */ The compiler generates the good code for assign other than initialization even without the -O switch. Half a congratulation for half a job well done (or is that a job well half done?). -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me