Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!pikes!aspen.craycos.com!pmk From: pmk@craycos.com (Peter Klausler) Newsgroups: comp.arch Subject: Re: bizarre instructions Message-ID: <1991Feb23.223014.12116@craycos.com> Date: 23 Feb 91 22:30:14 GMT References: <9102210042.AA12291@ucbvax.Berkeley.EDU> <2998@charon.cwi.nl> <3386.27c55e18@iccgcc.decnet.ab.com> Organization: Cray Computer Corporation Lines: 18 In article <2998@charon.cwi.nl>, dik@cwi.nl (Dik T. Winter) writes: > > 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. Almost right. A scalar population count instruction was not new to the CRAY-1, since the CDC 6600 and descendents all supported it ("CXi Xk", opcode 47). What was missing on some CRAY-1As and CRAY-1Bs was a vector population count instruction. The S and M models do support that. The CRAY-1 (and X-MP/Y-MP followons) *is* missing a vector leading zero count instruction, though it's there in scalar form. Need a CRAY-2 for the vector version. Both operations are quite useful, as has been noted in comp.arch often in the past. Brought to you by Super Global Mega Corp .com