3 ms·
And GCC/clang do get intrinsics that are nicer to use than inline asm, often with more optimization available to them as well. If the compiler does know about
by leni536 2y ago
And GCC/clang do get intrinsics that are nicer to use than inline asm, often with more optimization available to them as well.
If the compiler does know about a specific instruction, then it's better to just provide the intrinsic than try to infer it from some inline asm string.
- AshamedCaptain 2y agoOne of the benefits of gcc's powerful inline asm support is that it allows you to write new intrinsics. This is almost impossible in most other compilers, as they will do crazy things such as flushing out all registers before each asm block. Very useful for low level work.
- leni536 2y ago> it allows you to write new intrinsics I admit that it gets very close, however I think compiler provided intrinsics can be and are optimized more than ones that are implemented with inline asm, as the compiler knows about the semantics of the instruction for such an intrinsic, and not much about an inline asm one, apart from inputs/outputs/clobbers. Having said that I agree that inline asm is very useful for instructions that the compiler does not know about.