From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx130.postini.com [74.125.245.130]) by kanga.kvack.org (Postfix) with SMTP id 7A3886B004F for ; Sat, 17 Dec 2011 09:52:35 -0500 (EST) Received: by iacb35 with SMTP id b35so5406171iac.14 for ; Sat, 17 Dec 2011 06:52:34 -0800 (PST) From: Nai Xia Reply-To: nai.xia@gmail.com Subject: Question about missing "cld" in x86 string assembly code Date: Sat, 17 Dec 2011 22:52:26 +0800 MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201112172252.26439.nai.xia@gmail.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andi Kleen Cc: Linus Torvalds , Linux-MM , LKML 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, 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752382Ab1LQOwh (ORCPT ); Sat, 17 Dec 2011 09:52:37 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:38334 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752293Ab1LQOwf (ORCPT ); Sat, 17 Dec 2011 09:52:35 -0500 From: Nai Xia Reply-To: nai.xia@gmail.com To: Andi Kleen Subject: Question about missing "cld" in x86 string assembly code Date: Sat, 17 Dec 2011 22:52:26 +0800 User-Agent: KMail/1.13.6 (Linux/2.6.38-13-generic-pae-uksm; KDE/4.6.5; i686; ; ) Cc: Linus Torvalds , "Linux-MM" , LKML MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201112172252.26439.nai.xia@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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