From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102b75,e489d6e4973d889f X-Google-Attributes: gid102b75,public X-Google-Thread: 1164f8,e489d6e4973d889f X-Google-Attributes: gid1164f8,public X-Google-Thread: 115614,e489d6e4973d889f X-Google-Attributes: gid115614,public X-Google-ArrivalTime: 2001-08-28 17:30:33 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.189.224.109!bignews.mediaways.net!abq.news.ans.net!news.chips.ibm.com!newsfeed.btv.ibm.com!hanover.torolab.ibm.com!tornews.torolab.ibm.com!ausnews.austin.ibm.com!not-for-mail From: mccalpin@gmp246.austin.ibm.com (McCalpin) Newsgroups: comp.arch,comp.sys.dec,comp.unix.aix Subject: Re: Can POWER4, 5 etc continue where Alpha was stopped? Date: 29 Aug 2001 00:03:44 GMT Organization: IBM, Austin, Tx. Message-ID: <9mhbh0$pbq$1@ausnews.austin.ibm.com> References: <88525dde.0108260914.7c63d8c3@posting.google.com> <9mgps0$12ee$1@ausnews.austin.ibm.com> NNTP-Posting-Host: gmp246.austin.ibm.com Xref: archiver1.google.com comp.arch:15874 comp.sys.dec:6752 comp.unix.aix:22674 In article , Bruce Hoult wrote: >In article <9mgps0$12ee$1@ausnews.austin.ibm.com>, >mccalpin@austin.ibm.com wrote: > >> , and [I] have only found >> one use for [pop count] in my own experience..... (It is a very easy way >> to determine if an integer is a power of two -- though I don't >> usually care about how long it takes to make this determination.) > >It's not needed for that -- (x & (x-1)) is zero IFF x is a power of two >(or zero). It works by clearing the least significant set bit. Ouch -- that sort of bit twiddling makes my poor Fortran brain hurt. I hate it when I run across coding like this. >I'm sure you knew this. I did not know it, but I am trying to forget it as fast as I can! -- John D. McCalpin, Ph.D. mccalpin@austin.ibm.com Senior Technical Staff Member IBM POWER Microprocessor Development "I am willing to make mistakes as long as someone else is willing to learn from them."