From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,b79a29863eb727e7 X-Google-Attributes: gid111c93,public From: Craig Burley Subject: Re: gcc vs Dec Unix c Date: 1998/01/09 Message-ID: #1/1 X-Deja-AN: 314463655 References: <884291935.1575288842@dejanews.com> <694nm1$74c$1@news2.xs4all.nl> <884364975.2133262340@dejanews.com> <695t9e$kft$1@agate.berkeley.edu> Organization: Cygnus Support Newsgroups: comp.os.linux.alpha peterm@landau.EECS.Berkeley.EDU (Peter Mardahl) writes: > I believe that x86 implements cos in HARDWARE, while Alpha does NOT. > > Therefore, if you're doing cos() quite a lot, the x86 will stomp > alpha, and most other RISC. The former is true. The latter does not follow. Go read up on computer architecture (see comp.arch and related FAQs for starting in-line references) to find out why. (There are *some* operations that are best done "in hardware", by which you really mean "via explicit instructions instead of using `ordinary' instructions". I don't *think* cos() is one of these. An excellent example of one would be bit-reverse, e.g. where bit_reverse(i), with i being a 64-bit integer, returns a number j such that bit 0 of j equals bit 63 of i, bit 1 of j equals bit 62 of i, and so on. A less-certain example might be population count (returns the number of `1' bits in i). These sorts of instructions benefit from low-level specialized hardware especially compared to traditional low-level instructions like add, shift, and test. CISC machines were designed assuming there was a general advantage to "compressing" the instruction stream that typically outweighed that of executing a simpler instruction stream faster; RISC machines are designed with the opposite general assumption, and the Alpha is a pretty solid proof that it's true, for now, I believe. But cos() is *not* a low-level operation.) -- "Practice random senselessness and act kind of beautiful." James Craig Burley, Software Craftsperson burley@gnu.org