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

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


2010/7/21 Richard Henderson <rth@redhat.com>:
> 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.
>
> http://software.intel.com/en-us/forums/showthread.php?t=72496
>
> 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.
>
>
> r~
>


This indeed good news. So standard-frame layout remains for x64 and
YMM store in prologue will happen only for the lower 128-bits. So
there won't be issues about the unwind-information.

Kai
-- 
|? (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


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