Performance of the default Node Allocator.
Dhruv Matani
dhruvbird@gmx.net
Tue Jan 20 08:37:00 GMT 2004
> >> > And one more thing. What is the equivalent of the bsf instruction
on
> >> > other architectures.
> >>
> >> BSF, bit-set-first? BSF, branch-on-set-flag? Sorry, pending
> >> understanding of your intentions to file FSF paperwork, I haven't
> >> actually looked at your code yet.
>
> > I meant bit-set-first, if that's the instruction that gets a
particular
> > non-zero bit from the right.
>
> OK, BSF does not exist on every architecture. The way to solve this
> is rewrite the algorithm to use plain C. Compare the version with
> plain C against the inline asm version. I expect you might find that
> there is little difference in speed. If a measurable difference is
> seen, I will teach you how we want to handle this in the library.
I replaced it with it's software equivalent (in plain C), and the
difference for my case is 0.02 ~ 0.03 seconds (which may go up for
larger inputs!), so is there any way that we could make the library
detect whether the current platform is i386, and if so, use the bsf
instruction, else use the software emulation?
--
-Dhruv Matani.
http://www.geocities.com/dhruvbird/
More information about the Libstdc++
mailing list