Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!IBM.COM!JBS From: JBS@IBM.COM Newsgroups: comp.arch Subject: bizarre instructions Message-ID: <9102210042.AA12291@ucbvax.Berkeley.EDU> Date: 21 Feb 91 00:14:02 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 34 Herman Rubin says: Do you mean to tell me that computations involving both integers and floating-point numbers are not important? Or that dividing floats by floats, obtaining an integer quotient and a floating remainder, likewise? That particular step is the first step of any trigonometric or exponential function computation when it is not known in advance that the argument is small. There are other periodic and related functions for which this is useful. It would also speed up interpolation, etc. Since argument reduction for the trigonometric functions is done in practice by multiplying by 1/pi I do not see how it would ben- efit from your proposed instruction. I believe this instruction would have little general utility. An efficient way to do the fortran "x=dint(y)" is important. This is lacking on the Risc System 6000 as was pointed out in a Los Alamos report. By the way is it true that it is impossible to reasonably express this in ADA? Peter Montgomery says: Yes, most programs are written in these languages. As Dan says, the language designers made mistakes. During one review period for Fortran 90, I requested an operation which takes four nonnegative integers a, b, c, n with a < n or b < n (c is optional and defaults to 0). The requested operation returns q and/or r, where a*b + c = q*n + r and 0 <= r < n Why didn't you ask for an integer*8 data type? Wouldn't that give you what you want and have much more general utility? I would like an instruction which counts the number of ones in the binary representation of an integer but I find it hard to argue that this would be widely used. James B. Shearer