On Thu, 14 Jul 2011 06:12:00 -0400, Piotr Szturmaj <bncr...@jadamspam.pl> wrote:

Btw. How compiler intrinsics work? I see there's only bswap declaration (without body) in core.bitop. Where can I find compiler code which actually substitutes bswap() into real instructions?

A complier intrinsic is a special function that the compiler replaces with inline code. The idea is, some targets of the compiler have instructions which implement the function, so instead of doing a function call and inline assembly, the compiler just replaces the call to a single instruction (in this case bswap).

So the answer is, you won't find that code anywhere :) If you grep for bswap in the dmd source, you might find out how it does it.

-Steve

Reply via email to