From owner-freebsd-arch@FreeBSD.ORG Sun May 6 10:16:18 2007 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A855116A402; Sun, 6 May 2007 10:16:18 +0000 (UTC) (envelope-from bde@zeta.org.au) Received: from mailout2.pacific.net.au (mailout2-3.pacific.net.au [61.8.2.226]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6A113C48A; Sun, 6 May 2007 10:16:18 +0000 (UTC) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id 41997119096; Sun, 6 May 2007 20:16:10 +1000 (EST) Received: from besplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id C012E8C09; Sun, 6 May 2007 20:16:15 +1000 (EST) Date: Sun, 6 May 2007 20:16:15 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kostik Belousov In-Reply-To: <20070506045025.GB83173@deviant.kiev.zoral.com.ua> Message-ID: <20070506195805.S45282@besplex.bde.org> References: <20070502230413.Y30614@thor.farley.org> <20070503160351.GA15008@nagual.pp.ru> <20070504085905.J39482@thor.farley.org> <20070504213312.GA33163@nagual.pp.ru> <20070504174657.D1343@thor.farley.org> <20070505213202.GA49925@nagual.pp.ru> <20070505163707.J6670@thor.farley.org> <20070505221125.GA50439@nagual.pp.ru> <20070506091835.A43775@besplex.bde.org> <20070506045025.GB83173@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Daniel Eischen , arch@freebsd.org, "Sean C. Farley" Subject: Re: HEADS DOWN X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2007 10:16:18 -0000 On Sun, 6 May 2007, Kostik Belousov wrote: > On Sun, May 06, 2007 at 10:59:23AM +1000, Bruce Evans wrote: >> The setup overhead for using string instructions may be much larger than >> the 14-16 in the above table. It is also necessary to set the direction >> flag and maybe to shuffle registers so as to use the registers required >> by the string instructions. cld/std is fast enough on Athlons (1/2 >> cycles) but is slow on Pentium4 and later (IIRC, 43 cycles for std on >> one Pentium model). > gcc 4.3 claims to not issue cld instruction anymore (ABI requires direction > flag to be clear since eon). Ha, the library for my compiler required this in 1988 (its ABI is supposed to be compatible with other compilers, and seemed to be compatible with several including gcc and 2 unusual ones). However, FreeBSD has never really supported this -- it doesn't touch the direction flag for signal handling. String functions don't seem to be required to be async signal-safe in draft POSIX.1-2001, but they should be in practice (when called on an string in local storage), and things like struct copies (to and from local variables) are required to work even for C90 signal handlers. Bruce