At the C++ ABI switch, make -mregparm=1 the default on x86?
Jamie Lokier
egcs@tantalophile.demon.co.uk
Wed Mar 8 14:51:00 GMT 2000
(x86 only)
Once upon a time, I was doing experiments with an embedded x86
application using C++.
I tried the various -mregparm options: -mregparm=1 seemed to give the
smallest code in general.
I never tried timing the code, but I would imagine it is as faster or
similar speed to the default, which is -mregparm=0.
(I would have mixed it with -mrtd, but __attribute__ ((regparm (0),
cdecl)) didn't work at the time. I wonder if it does now).
It's not terribly easy to use this calling convention with standard
libraries because they are compiled to use the other convention -- all
on the stack, caller pops.
However, there is movement afoot to change the C++ ABI. In that case,
maybe that would be a good time to declare that C++ calls use the
-mregparm=1 calling convention?
-- Jamie
More information about the Gcc
mailing list