[LLVMdev] bsr not implemented?

Duncan Sands baldrick at free.fr
Sat Apr 9 07:42:22 PDT 2011

Hi Gunther,

> just trying to use the dragonegg plugin with gcc on my project.
> Unfortunately I get an
> /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/include/ia32intrin.h:170:35:
> error: unsupported target builtin ‘__builtin_ia32_bsrdi’ used

yup, bsrdi and bsrsi aren't implemented (yet).  Please open a bug report about
this.  The unimplemented x86 builtins are those commented out in the file

> error. I use (and need) the "bsr" (bit scan reverse) instruction. So it
> seems it isn't implemented (yet). Can I safely use gcc inline assembly
> instead?

Yes, inline assembly should work.

  Are the some preprocessor macros defined while using dragonegg
> so that I can conditionally compile?

No, and I don't think it is possible to add any.  On the other hand
you can always add -DDRAGONEGG or something to your compilation flags
when you are using the plugin.

Ciao, Duncan.

More information about the llvm-dev mailing list