From owner-freebsd-arch@FreeBSD.ORG Wed Jul 11 21:02:23 2007 Return-Path: X-Original-To: freebsd-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 BE31F16A46D for ; Wed, 11 Jul 2007 21:02:23 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 6B27E13C4B9 for ; Wed, 11 Jul 2007 21:02:23 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id A0CDE8BFB22; Wed, 11 Jul 2007 22:43:17 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T466EK+DkWJN; Wed, 11 Jul 2007 22:43:16 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 5CA928BF8A4; Wed, 11 Jul 2007 22:43:16 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id l6BKhGu9049748; Wed, 11 Jul 2007 22:43:16 +0200 (CEST) (envelope-from rdivacky) Date: Wed, 11 Jul 2007 22:43:16 +0200 From: Roman Divacky To: "Sean C. Farley" Message-ID: <20070711204315.GA49688@freebsd.org> References: <20070711134721.D2385@thor.farley.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070711134721.D2385@thor.farley.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-arch@FreeBSD.org Subject: Re: Assembly string functions in i386 libc 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: Wed, 11 Jul 2007 21:02:23 -0000 On Wed, Jul 11, 2007 at 03:24:01PM -0500, Sean C. Farley wrote: > While looking at increasing the speed of strlen(), I noticed that on > i386 platforms (PIII, P4 and Athlon XP) the performance is abysmal in > libc compared to the version I was writing. After more testing, I found > it was only the assembly version that is really slow. The C version is > fairly quick. Is there a need to continue to use the assembly versions > of string functions on i386? Does it mainly help slower systems such as > those with i386 or i486 CPU's? > > I have the results from my P4 (Id = 0xf24 Stepping = 4) system and the > test program here[1]. strlen.tar.bz2 is the archive of it for anyone's > testing. In the strlen/results subdirectory, there are the results for > strings of increasing lengths. just to state facts... glibc 2.3.6 uses almost exactly the same asm code for i386 (cld;repn[ez] scasb)