|
From: | Paolo Bonzini |
Subject: | Re: [Lightning] setarg |
Date: | Sat, 10 Feb 2007 17:42:08 +0100 |
User-agent: | Thunderbird 1.5.0.9 (Macintosh/20061207) |
core-common.h: [...] #ifndef JIT_FP #define jit_setarg_i(ofs, reg) jit_movr_i((ofs), (reg)) #else #define jit_setarg_i(ofs, reg) jit_stxi_i((ofs), JIT_FP, (reg)); #endif [...] of course, it would still be a bit of work, if you would also like to support jit_setarg_c and all the variants. and don't forget the floating point stuff! but i should still be possible to implement in few hours (including tests). i'd be glad to learn, why such a thing has never been implemented before. what's the reason? what would we lose by doing so?
Sorry for the late answer. The main reason why it's not implemented is that:1) in lightning arguments are caller-save (even if in some platform they might not be), which limits a lot the usefulness of setarg, including your proposed usage;
2) in lightning arguments are not usable as general registers (even if on some platforms they might actually be), which also suggests that you load the argument in a register if you want portable and efficient code.
The two limitations are related, in that usually arguments are caller-save on platforms where they are general-purpose registers, and dually they are not general-purpose registers where they are callee-save.
Thanks anyway for your interest in lightning. Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |