This is the mail archive of the 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]
Other format: [Raw text]

Re: [RFA patch i386]: Prepare x64 prologue using positive offsets for frame-pointer

On 07/21/2010 12:43 AM, Kai Tietz wrote:
> Well, as x64 ABI aligns stack (beside leaf-functions) to 16-bytes,
> there is for default nothing to fear. There is one nit about AVX
> register store, which leads to a stack-realignment of 32-byte, that
> would fail. The issue is that x64 ABI doesn't specifies anything about
> new AVX (well the HW isn't even on market AFAIK). I see here two
> possible ways to address this. a) Sorry the use of AVX and x64 with
> SEH unwind-information. Or b) save initial stack-position in
> stack-frame at the realignment is performed.

This says that the MSABI for AVX will consider the high parts
of the YMM registers volatile.  Which means that for the purpose
of the prologue we only need to save the low 16 bytes.

Which means that we can arrange the frame like so:

	[ return addr ]
				<-- entry sp
	[ saved int regs ]
	[ saved xmm regs ]
				<-- fp
	[ stack re-alignment ]
	[ local stack frame ]
				<-- sp

Here, fp is not at the bottom of the stack, but it is below all of the
saved registers, which means that they're all at positive offsets from fp,
which is the only real requirement of SEH.  Also, the local stack frame
is aligned, which allows aligned spilling of YMM registers or other over-
aligned data.


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