Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!charon!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.arch Subject: Re: bizarre instructions Message-ID: <2998@charon.cwi.nl> Date: 21 Feb 91 11:04:13 GMT References: <9102210042.AA12291@ucbvax.Berkeley.EDU> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 37 In article <9102210042.AA12291@ucbvax.Berkeley.EDU> JBS@IBM.COM writes: >> Herman Rubin says: >> 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. > 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. You must have a very limited experience. You do it only by multiplying by 1/pi if you are willing to forego a lot of precision. (Check your favorite hand-held calculator. If sin(pi) = 0, the implementation is wrong!) >> Peter Montgomery says: >> 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? No. That would require that the hardware has some support for 64 bit ints. What Peter Montgomery asks is: given three ints (a, b, c), multiply a and b together to a double size int; add c to it; calculate quotient and remainder when dividing by n. Most 32 bit processors provide the instructions to do just that. Asking for an integer*8 data type would be asking for a 64*64 multiply which would than be used, and would be much slower. > 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. Ask Seymour Cray why that instruction was put in the Cray-1 as an afterthought. -- dik t. winter, cwi, amsterdam, nederland dik@cwi.nl Brought to you by Super Global Mega Corp .com