Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!tut.cis.ohio-state.edu!abvax!iccgcc!herrickd From: herrickd@iccgcc.decnet.ab.com (daniel lance herrick) Newsgroups: comp.arch Subject: Re: standard extensions Message-ID: <3439.27ca4e40@iccgcc.decnet.ab.com> Date: 26 Feb 91 17:02:08 GMT References: <3381.27c548c3@iccgcc.decnet.ab.com> <1991Feb25.135057.23667@linus.mitre.org> <1991Feb25.201406.18643@bingvaxu.cc.binghamton.edu> Lines: 32 In article <1991Feb25.201406.18643@bingvaxu.cc.binghamton.edu>, kym@bingvaxu.cc.binghamton.edu (R. Kym Horsell) writes: [long and eloquent demonstration that one less divide instruction in the loop will have no significant effect on computation time] > To summarize: I don't think provision of a combined divide/remainder > (or divide/modulus for that matter) instruction will necessarily > speed up the total running time of any real programs appreciably > (i.e. more than, say, 10%). Perhaps Bob Silverman could illustrate > some circumstance which contradicts this? > But I still have to obfuscate the code with q = dividend / divisor r = dividend % divisor /* even the operator is bad */ when what I want is (q, r) = dividend divided by divisor Division is defined as producing a unique quotient and remainder in the first abstract algebra course. Every hardware divide instruction I have ever seen produces both quotient and remainder in one operation. (nothing else makes any sense). Even the 709 prototype for FORTRAN provided both results. My main objection is to the obfuscation of the expression of an algorithm in the programming language. This is a place where the computer architects have done the right thing and the software architects have all ignored this right thing and done a wrong thing. Of course, we all know that the world is floating point, the perpetrators of FORTRAN told us that that is what is REAL. dan herrick eschew obfuscation herrickd@iccgcc.decnet.ab.com Brought to you by Super Global Mega Corp .com