simulator (Re: [Icfp04-discuss] three liberal arts)

Laurent Desnogues laurent.desnogues at wanadoo.fr
Wed Jun 9 02:40:14 EDT 2004


Jed Davis wrote:

> Meanwhile, I find myself wondering what the performance implications
> would be of using smaller integers than full words (e.g., half-words,
> bytes, and bit fields).  I mean, I keep hearing that memory accesses
> are the big performance bottleneck these days, so I wonder if it would
> help to save N-1 loads (and N-1 words of dcache?) at the cost of N
> rlwinm's (or whatever the target uses for bit-masking).

I tested that after the contest.  In fact when you
look at the instructions, you see you can encode
them using 64 bits for 2 of them and 32 bits for
the remaining.  I quickly coded that and it halved
the data memory requirement as opposed to a simple-
minded structured containing all fields.

And the result is... no gain :-)

I should rerun some benchmarks with bigger ants (I
used small ones that probably mostly fit in the L1
cache of my P-m), but the gain won't be huge.

Some gain could come by encoding the map as a one-
dimensional array so that direction selection is
just loading an offset instead of switching and
computing x and y.  Since the border of the world
is rocky, you can't get wrong using offsets.


		Laurent



More information about the Icfp04-discuss mailing list