This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: _bit_scan_forward


"Feike Boomstra" <f.p.boomstra@gmail.com> writes:

> I didn't get it from the source code. I found it here:
> http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespace____gnu__cxx.html
> and that looked to me as an interface description.
> 
> The build-in bit_scan_forward function implements the bsf instruction of the
> X386 instructionset. It is in the intel c-compiler and the ms c-compiler.

This is a reason that I personally don't like doxygen documentation.
It isn't clearly separated into interface functions and internal
functions.  Take my word for it: don't call that function.

Now, if you look at the definition of the function, you will see that
it is this:

  inline size_t 
  _Bit_scan_forward(size_t __num)
  { return static_cast<size_t>(__builtin_ctzl(__num)); }

So how about just calling __builtin_ctzl instead?  That is documented
here:
    http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Other-Builtins.html

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]