• Re: Compiler use of instructions

    From MitchAlsup1@21:1/5 to John Levine on Sun May 12 22:04:50 2024
    John Levine wrote:

    According to Anton Ertl <anton@mips.complang.tuwien.ac.at>:
    Of course, if the performance cost of these features is so high that >>compiler writers prefer to avoid the full-featured call instruction,
    the instruction misses the target, too.

    The Vax suffered badly from the second system syndrome,

    Which is strange because it was not a second system {PDP-1...PDP-11}

    in which its designers loaded it up with all the stuff that wouldn't fit on a
    PDP-11. Its design also seems to assume a world where main memory is expensive and microcode ROM is much faster,

    The handwriting should have been on the wall by the time of VAX design, especially since VAX had caches and TLBs.

    hence the dense byte coded instructions that demand to be decoded one operand at a time and the
    tiny 512 byte pages.

    I also don't think they thought through the costs of implementing
    their design. The Vax chapter in the Computer Engineering book says
    that they wanted to have a single system wide procedure call, which is
    fine, but it should have been evident even at the time that all of the
    memory traffic for saving and restoring registers, including ones the
    routine doesn't need, would be really slow.

    My 66000 separates calling from preservation. Only the caller knows what
    it wants saved and whom to call, only the callee knows what it will damage
    or return.

    Caller has 3 instructions {CALL, CALLX, CALLA} witch transfer control
    and provide a return address.

    Callee can choose to save nothing if it can do its job entirely within
    R0..R15, or it can save as many or as few registers {R16..R31} as it
    desires. These choices are expressed through instructions {ENTER, EXIT,
    RET}.

    I think VAX blew this one rather badly. We tried something similar on
    GOULD S.E.L 32/87 and got rid of it before anyone outside the company
    saw any of it.

    It's perfectly possible to have a standard calling sequence without
    baking it all into microcode. All of the languages on S/360 use the
    same calling sequence, but it's made from several instructions, and
    you can leave out the ones you don't need, e.g., providing a new save
    area in leaf routines, or stack management in non-recursive routines.

    Yes, YES -- always be in a position where you can LEAVE OUT work that
    is not needed in the call/return interface(s).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)