Path: utzoo!mnetor!tmsoft!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!zaphod.mps.ohio-state.edu!think.com!linus!linus!faron!bs From: bs@faron.mitre.org (Robert D. Silverman) Newsgroups: comp.arch Subject: Re: bizarre instructions Message-ID: <1991Feb25.203629.5059@linus.mitre.org> Date: 25 Feb 91 20:36:29 GMT References: <9102220245.AA14853@ucbvax.Berkeley.EDU> <1991Feb25.134714.23523@linus.mitre.org> <10244@dog.ee.lbl.gov> Sender: news@linus.mitre.org (News Service) Organization: The MITRE Corporation, Bedford, MA 01730 Lines: 31 Nntp-Posting-Host: faron.mitre.org In article <10244@dog.ee.lbl.gov> torek@elf.ee.lbl.gov (Chris Torek) writes: :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: :>... what one usually wants is (A*B + C)/D and (A*B + C) mod D. :>Even on machines that support double length integer multiplies, one :>cannot put the above operations into HLL because the compiler will not :>generate the double length multiply (say 32 x 32 --> 64) nor will it :>then do the (64 /32 --> 32 bit quotient & remainder). Since A*B can overflow :>32 bits one is FORCED to call assembler routines to do this. : :Ah yes. Clearly the following does not work.... : stuff deleted... :This has its drawbacks: the syntax is distinctly un-pretty, and it :requires gcc, and it is machine-dependent. It does, however, work. Ah yes. A universal solution. Machine dependent. Ugly syntax. Only works with one compiler. Furthermore, it does nothing to contradict the assertions I made above that the arithmetic could not be done in the HLL and that assembler routines had to be called. It does inline the subroutine, however. -- Bob Silverman #include Mitre Corporation, Bedford, MA 01730 "You can lead a horse's ass to knowledge, but you can't make him think"