From owner-cvs-src@FreeBSD.ORG  Tue Oct 30 20:27:28 2007
Return-Path: <owner-cvs-src@FreeBSD.ORG>
Delivered-To: cvs-src@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3749416A469;
	Tue, 30 Oct 2007 20:27:28 +0000 (UTC)
	(envelope-from flata@magnesium.net)
Received: from toxic.magnesium.net (toxic.magnesium.net [207.154.84.15])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A04913C447;
	Tue, 30 Oct 2007 20:27:28 +0000 (UTC)
	(envelope-from flata@magnesium.net)
Received: by toxic.magnesium.net (Postfix, from userid 1212)
	id 4985DDA828; Tue, 30 Oct 2007 12:03:31 -0800 (PST)
Date: Tue, 30 Oct 2007 10:03:31 -1000
From: Juli Mallett <juli@clockworksquid.com>
To: "Andrey A. Chernov" <ache@FreeBSD.org>
Message-ID: <20071030200331.GA29309@toxic.magnesium.net>
References: <200710272232.l9RMWSbK072082@repoman.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200710272232.l9RMWSbK072082@repoman.freebsd.org>
User-Agent: Mutt/1.5.15 (2007-04-06)
Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
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 <cvs-src.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
	<mailto:cvs-src-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/cvs-src>
List-Post: <mailto:cvs-src@freebsd.org>
List-Help: <mailto:cvs-src-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-src>,
	<mailto:cvs-src-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 30 Oct 2007 20:27:28 -0000

* "Andrey A. Chernov" <ache@FreeBSD.org> [ 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?

juli.