[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] WinCE ARM prolog

From: Daniel Glöckner
Subject: Re: [Tinycc-devel] WinCE ARM prolog
Date: Sat, 17 Apr 2010 13:46:40 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Fri, Apr 16, 2010 at 11:18:44PM +0300, Timo VJ Lähde wrote:
> Is TinyCC ARM prolog :
> mov ip, sp
> stmdb sp!, {fp, ip, lr}
> add fp, sp, #C
> compatible with this ?
> >From Microsoft http://msdn.microsoft.com/en-us/library/ms254231.aspx

Probably not. I never thought of making it compatible with Microsoft
when I wrote it. But it appears to be very close.

You need to replace
        add fp, sp, #C
        sub fp, ip, #N

In that case #N depends on the number of registers r0-r3 saved with
the stmdb that has been omitted in the prolog you posted.

The next instruction generated would be
        sub sp, fp, #x
You need to replace that with
        sub sp, ip, #x+N

But I doubt the "Virtual Unwinder" will be able to unwind our code
when the subtraction of x+N can not be represented in one instruction.
We then call a small function placed after the current function that
loads the offset to ip and performs the subtraction. You would need
to insert that code where we currently reserve space for a single
instruction. The problem is that we only know at the end of the
function how big the stack frame needs to be.

Btw. is WinCE restricted to increase the stack size one page at a
time? I remember x86 Windows to have that restriction.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]