Richard Guenther <richard.guent...@gmail.com> writes: > But then can't people use a pure assembler stub instead? Without > inlining there isn't much benefit left from writing > > void f1(int arg) > { > register int a1 asm("r8") = 10; > register int a2 asm("r1") = arg; > > asm("scall" : : "r"(a1), "r"(a2)); > } > > instead of > > f1: > mov r8, 10 > mov r1, rX > scall > ret > > in a .s file no? I doubt much prologue/epilogue is needed. > > Or even write > > void f1(int arg) > { > asm("mov r8, %0; mov r1 %1; scall;" : : "g"(a1), "g"(a2) : "r8", "r1"); > }
Of course in practice people _do_ want to use it with f1 inlined, where using reg variables (or alternatively, some expanded constraint language for the asm parameters) can really get rid of tons of unnecessary asm moves, and they want the compiler to guard against conflicts. -Miles -- "Whatever you do will be insignificant, but it is very important that you do it." Mahatma Gandhi