Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about an efficient way to change the bits of a number.

Author: Ratko V Tomic

Date: 14:47:54 07/27/03

Go up one level in this thread


In the case of constant m the XOR-method needs 1 immediate 4 byte value while
the OR-method needs 2 immedate values, adding 4 bytes to the code. Depending on
the context and the CPU pipeline and cache sizes & states, this would have some
degrading effect. The parallelization in the OR-method may perhaps offset it,
depending on whether other orthogonal instructions can be interleaved. One would
probably need to test it in the specific context (and CPU) to see which factor
has greater effect. In the case of variable m, the XOR-method should always be
faster.



This page took 0.02 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.