[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] bitfields

From: Gary Wong
Subject: Re: [Bug-gnubg] bitfields
Date: Mon, 25 Nov 2002 11:47:54 -0500
User-agent: Mutt/1.3.28i

On Mon, Nov 25, 2002 at 03:10:06PM +0100, W.Stroop wrote:
> I just figured out that single bitfields are using 2 more instructions then
> no bitfields. Suppose one has a struct of 8  single bitfields the loss is 16
> instructions.
> If this is used 10.000 times you lose 160.000 instructions.

Twenty years ago, that would have been a big deal.  Today, it means
virtually nothing -- arithmetical instructions are extremely cheap on
modern hardware.  The major expense is memory access, largely because
of the possibility of cache misses.  It might not be too much of an
exaggeration to say that in many cases, arithmetic and logic
instructions execute for free, since with intelligent scheduling, deep
pipelines and wide superscalar issues, they will often complete before
the next data fetch is available.

The reason we use bitfields in the evalcontexts and rolloutcontexts is
because there are several in each evalsetup, and almost all
moverecords contain one or more evalsetups.  Before we started storing
analysis, there were no bitfields anywhere; but once we added
evalsetups in the moverecords, we calculated that converting the
appropriate members to bitfields led to significant memory savings.
(And it might well turn out that this memory savings yields a speed
win in the end -- notice that eliminating just one page fault will
save you far more time than 160,000 instructions.)

   Gary Wong           address@hidden           http://www.cs.arizona.edu/~gary/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]