Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Reply from Intel about BSF/BSR

Author: Sune Fischer

Date: 03:18:41 02/01/02

Go up one level in this thread


On February 01, 2002 at 05:54:20, David Rasmussen wrote:

>On January 31, 2002 at 15:25:55, Severi Salminen wrote:
>
>>Hi!
>>
>>This is what I got from intel about bsf/bsr instructions. I asked this: "In what
>>situations bsf/bsr eax,VARIABLE changes the contents of eax, if VARIABLE is 0?"
>>
>>This is what they say:
>>
>>"Although the value appears unchanged in some cases, the definition of this
>>instruction applies to all IA-32 processors starting with the Intel 386.  That
>>stated, the BSR and BSF instructions both work as defined on all processors
>>previously noted.  So even though it might be deterministic in a specific
>>implementation, no information will be provided on special cases."
>>
>>So practically I got no info at all. Still it is just speculation to try to
>>guess if there are systems where eax might be changed. In Requiem I make a small
>>test (which of course can't cover all situations) to see if bsf/bsr changes eax
>>in above situation and exit if this is that case.
>>
>>Severi
>
>If you ever encounter a system where eax _is_ changed, your program will surely
>crash very quickly, so you will know instantly. Why don't you just assume what
>everybody else is assuming, and then if you ever experience yourself, or get a
>user report that the program crashes instantly and deterministically, you can
>deal with it. It will never happen :)
>
>Alternatively, you could check at the beginning of your program, whether it
>works or not. If it doesn't, you could write a very nice error message and quit.
>That way, it will be 100% clear what have happened. Again, it will never happen,
>but if you want to feel safe.
>
>What will not happen, is that you encounter a system where it doesn't work, and
>then your program just plays worse, without you knowing.
>
>/David

I would go for the small test as part of the initialization :)
Reason is, that 5 years from now, the chips may change and he will have
forgotten all abut this little problem, and then he has 100k lines to debug :(

-S.



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.