This is the mail archive of the gcc@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]

Re: Gcc extra alignment..


>> Keeping the stack always aligned is felt to be cheaper than burning another
>> register in order to still access the arguments when using 'and' to align
>> the stack.
>
>It's also possible to copy the arguments to the aligned stack area, so
>you don't need two stack registers.

Sure at the price of a more complex prologue and watch out for varargs.

> Well the most obvious thing is that _most_ programs don't need 16-byte
> alignment at all, and relatively small parts of relatively few programs
> need 8-byte alignment either.
>
> That means alignments in code which _doesn't_ use floating point, MMX or
> SSE are pure overhead.  The Linux kernel is one such program.
>
> Is that accounted for in your benchmark?

If you mean did I compile the Linux kernel, the answer is no.  I certainly
agree that there are some downsides to the current implementation.  Please
feel free to dust off my old patch which used 'and' to align the stack and
provide benchmark numbers.  Other approaches are also welcomed.

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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