From owner-freebsd-arch@FreeBSD.ORG Sat May 5 22:11:39 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 21AFA16A408; Sat, 5 May 2007 22:11:39 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 49C5313C4EC; Sat, 5 May 2007 22:11:36 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.1/8.14.1) with ESMTP id l45MBPZ6050534; Sun, 6 May 2007 02:11:25 +0400 (MSD) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l45MBP2b050533; Sun, 6 May 2007 02:11:25 +0400 (MSD) (envelope-from ache) Date: Sun, 6 May 2007 02:11:25 +0400 From: Andrey Chernov To: "Sean C. Farley" Message-ID: <20070505221125.GA50439@nagual.pp.ru> References: <20070502183100.P1317@baba.farley.org> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070505163707.J6670@thor.farley.org> User-Agent: Mutt/1.5.15 (2007-04-06) Cc: Daniel Eischen , arch@freebsd.org 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: Sat, 05 May 2007 22:11:39 -0000 On Sat, May 05, 2007 at 04:48:44PM -0500, Sean C. Farley wrote: > I have the same assembly output. Inlined __strleneq() ends up being > faster on my system than GCC's strlen() when I changed all calls where > checkEquals equaled false. I believe you that it should be faster with > GCC's version, but it is not ending up that way on my Athlon XP and > Pentium 4 systems running FreeBSD 6.2. > > There is now a sysenv-strlen.c that I tested the timings.c program in > regressions/environment directory. It keeps showing __strleneq() to be > faster. I wonder how it possible. Your after "if" variant becomes .L13: incl %eax cmpb $0, (%eax) jne .L13 which should be slower in general than gcc ones. Could you please run some test for just this two functions (without all other stuff): strlen() (gcc -O) and inlined __strleneq() for some array of different-size strings? -- http://ache.pp.ru/