[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [f-cpu] Problem with load/store size flags on >64bit F-CPU
On Sat, Jan 11, 2003 at 06:16:47AM +0100, Yann Guidon wrote:
[...]
> I prefer to not think that 64K bit registers will never happen.
Neither do I - but 2**65535 bit registers are rather unlikely, don't
you think? I do expect the register sizes to be powers of two, however.
Therefore, logarithmic encoding is my choice.
> things happen at a time or another so the user-visible interface
> of the SR_SIZE register has to be kept as simple and limitless as possible.
A single register *is* simple. Four registers aren't. Consider a function
that has special requirements and must save/restore the size bits and
change them on the fly. You'll keep the settings in a (global) register
that can be pushed on the stack easily, and just do something like
// prologue
...
// save settings
storei.64 $-8, r62, global_register
// load desired sizes, e.g.
loadcons.1 $LOG2_DESIRED_SIZE, global_register
// update SR
puti $SR_SIZE, global_register
...
// function code goes here
...
// epilogue
...
// restore settings
loadi.64 $8, r62, global_register
// restore SR
puti $SR_SIZE, global_register
...
jmp r63
when the SR needs to be modified, instead of the slower get/modify/put
sequence for up to 4 registers (not to mention save/restore) - remember
that SR access is a potentially slow operation. This may become a standard
idiom on operating systems where 64 bits is the default.
BTW: We might specify in the calling conventions that SR_SIZE must have
its default value on entry/exit to/from (inter-module) functions, and
that only the least significant 64 bits of the argument registers are
valid. We also should reserve a global register that shadows SR_SIZE,
as described above.
I also like the idea to have different SR_SIZE settings for arithmetic
operations and for load/store. The sizes for arithmetic ops could remain
fixed at first, and only load/store chunk sizes would be variable. That
would reflect the decision that arithmetic ops are limited to 64 bits
(for now).
--
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/