Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!pasteur!galileo.berkeley.edu!jbuck From: jbuck@galileo.berkeley.edu (Joe Buck) Newsgroups: comp.arch Subject: Re: bizarre instructions Message-ID: <11457@pasteur.Berkeley.EDU> Date: 26 Feb 91 19:21:49 GMT References: <9102220245.AA14853@ucbvax.Berkeley.EDU> <10278@dog.ee.lbl.gov> <6870@mentor.cc.purdue.edu> Sender: news@pasteur.Berkeley.EDU Reply-To: jbuck@galileo.berkeley.edu (Joe Buck) Lines: 16 In article <6870@mentor.cc.purdue.edu>, hrubin@pop.stat.purdue.edu (Herman Rubin) writes: [ Chris Torek's example of how to do optimal "divrem" in gcc ] |> On the other hand, I have to agree with Torek about the implementation on |> a given machine. This must depend on the hardware. But I can hope, with |> Silverman, that if the language allows writing things like this, hardware |> people might put them in. |> |> A question for Torek: Suppose I want to do the above for a variety of |> types, for example, have A, B, C, D, and F floating, but E integer. Can |> I use the same overloaded operator symbol in both cases with his approach? |> Can I do even more complicated overloaded situations, where the translation |> needs to take into account the types? I'm not Chris Torek, but the answer is: yes you can, with g++. g++ accepts exactly the same code Chris wrote for gcc, and, since it is a C++ compiler, allows functions and operators to be overloaded based on argument type. Brought to you by Super Global Mega Corp .com