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/18/2010 03:42 AM, Kai Tietz wrote:
>> +mframe-x64
>> +Target Report Var(flag_framex64) Init(0)
>> +Set the frame-pointer to the stack location at the end of prologue for 64-bit.
>
> Modulo testing purposes, a command-line switch makes no sense. ?We'll want to
> key this off SEH enabled, or at least TARGET_64BIT_MS_ABI.

Well, I agree here, as this frame-layout is required for -mseh. I
added this as general option to have a chance to not enable it by
default. That this layout is dependent just to TARGET_64BIT_MS_ABI
isn't correct, as this macro checks for function ABI, which is for
target unwind-emitting (which has to be active for all calling
conventions) not suiteable. A check of (TARGET_64BIT && ix86_abi ==
MS_ABI) fits better IMHO.

> The state of ix86_expand_prologue/epilogue is... what's a kind word... chaotic?
> This isn't your fault, but your patch doesn't help either. ?It's extremely
> difficult to tell if your patch is correct. ?I'm pretty sure it isn't correct
> for any case of stack re-alignment, for instance.

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.

> I spent an hour or three attempting to tidy up these functions and handle the
> frame pointer at the bottom of the frame. ?I have some ideas now for how to
> clean things up, but I think they'll really need to be staged in in phases.
> One big patch would simply be too unwieldy.

Excellent.

> I'll work on this cleanup over the next couple of days.
>
>
>
> r~
>


Regards,
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]