Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 14 Aug 2002 17:09:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 14 Aug 2002 17:08:16 -0400 Received: from willy.net1.nerim.net ([62.212.114.60]:12042 "EHLO www.home.local") by vger.kernel.org with ESMTP id ; Wed, 14 Aug 2002 17:07:49 -0400 Date: Wed, 14 Aug 2002 23:11:40 +0200 From: Willy Tarreau To: "H. Peter Anvin" Cc: Willy Tarreau , Rogier Wolff , linux-kernel@vger.kernel.org Subject: Re: [patch 4/21] fix ARCH_HAS_PREFETCH Message-ID: <20020814211140.GB7445@alpha.home.local> References: <3D56B13A.D3F741D1@zip.com.au> <20020814194019.A31761@bitwizard.nl> <3D5AB250.3070104@zytor.com> <20020814204556.GA7440@alpha.home.local> <3D5AC481.2080505@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D5AC481.2080505@zytor.com> User-Agent: Mutt/1.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 829 Lines: 32 On Wed, Aug 14, 2002 at 01:58:41PM -0700, H. Peter Anvin wrote: > Willy Tarreau wrote: > > This way, some loops could be optimized, and the developpers could explicitely > > tell the compiler when they need to prevent any optimization. > > > > #define __nop() asm volatile("") and if you want to pass arguments, to guarantee that no optimization will be done, even on loop constants ? eg: for (i = 0; i < N; i++) { j++; __nop(); } -> might be optimized this way : j = N; for (i = 0; i < N; i++) { __nop(); } Perhaps using a volatile for j ? Cheers, Willy - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/