Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: optimization question

Author: Bruce Moreland

Date: 14:30:27 10/23/00

Go up one level in this thread


On October 23, 2000 at 12:29:27, Oliver Roese wrote:

>On October 23, 2000 at 01:09:02, Landon Rabern wrote:
>
>>is it faster to cast to a char or to AND by 0xff, or to do they take the same
>>number of clock cycles?
>>
>>Thanks,
>>
>>Landon W. Rabern
>
>Since "(unsigned char) u" and "u & 0xff" are equivalent expressions in C (or
>arent they??) and nearly equivalent in other languages you surely cant tell
>that, without looking on the assembler output of your compiler.
>In C dont ever use char, there are implicitely converted to ints and that could
>hurt. If the compiler can decide not to convert, slow  86-instructions must be
>used. Hard to tell, what is slowest.
>
>Oliver

I know that with the original pentium, in 32-bit mode, 32-bit and 8-bit
operations were fine, but 16-bit operations were bad.

I don't know if 8-bit operations are now bad, but if they are, it has been since
sometime after the Pentium Pro.

bruce




This page took 0 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.