Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!chalmers.se!mathrt0.math.chalmers.se!augustss From: augustss@cs.chalmers.se (Lennart Augustsson) Newsgroups: comp.arch Subject: Re: bizarre instructions Message-ID: <1991Feb25.182658.27106@mathrt0.math.chalmers.se> Date: 25 Feb 91 18:26:58 GMT References: <9102220245.AA14853@ucbvax.Berkeley.EDU> <1991Feb25.134714.23523@linus.mitre.org> Sender: news@mathrt0.math.chalmers.se (Evald Nyhetsson) Organization: Dep of Computer Sciences, Chalmers, Gothenburg Lines: 24 In article <1991Feb25.134714.23523@linus.mitre.org> bs@gauss.mitre.org (Robert D. Silverman) writes: >In article <9102220245.AA14853@ucbvax.Berkeley.EDU> JBS@IBM.COM writes: >> > >stuff deleted > >> As for getting both q and r this is easy just write >> iq=ia/ib >> ir=mod(ia,ib) >>A reasonable compiler will only generate 1 divide with remainder. > >I have done numerical analysis work and multi-precision arithmetic on many >different machines and operating systems. > >Only ONCE have I ever seen a compiler bright enough to do the above >optimization. (Burroughs 6700; a stack machine; Algol 68) > I've seen another one! Well, it's not a compiler it's the MIPS assembler which recognises what you are doing. I think this was very nice, since that meant that I didn't have to build this optimisation into my compiler, I got it for free from the assembler. -- Lennart Augustsson [This signature is intentionally left blank.] Brought to you by Super Global Mega Corp .com