Re: [quirks-uvm-devel] call convention
Status: Pre-Alpha
Brought to you by:
teodor
From: Sergei L. <sl...@is...> - 2002-04-09 11:23:44
|
I think the problem with nested fp approach not only in a big number of elements in a cell access "order". Really we can make a cell with unlimited depth. But ... fp[0:1:2:3:4:5:6:7:8:9] The problem is not the order length. The problem is a level of indirections. If the structure we address with such order is wholly placed in a single frame it is OK becouse realy all this access path (0:1:2:3:4:5:6:7:8:9) will be translated in ONE offset. But if each next level will lift us one frame up it will be translated to 10 pointer dereferences for reach the place where the element is stored. It is not a cell restriction topic, it is a performance topic. So, I think "row fp" is better. Each next procedure gets as many fps and lvs as the level of its nesting is. The passing of whole fp (or lv) as a single element don't lead to increasing the number of dereferences and we have only one dereference not regarding how deep we are from the original frame. By the way, do you known what is the model which GNAT uses? About your second question. If you don't need pass parameters to a procedure you can use this form of call instruction: call :proc instead of this: call <reg>, :proc. By the way, there is a form call fp, :proc which you can use. (It is about your 9th weekend question. I've said false, sorry. fp is OK. See quirks-uvm/benchmarks/Bubbles.ua). P.S. Thanks for excelent illustration of your idea. Max wrote: > I need make decission about call convention and passing lexical context. > Can we discuss it? > At a glance there is two aproaches. I called them "nested fp" and "in > row fp". > Can you look at this? > How do you think which is preferable? > Nested fp requires less mapping instructions and deeper structures. > For example to access vaiarble in outermost procedure from subroutine of > fourth nested level you write fp [x:x:x:x]. > Is there restriction on deep of a structure? > I know there is restriction on deep of cell - no more then 4 levels, > right? > Can I map dx, fp[x:x:x:0] and have access to 5-8 levels of structure > through dx? > > "In row method" need more mapping in procedure call, but short cell to > access > variables in parrent functions. > > Second question is if procedure hasn't any parameter shall I pass > "empty no access cell" > in place where usually parameters passed or just skip? > -- Sergei |