I did some tests and found 1 was the value that produced the smallest
code. This makes sense with C++ as the same `this' pointer is passed to
a lot of functions called.
I did find that with -mrtd as well, `__attribute__ ((regparm (0),
cdecl))' to get traditional function calls ignored all but the last
attribute (whichever way around I wrote them), so I couldn't use that
and call system libraries. So I didn't.
I never timed the differences, just looked at the code and decided which
looked best. -mregparm=1 was a clear winner in some cases because both
the pushing and popping of stack arguments were eliminated around many
function calls. > 1 caused too much register pressure in the caller,
making the code larger. The code I was examining may have been unusual:
critical functions tended to be inlines with many parameters, with most
parameters constant folding, or simply being stored in a structure,
followed by a call to an out of line function with fewer parameters,
often only the `this' pointer.
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu