This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

At the C++ ABI switch, make -mregparm=1 the default on x86?


(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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]