logoalt Hacker News

convolvatrontoday at 1:07 PM1 replyview on HN

that's kind of not true. inline asm lets me refer to the register that the compiler placed a value in.

lets say I really want to use popcnt in my inner loop. with inline assembly I can just shove it in there. external linkage forces a function call overhead that can't be inlined, which obviates any benefit I might have had from using the specialized instruction.


Replies

treydtoday at 2:01 PM

You'd probably also be able to use an intrinsic to avoid the pain of inline asm and make it portable.

show 2 replies