Author: Robert Hyatt
Date: 11:00:14 02/18/04
Go up one level in this thread
On February 18, 2004 at 10:34:01, Dan Honeycutt wrote: >On February 17, 2004 at 20:58:28, Robert Hyatt wrote: > >>On February 17, 2004 at 17:38:13, Dan Honeycutt wrote: >> >>>I realize I'm adding where you are subtracting due to different numbering. What >>>I'm saying is that 3/4 of the time I still have to make "an adjustment" to the >>>value bsf/bsr gives. Do you not have to make an adjustment 4/4 of the time, or >>>do you have to make 2 adjustments? >>> >>>Dan H. >> >> >>I do it at the end, one time. IE for the Opteron, it looks like this: >> >>movq %rax,63 >>bsfq %rbx, %rcx >>subq %rcx, %rax ; done, result in rax (64 bit reg). >> >>for X86, I do it in three steps: >> >>first check one half, then add 32, >>second check other half >>subtract from 63 >> >>I can post the x86 if you want... > >I'm with you. on x86 I'm > >check one half, if there is a bit I'm done >check other half >add 32 > >I get a slight advantage on 32 bit but more on 64 bit where I do nothing but you >still have to subtract. > >Thanks for the help. >Dan H. I don't think this is a major issue, but the register needed for the subtract certainly hurts on an X86 box. AMD64 has 8 extra registers so it becomes less of an issue there...
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.