This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Instruction bundling on IA64 and the Intel Assembler


    Could you be more specific.  I tried to describe the code in details.
    I see the following comment for the function.

For one thing, the only description of the algorithm is "based on dynamic
programming".  In what *way* is it based on it?  Somewhere in the
function (but probably not in the front, since that describes the
*external* view of the function, it would be good to give some overview
of the algorithm.

    /* First (forward) pass -- generates states. */
    /* Finding state with a minimal cost:  */
    /* Second (backward) pass: adding nops and templates:  */
    /* Insert additional cycles for MM-insns: */

These are more "tags" than comments.  Each comment should be at least a
full sentence and perhaps even a paragraph.

Let's just look at the first comment ("First (forward) pass --
generates states."  This has a whole bunch of sequential code, then one
short loop followed by a long loop which has at least two inner loops.
There are no comments saying what any of those are doing.  It's worse
later on.

There are also variables like "pos", where there is no idea what that is.
Also, you set INSN_MODE to TImode with no indication whatsoever of what
that flag is supposed to mean.

    IMHO this code is far from the worst one with the point view of comments.

True, and I complain about all of the others as well!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]