This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Half-baked i386 stack alignment thoughts
- To: tm2 at best dot com
- Subject: Re: Half-baked i386 stack alignment thoughts
- From: John Wehle <john at feith dot com>
- Date: Thu, 2 Nov 2000 19:45:14 -0500 (EST)
- Cc: gcc at gcc dot gnu dot org
> Are you sure pushl is better?
>
> Pushes are usually nasty on multiple-issue processors.
> Unless you have funky bypass logic, it will suppress multiple instructions
> issue because the next push can't issue until the previous push is finished
> because it's dependent on the modified stack pointer.
My impression from the last time I looked at the Intel Pentium II optimization
manual (which was a while ago) is that several operations which modify the
stack pointer are handled as special cases.
> This sounds bad for superscalar x86 members.
The reports in the past have been that the performance of the current
accumulate-outgoing-args (which doesn't use pushl) is a mixed bag when
compared to not accumulating the outgoing args due (in part) to the
instructions being larger which affects code density.
My suggestion (in theory) should be no worst than the current default of
adjusting the stack and pushing the arguments. It remains to be seen if
practice is the same as theory in this case. :-)
BTW: I was looking to have:
addl $4, %esp
pushl %eax
optimized to:
mov %eax, (%esp)
-- John
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------