Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: 0x88 is not so smart

Author: Eugene Nalimov

Date: 21:08:28 06/16/00

Go up one level in this thread


Sorry, of course it must be 64 bits in the first example and 32 bits in the
second one...

Eugene

On June 17, 2000 at 00:05:12, Eugene Nalimov wrote:

>On both Alpha and IA-64 it's better to use 64-bit index when indexing the array.
>Explanation is simple -- all 64 bits in the resulting pointer would be used,
>even on 32-bit NT that is supported on Alpha.
>
>Simple examples on IA-64 (indexing of the 32-bit array, nops not included):
>
>(1) int foo (int i, int *a)
>    {
>        return a[i];
>    }
>Resulting assembly is
>    shladd  r31=r32, 2, r33 ;;
>    ld4     r8=[r31]
>    br.ret  b0 ;;
>Run time is 2 clock cycles.
>
>(2) int foo (__int64 i, int *a)
>    {
>        return a[i];
>    }
>Resulting assembly is
>    sxt4    r32=r32 ;;
>    shladd  r31=r32, 2, r33 ;;
>    ld4     r8=[r31]
>    br.ret  b0 ;;
>Run time is 3 clock cycles.
>
>(actual output of the 64-bit MSVC compiler slightly differs; it does sign
>extension in more complicated way to be more 32-bit compatible).
>
>Eugene
>
>On June 16, 2000 at 23:38:10, Bruce Moreland wrote:
>
>>If you are talking about the alpha, it does 32-bits with no performance penalty,
>>right?  So the fact that an int is 32-bits on the Windows Alpha compiler
>>shouldn't be a big deal.  And they do provide good access to the 64-bit data
>>type.
>>
>>Not that Alpha is anything these days.
>>
>>bruce
>>
>>On June 15, 2000 at 19:10:32, Eugene Nalimov wrote:
>>
>>>That's not true for some systems. Int is still 32 bits, but "natural" word size
>>>is 64 bits.
>>>
>>>Eugene
>>>
>>>On June 15, 2000 at 17:28:26, Tom Kerrigan wrote:
>>>
>>>>On June 15, 2000 at 06:15:55, Christophe Theron wrote:
>>>>
>>>>>On June 14, 2000 at 17:29:07, Dave Gomboc wrote:
>>>>>
>>>>>>On June 14, 2000 at 16:17:25, Christophe Theron wrote:
>>>>>>
>>>>>>>The availability of 64 bits processors changes nothing. Unless some 64 bits
>>>>>>>processors are so lousy that 8, 16 and 32 bits operations become slower than 64
>>>>>>>bits ops...! :)
>>>>>>
>>>>>>I don't think it is unusual for certain operations on sizes smaller than the
>>>>>>processor word size to take longer than they would if they used the processor's
>>>>>>word size.  Indeed, it wouldn't even be unusual for it to be possible without
>>>>>>first sign-extending or zero-extending from the smaller size to the processor
>>>>>>word size.  AFAIK, 80x86 is a bit freaky in that it tries very hard to support
>>>>>>8-bit and 16-bit operations in registers as quickly as 32-bit operations.
>>>>>>
>>>>>>Dave
>>>>>
>>>>>
>>>>>That would be a very unfair way for bitboards to win the contest! :)
>>>>>
>>>>>
>>>>>    Christophe
>>>>
>>>>Just define everything in your program as an int. It will automatically use the
>>>>processor's word size, so problem solved. :)
>>>>-Tom



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.