This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386]: Emit cld instruction when stringops are used
- From: "Uros Bizjak" <ubizjak at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: "gcc patches" <gcc-patches at gcc dot gnu dot org>, "Jan Hubicka" <jh at suse dot cz>
- Date: Mon, 28 Apr 2008 13:38:28 +0200
- Subject: Re: [PATCH, i386]: Emit cld instruction when stringops are used
- References: <5787cf470803060755i738689ecqe341670c2b4b7c9f@mail.gmail.com> <Pine.LNX.4.64.0804281110260.12939@digraph.polyomino.org.uk>
On Mon, Apr 28, 2008 at 1:16 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> > This patch adds back generation of cld instructions when stringops are
> > used in the function. cld insn is emitted as unspec volatile at the
> > end of function prologue. Currently, patched gcc emits cld when
> > "-mcld" is added to compile flags.
>
> The discussion of this patch seems to have died down, and we were hoping
> to get something like this into GCC 4.3.1.
>
> I think the conclusion was that the approach of this patch (emit cld in
> the prologue if the compiler generates code caring about the direction
> flag, but inline asms need their own cld if they care about the direction
> flag) is the right one. There was less consensus on the need for a
> configure option to turn this option on by default, but if there is one
> then I think the right form is --enable-cld which turns it on by default
> for 32-bit code only, if no explicit -mno-cld option was passed.
IIRC, Jan proposed better patch, where cld was placed in optimal
position via LCM.
Uros.