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: ARM/iwmmxt sibling call fix


> > No, I mean when frame_size+current_function_outgoing_args == 0. If this
> > is not the case we already have sub sp, sp, #<size> so we get the
> > alignment for free.
>
> Do you mean this bit of arm_expand_prologue?
>   if (offsets->outgoing_args != offsets->saved_args + saved_regs)
>
> In that case, I guess nothing is necessary for the AAPCS case after
> all, and using a cycle to save an extra register to preserve the
> alignment would just be a space optimization.  Does that make sense?

Yes. In some cases it may also be a speed optimization as modern arm cores 
transfer two registers per cycle. 

<wstrd wro, [sp, #-12]!>

> I'm going to stand by the patch I submitted, which is a correctness
> fix, but it would be nice to do the above instead - it's two cycles
> shorter.  It doesn't work if we're saving no iWMMXt registers, but I
> am guessing that the code you've added to align the stack for AAPCS
> will handle this transparently.  I'll give it a try sometime.

You'd have to teach arm_get_frame_offsets about this trick. ie add alignment 
the stack frame when iwmmxt registers are saved. It currently works because 
the iwmmxt alignment code in arm_compute_save_reg_mask. Moving it into 
arm_get_frame_offsets would IMHO be a good thing.

Paul


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