From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx207.postini.com [74.125.245.207]) by kanga.kvack.org (Postfix) with SMTP id A342E6B004F for ; Sat, 17 Dec 2011 12:08:38 -0500 (EST) Received: by wibhq12 with SMTP id hq12so609738wib.14 for ; Sat, 17 Dec 2011 09:08:36 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <201112172258.24221.nai.xia@gmail.com> References: <201112172258.24221.nai.xia@gmail.com> Date: Sat, 17 Dec 2011 12:08:36 -0500 Message-ID: Subject: Re: Question about missing "cld" in x86 string assembly code From: Brian Gerst Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: owner-linux-mm@kvack.org List-ID: To: nai.xia@gmail.com Cc: Andi Kleen , Linus Torvalds , Linux-MM , LKML On Sat, Dec 17, 2011 at 9:58 AM, Nai Xia wrote: > Hi Andi, > > Seems I used a stale email address of you from a related git commit log, > so this is a resend, sorry. > > =3D=3D=3D=3D=3D=3D=3D > Hi, > > I notice that all x86 assembly code for string operations containing > "scasb, lodsb", etc does not have "cld" at the beginning. > Is this 100% safe? > Or in other words, how could we be sure that > there is no "std" generated by compiler somewhere just before > the string operations? > > > Thanks, > > Nai > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" i= n > the body of a message to majordomo@vger.kernel.org > More majordomo info at =C2=A0http://vger.kernel.org/majordomo-info.html > Please read the FAQ at =C2=A0http://www.tux.org/lkml/ The i386 ELF ABI states "The direction flag must be set to the =E2=80=98=E2=80=98forward=E2=80=99=E2=80=99 (that is, zero) direction befor= e entry and upon exit from a function." Therefore it can be assumed to be clear, unless explicitly set. -- Brian Gerst -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org