Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: IA-64 (Merced) missing bsf & bsr (re: Best way to extract n from 2^n)

Author: J. Wesley Cleveland

Date: 12:09:18 09/17/99

Go up one level in this thread


On September 17, 1999 at 10:14:19, Dave Gomboc wrote:

>On September 17, 1999 at 10:00:47, Brian Richardson wrote:
>
>>On September 16, 1999 at 17:07:08, J. Wesley Cleveland wrote:
>>
>>>On September 15, 1999 at 16:57:30, Brian Richardson wrote:
>>>
>>>>I have looked at Intel's IA64 architecture guide and can't find these
>>>>instructions, although there is a popcnt.  Am I missing something?
>>>
>>>There is a Compute Zero Index, which would allow you to do it in 3 instructions.
>>
>>I saw the czx instructions, but they find the first zero byte (or 2 bytes).
>>How would you use czx to find the first non-zero element?
>>Also, seems like table lookup would still be needed to find the first/last bit
>>set?
>
>xor all of the bits first

Right, and then a 256 byte table lookup, which is small enough so it should hang
around in cache.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.