🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #12635

Re: % in hash table

#12635
From: D. J. Bernstein
Date: Fri, 13 Oct 1995 01:35
16 lines
1103 bytes
david r chase <chase@world.std.com> wrote:
> 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.

For some machines, yes. For others this comparison will nearly triple
the run time of the subroutine.

But you missed my main point, which is that the code should be deleted
entirely. Your five instructions should be ZERO instructions.

---Dan
Technical Details
Message-ID: <1995Oct1301.35.33.7632@silverton.berkeley.edu>
Path: arc1-ca.pugleaf.net!silverton.berkeley.edu!djb
References: <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!silverton.berkeley.edu!djb
From: djb@silverton.berkeley.edu (D. J. Bernstein)
Message-ID: <1995Oct1301.35.33.7632@silverton.berkeley.edu>
Date: 13 Oct 1995 01:35:33 GMT
Newsgroups: comp.arch,comp.arch.arithmetic,comp.lang.c
Subject: Re: % in hash table
References: <43tqr6$3au@mikasa.iol.it> <4522pb$cid@hermes.synopsys.com> <1995Oct1102.48.02.1823@silverton.berkeley.edu> <DGCFt9.GH7@world.std.com>
Organization: IR