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


    I don't like when the sentence used without context.  I meant the
    article here not the comments.  

I'm sorry.  It sounded like you were saying "to describe this would be
like writing an article and I don't have time to do that".

    By the way when I wrote the patch, in my opinion I wrote the comments
    enough to understand the code and e.g.  Richard Henderson understood
    the code. 

The issue isn't "is it possible to understand this code without comments".
Given enough work, it's possible to understand *machine code* without
comments. 

The purpose of comments is to make it *easier* to understand the code
so that needed changes can be made.  The present situation is a good
example of that.  To add code to mark the end of a bundle is something
that should be relatively easy.  It shouldn't be necessary to understand
every detail of the code in order to do that.  Instead, the comments
are supposed to explain the overview of each piece of code so somebody doesn't
have to spend the time to understand every piece of code in detail to
make a change like that.

    You can not understand the code without some work on the code.  

I don't follow.

    There should be a balance with comment size and the code.  

Sure.  If you have straightforward sequential code you can often get
away with few or no comments.  But a comment for every loop and for
every non-trivial "if" statement is an absolute minimum.

A good guide (which few of us can meet, admittedly) is that you should
be able to understand the most important part of the function just from
the comments and with all the code deleted.

    Sometimes a lot of comments is even worse.

Sure, but the code in question is *nowhere* near that level.


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