From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752363Ab1LQO6e (ORCPT ); Sat, 17 Dec 2011 09:58:34 -0500 Received: from mail-iy0-f174.google.com ([209.85.210.174]:53897 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752149Ab1LQO6c (ORCPT ); Sat, 17 Dec 2011 09:58:32 -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:58:24 +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 Message-Id: <201112172258.24221.nai.xia@gmail.com> Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andi, Seems I used a stale email address of you from a related git commit log, so this is a resend, sorry. ======= 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