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: Brian Richardson

Date: 12:56:37 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

Ok, I assume you mean xor like compliment--that only switches 0s to 1s and vice
versa.  Now, how does czx help, since it only finds all zero elements, wouldn't
it only find the first zero element that originally was all ones, and not find
any mixed 1s and 0s?
>
>Dave



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.