Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Nov 2007 01:39:11 +0300
From:      Andrey Chernov <ache@nagual.pp.ru>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        cvs-src@FreeBSD.ORG, Christoph Mallon <christoph.mallon@gmx.de>, src-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/include _ctype.h
Message-ID:  <20071031223911.GC90994@nagual.pp.ru>
In-Reply-To: <20071101024451.T4289@delplex.bde.org>
References:  <200710272232.l9RMWSbK072082@repoman.freebsd.org> <47264710.2000500@gmx.de> <20071101024451.T4289@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 01, 2007 at 03:23:56AM +1100, Bruce Evans wrote:
> In fact, one of the cleanups/optimizations in rev.1.5 and 1.6 by ache
> and me was to get rid of the mask.  There was already a check for _c
> < 0, so the mask cost even more.  The top limit was 256 instead of
> 128, so the point about 8bit immediates didn't apply, but I don't know
> of any machines where the mask is faster (didn't look hard :-).  OTOH,
> _c is often a char or a u_char (it is declared as mumble_rune_t, but
> the functions are inline so the compiler can see the original type.
> If _c is u_char and u_char is uint8_t, then (_c < 0 || c >= 256) is
> always false, so the compiler should generate no code for it.  The top
> limit of 256 was preferred so that this optimization is possible.  A
> top limit of 128 doesn't work so well.

Please see the tests posted in this thread.

-- 
http://ache.pp.ru/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071031223911.GC90994>