A guide to inline assembly code in GCC
A guide to inline assembly code in GCC
Posted May 2, 2016 20:33 UTC (Mon) by daney (guest, #24551)In reply to: A guide to inline assembly code in GCC by adobriyan
Parent article: A guide to inline assembly code in GCC
> write down the constraints at all. Compiler has all the knowledge
> of the hardware platform already, ...
This is not really true. The compiler has knowledge about a subset of the hardware capabilities.
Almost by definition, we write inline assembly to do things outside of what the compiler has knowledge about, because if the compiler knew, we could just write our code using the compiler input language.
To do things outside of the set of things the compiler understands, we have to communicate some aspects of what we need and what we are doing back to the compiler so that it can interact with our inline assembly in a sensible manner. For this there are the constraints.
