[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (m) Re: [f-cpu] More Instruction Set Trouble



On Wed, Aug 22, 2001 at 04:56:49PM +0200, Yann Guidon wrote:
[...]
> > What about this:
> >         loadaddrb       r3, r2, r1      # r1 = r2 + r3 (code address)
> >         loadaddrbd      r3, r2, r1      # r1 = r2 + r3 (data address)
> >         loadaddrbi      simm8, r2, r1   # r1 = r2 + simm8 (code address)
> >         loadaddrbid     simm8, r2, r1   # r1 = r2 + simm8 (data address)
> 
> my first remark is : several opcodes are too much verbose and lengthy.
> some of my propositions are : "move" -> "cp" (it's very explicit for linuxers :-D)
> "loadaddr" -> "lai", "lad"

No, please don't do that.  This naming style is obsolete since the early
80's ;)  And it reminds me too much of the 6502 and 8080 instruction sets.
The names we currently have are IMHO perfect -- not too long, but easy
to remember.

> i can see 3 forms : one with PC, one with a register, and one with imm8.
> the BISON syntax is not complex then.

Not quite... there are four forms:

	reg = PC + 4 + simm	(the current loadaddri)
	reg = PC + 4 + reg	(the current loadaddr)
	reg = basereg + simm	(new)
	reg = basereg + reg	(new)

> > (`-b' means `based (on register r2)').  Unfortunately, the encoding has
> > to be different (3 operands instead of 2), so there's not enough room
> > for a 16-bit immediate operand (the maximum is 32-8-2*6-1 = 11 bits).
> > Otherwise, the original `loadaddr' instruction could be made a special
> > case of this one (e.g. when r2=0, use PC+4 instead).
> 
> i have the feeling (beware !) that we can attempt to do an exception.
> i presume that this instruction will be used more often than i thought,
> depending on the compiler quality etc...
> 
> we can maybe try to make an "extended" form with (r1+1) as a destination.
> opcode : 8 bits
> I/D flag : 1 bit
> sign : 1
> imm16 : 16
> src/dest+1 : 6 bits
>   total : 32 bits.
> 
> it's tight but it's worth.

I don't like this "flip the lsb of the register number" trick at all,
and certainly not in *this* case.  It complicates the register assignment
procedure in compilers, and may introduce register pressure (64 registers
may look much at the first glance, but it isn't much, believe me).
I'd rather live with a short immediate for loadaddrb.

-- 
 Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
 "All I wanna do is have a little fun before I die"
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/