From owner-cvs-src@FreeBSD.ORG Wed Oct 31 22:33:49 2007 Return-Path: Delivered-To: cvs-src@FreeBSD.ORG Received: by hub.freebsd.org (Postfix, from userid 1033) id 34E3916A46B; Wed, 31 Oct 2007 22:33:49 +0000 (UTC) Date: Wed, 31 Oct 2007 22:33:49 +0000 From: Alexey Dokuchaev To: Andrey Chernov , Juli Mallett , src-committers@FreeBSD.ORG, cvs-src@FreeBSD.ORG, cvs-all@FreeBSD.ORG Message-ID: <20071031223349.GA552@FreeBSD.org> References: <200710272232.l9RMWSbK072082@repoman.freebsd.org> <20071030200331.GA29309@toxic.magnesium.net> <20071031215526.GC89932@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20071031215526.GC89932@nagual.pp.ru> User-Agent: Mutt/1.4.2.1i Cc: Subject: Re: cvs commit: src/include _ctype.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2007 22:33:49 -0000 On Thu, Nov 01, 2007 at 12:55:26AM +0300, Andrey Chernov wrote: > On Tue, Oct 30, 2007 at 10:03:31AM -1000, Juli Mallett wrote: > > * "Andrey A. Chernov" [ 2007-10-27 ] > > [ cvs commit: src/include _ctype.h ] > > > ache 2007-10-27 22:32:28 UTC > > > > > > FreeBSD src repository > > > > > > Modified files: > > > include _ctype.h > > > Log: > > > Micro-optimization of prev. commit, change > > > (_c < 0 || _c >= 128) to (_c & ~0x7F) > > > > Isn't that a non-optimization in code and a minor pessimization of readability? > > Maybe I'm getting rusty, but those seem to result in nearly identical code on > > i386 with a relatively modern GCC. Did you look at the compiler output for this > > optimization? Is there a specific expensive instruction you're trying to avoid? > > For such thoroughyl bit-aligned range checks, you shouldn't even get a branch > > for the former case. Is there a platform other than i386 I should look at where > > the previous expression is more clearly pessimized? Or a different compiler > > than GCC? > > For ones who doubts there two tests compiled with -O2. As you may see the > result is almost identical (andl vs cmpl): Q.E.D. How about to restore original, more reader-friendly version then? ./danfe