On Mon, Nov 26, 2018 at 9:00 PM Zebediah Figura z.figura12@gmail.com wrote:
"Easier to maintain" may be subjective; I personally find the constraint mnemonics harder to read. In any case I doubt that performance should be a concern here.
The first such patch I sent was 0c216b8ca, it was motivated by clang generating references to %esp despite the use of stack instructions (and despite -fno-omit-frame-pointer). Alexandre prescribed avoiding inline assembly for all but the most simple functions, IIRC because constraints are generally trickier to get right.
I see, thanks for the explanation. By easier to maintain, I was thinking more along the lines of: less code to sift through, easier to change (no hardcoded offsets), not having to take into account calling conventions, etc.
But I'm probably biased here due to my experience with inline assembly and a little bit of GCC's internals, so asm operands and constraints are sort of second nature to me and I find them very straightforward (I just think of the asm statements as a black box, with inputs and outputs). But that's most likely not the case for most people, so I didn't realize it, and I thought there were other reasons. (well, except for x87 reg constraints, those are hard to understand by anyone)