This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH i386]: Enable push/pop in pro/epilogue for modern CPUs
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Xinliang David Li <davidxl at google dot com>
- Date: Mon, 10 Dec 2012 10:23:17 +0100
- Subject: Re: [PATCH i386]: Enable push/pop in pro/epilogue for modern CPUs
- References: <CAFULd4Z4hGXfjF-VXdazsnSQpnBszLxQidaVVOsZddZx0ep69w@mail.gmail.com>
On Sun, Dec 9, 2012 at 2:50 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
>> I noticed in prologue/epilogue, GCC prefers to use MOVs followed by a
>> SP adjustment instead of a sequence of pushes/pops. The preference to
>> the MOVs are good for old CPU micro-architectures (before pentium-4,
>> K10), because it breaks the data dependency. In modern
>> micro-architecture, push/pop is implemented using a mechanism called
>> stack engine. The data dependency is removed by the hardware, and
>> push/pop becomes very cheap (1 uOp, 1 cycle latency), and they are
>> smaller. There is no longer the need to avoid using them. This is
>> also what ICC does.
>
>> 2012-12-08 Xinliang David Li <davidxl@google.com>
>> * config/i386/i386.c: Eanble push/pop in pro/epilogue for moderen CPUs.
>
> s/moderen/modern
>
> OK for mainline SVN.
It's also more costly for unwind info in the prologue/epilogue. Thus, did you
measure the effect on CFI size?
Thanks,
Richard.
> Thanks,
> Uros.