Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: 64 Bit Programs

Author: Eugene Nalimov

Date: 22:13:25 07/01/03

Go up one level in this thread


On July 02, 2003 at 00:02:57, Tom Kerrigan wrote:

>On July 01, 2003 at 22:19:38, Eugene Nalimov wrote:
>
>>On July 01, 2003 at 21:15:35, Tom Kerrigan wrote:
>>
>>>On July 01, 2003 at 20:29:58, Robert Hyatt wrote:
>>>
>>>>>Really? Which RISC computers don't use 32 bit instructions? POWER, Alpha, SPARC,
>>>>>PA-RISC, MIPS, ARM, and probably some others I'm forgetting all use 32 bit
>>>>>instructions.
>>>>
>>>>Look again.  IE addresses stretch the instruction way beyond 32 bits for
>>>>those instructions that need addresses.  The sparc is an easy to find
>>>>example of this.  IE the 32 bit sparc had instructions > 32 bits.
>>>
>>>Really? Which ones?
>>
>>"Load high" is a kludge added to the instruction set of nearly every recent RISC
>>CPU to resolve exactly that problem -- "how we can load 32-bit value when all
>>the instructions are 32 bits in length"? Conceptually, "load high/add immediate"
>>is one instruction.
>
>Oh, God. I knew that one of these ISAs allowed a 32-bit immediate following the
>instruction. I didn't think most of them did. That violates the RISC philosophy
>in so many ways.
>
>I thought most of these ISAs just had a 2nd load immediate instruction that
>loaded the immediate operand into the upper order bits of a register?

Sorry, I was not clear enough. I was talking about exactly those two
instructions. RISC developers ended with 2 instructions instead of one because
of the limitation "all instruction should have the same length". That is what
Bob was talking about -- sometimes you need more than 32 bits to encode the
instruction. Of course you can split instruction into two. You can implement
"prefix instruction". You can invent instruction that will use some bits of the
next instruction as operand bits. That are all kludges.

RISC code is longer than it should be, mainly because of that limitation. You
yourself pointed out that for majority of instructions 32 bits are too much.
Nevertheless, "all instructions should have the same length", and due to the
fact that you need longer immediate operands (or offsets) instructions cannot be
short, even ones that do not require those extra bits.

I personally think that ARM choose right way in their Thumb2 instruction set.
You need a mixture of 16- and 32-bit instructions (probably with 48-bit
instructions as well), and instruction length should be easily deduciable from
the first instruction word. This way you can have both fast instruction
fetch/decode and compact code.

Thanks,
Eugene

>Takes two instructions to load a 32 bit value into a register, but it's not like
>the program's memory footprint is any bigger, and it's not like you have to load
>such big values into registers very often...
>
>-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.