Article View: comp.arch
Article #12637Re: % in hash table
From: Michael Williams
Date: Fri, 13 Oct 1995 09:23
Date: Fri, 13 Oct 1995 09:23
25 lines
1693 bytes
1693 bytes
In article <DGCFt9.GH7@world.std.com>,
david r chase <chase@world.std.com> wrote:
|In article <1995Oct1102.48.02.1823@silverton.berkeley.edu>,
|D. J. Bernstein <djb@silverton.berkeley.edu> wrote:
|>Joe Buck <jbuck@synopsys.com> wrote:
|>> /* now res is at most 32767+4 */
|>> return (res < 32767) ? res : res - 32767;
|
|>Branching is bad. Look at the routines that use res, and rewrite them so
|>that they won't mind inputs up to 32771.
|
|Branches aren't necesssary, nor are they necessarily bad. On some
|machines, if well-scheduled, they have effectively zero cost, or very
|close to it. If you've got conditional move (e.g., Sparc V9), I think
|you could do that with something like:
If you have a conditional subtract, then it's even simpler.
8-p
Mike.
_____________________________________________________________________
\ x / Michael Williams Advanced RISC Machines Limited
|\/|\/\ michael.williams@armltd.co.uk Fulbourn Road, Cambridge, CB1 4JN, UK
| |.__)"I might well think that Matti, ARM Ltd. couldn't possibly comment."
Technical Details
Message-ID:
<45lb6c$jeb@doc.armltd.co.uk>Path:
arc1-ca.pugleaf.net!armltd.co.uk!mwilliamReferences:
<43tqr6$3au@mikasa.iol.it> <4522pb$cid@hermes.synopsys.com> <1995Oct1102.48.02.1823@silverton.berkeley.edu> <DGCFt9.GH7@world.std.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!armltd.co.uk!mwilliam From: michael.williams@armltd.co.uk (Michael Williams) Newsgroups: comp.arch,comp.arch.arithmetic,comp.lang.c Subject: Re: % in hash table Date: 13 Oct 1995 09:23:24 GMT Organization: Advanced RISC Machines Ltd Message-ID: <45lb6c$jeb@doc.armltd.co.uk> References: <43tqr6$3au@mikasa.iol.it> <4522pb$cid@hermes.synopsys.com> <1995Oct1102.48.02.1823@silverton.berkeley.edu> <DGCFt9.GH7@world.std.com> Reply-To: mike@nsict.org NNTP-Posting-Host: sun7.armltd.co.uk X-Address: Fulbourn Road, Cherry Hinton, Cambridge, CB1 4JN, UK Originator: mwilliam@sun7