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

Rep:Re: Re: [f-cpu] New suggestion about call convention



-----Message d'origine-----
De: "Christophe Avoinne" <christophe.avoinne@laposte.net>
A: <f-cpu@seul.org>
Date: 06/11/02
Objet: Re: Re: [f-cpu] New suggestion about call convention


Hummm some explanations can be required.

storem r16,[sp],r31 can be seen as equivalent of :

store r16,[sp]+
store r17,[sp]+
...
store r13,[sp]

so loadm r16,[sp],r31 :

load [sp]-,r31
load [sp]-,r30
...
load [sp],r16

How does storem r1,[r2],r3 work :

1) store the value of r1 at memory [r2]
2) if r1 and r3 has the same register number, stop here and let the next
instruction to run
3) increase the register number of r1 in the instrution format
4) increase the address stored into r2
5) rexecute the modified instruction or insert it as a next instruction
in
instruction queue
How does loadm r1,[r2],r3 work :

1) load the value at memory [r2] into r3
2) if r1 and r3 has the same register number, stop here and let the next
instruction to run
3) decrease the register number of r3 in the instrution format
4) decrease the address stored into r2
5) rexecute the modified instruction or insert it as a next instruction
in
instruction queue

Note : I'm not sure about load operation, source register is first
operand
or third operand ? using third operand would share more things between
load
and store operations.

Non trivial parts are 3 and 5.

Number of generated "instructions" is n where n = register_index(r3) -
register_index(r1).

maskstore mr,[sp],r16 (mr is ...101x) :

                                 : store r16,[sp]+
lsb(mr = ...0101) = 1 : store r17,[sp]+
lsb(mr = ...0010) = 0 :
lsb(mr = ...0001) = 1 : store r19,[sp]
...

maskload mr,[r1],r16 (mr is ...101x) :

                                 : load [r1]+,r16
lsb(mr = ...0101) = 1 : load [r1]+,r17
lsb(mr = ...0010) = 0 :
lsb(mr = ...0001) = 1 : load [r1],r19
...

How does maskstore r1,[r2],r3 work :

1) store the value of r3 at memory [r2]
2) while lsb(r1) is 0 and r1 not 0, increase the register number of r3
in
the instrution format and right shift r1.
3) check if mask r1 is 0, if so stop it and let the next instruction to
run
4) increase the address stored into r2
5) rexecute the modified instruction or insert it as a next instruction
in
instruction queue

How does maskload r1,[r2],r3 work :

1) load the value at memory [r2] into r3
2) while lsb(r1) is 0 and r1 not 0, increase the register number of r3
in
the instrution format and right shift r1.
3) check if mask r1 is 0, if so stop it and let the next instruction to
run
4) increase the address stored into r2
5) rexecute the modified instruction or insert it as a next instruction
in
instruction queue

Non trivial parts are 2 and 5.

Number of generated "instructions" is n where n = number of bits set to
1 in
r1 except for the lsb which is always counted as 1.

>>>> ! you miss the tlb check ! 

Conclusion :

well, such a solution have some drawbacks :

- if an resumable exception occurs, we need to keep the modified
instruction
so we can be able to resume from it and not from the original
instruction.

>>>Glurps :/

- a more complex scheduler to handle instruction self-modification, not
speaking about the difficulties for pipelines.
- a more complex instruction decoder able to handle instruction
self-modification.

You know what ? I think it will always be a nightmare to have a great
CPU
without any sacrifices :((( (I mean whatever the side is)

>>>> The choice come from what to put in the front of the register port.
RISC put the instruction buffer directly. If we had any kind of
redirection (SRB, not direct mload/store, maskL&s,...), we need to add
one more mux. So we add "something" between port and instruction buffer,
which slow down clock. Adding one more thing to this thing doesn't
double time but add a little bit, it's a kind of "log" complexity.

>>>It's say : raw speed is much more important = direct access, clever
things are better = put the maximum things on it (clever but slower and
bigger).

>>> It make me a pain in the ass to say that... i finaly agree with
whygee : KISS ! (keep it simple and stupid)


__________________________________________________
Modem offert : 150,92 euros remboursés sur le Pack eXtense de Wanadoo ! 
Haut débit à partir de 30 euros/mois : http://www.ifrance.com/_reloc/w

*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/