This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [ARM] Why MI thunks are always implemented in ARM code?
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Cc: "Doug Kwan (éæå)" <dougkwan at google dot com>
- Date: Sat, 24 May 2008 01:14:15 +0100
- Subject: Re: [ARM] Why MI thunks are always implemented in ARM code?
- References: <498552560805231526w34b019a0m72eacd7673233161@mail.gmail.com> <498552560805231618l44c97f9ne868f41847ed70a3@mail.gmail.com>
On Saturday 24 May 2008, Doug Kwan (éæå) wrote:
> I saw that MI thunks are always issued in ARM mode. Is there a
> specific reason?
Recent gcc is capable of generating pure Thumb thunks (and always does so for
Thumb-2).
> ÂI think I can replace a
> 20-byte ARM MI thunk with a 4 bytes THUMB equivalent when the thunkee
> is also in THUMB mode. ÂIs there any problem with this?
Thumb branches have extremely limited range, and you can't clobber any low
registers. A combination of these two means that it's extremely hard to
perform the tailcall or to add large offsets.
I'm fairly sure there's also no way to guarantee that the thunkee is Thumb
code.
Paul