public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@cygnus.com>
To: "Jerry Quinn" <jquinn@nortelnetworks.com>
Cc: binutils@sourceware.cygnus.com
Subject: Re: Patch: add prefix to condition args in opcodes
Date: Wed, 28 Jul 1999 03:19:00 -0000	[thread overview]
Message-ID: <16893.933157125@upchuck.cygnus.com> (raw)
In-Reply-To: <199907092055.NAA11875@cygnus.com>

  In message <199907092055.NAA11875@cygnus.com>you write:
  > OK, here's a patch to prefix all the condition arg characters with '?'.  It
  > may look a bit large, but all I've done is regroup all the cases for
  > conditions inside the '?' case and do a bit of renaming.  It passes the
  > test suite and appears to work fine.
  > 
  > Because all the conditions are in a prefix, I just added extra codes to
  > deal with various 64 bit conditions.  You'll see that there are some stubs
  > for different new conditions that aren't filled in yet.
This should have been a completely separate patch.  There is *no* reason
to include this stuff as part of the basic reorganization.  And by doing so
all you end up doing is making more work for me as I try to sort out if any
of the PA2.0 stuff is actually correct.

*PLEASE* submit independent changes as independent patches.  Anything else
just makes more work for me because large patches are simply harder to
properly review and problems in one area can easily cause the whole patch
to be held up.  It is better for everyone if you submit independent changes
as separate patches.


  > Let me know what you think.  If this is OK, I suggest we prefix the float
  > args next.
I'm happy with the general concept, but the code itself needs some work.

First, you reversed the patch.  ie, you did diff new old.  Not a major problem,
but it did take a few seconds to realize what had happened (I kept looking for
something nested inside the '?' case in the "new" code and couldn't find it).


Anyway the code itself.

                    /* Handle an add condition.  */
                  case 'A':     /* 64 bit add */
                    if (*s == ',' && *(s + 1) == '*')
                      {
                        cond_64 = 1;
                        s += 2; /* Eat up the ,* */
                      }
                    else break;

First, we do not generally put comments after code; comments belong on separate
lines before the code to which they apply.

Second, we do not write "else break;".  We write

   else
     break;

You made that goof in a variety of places.

Similarly in other places you do stuff like the following:

    if (!cond_64) s++;

We generally try to avoid that kind of style.

  
I'm not particular happy with the way 'A' falls into 'a'.  It may be cleaner
to do

	case 'A':
	case 'a':
	  if (*args == 'A')
	    {
	       Do the few "A" specific things
	    }
	  Do generic code for 'A' and 'a'.

The flow control (at least to me) is easier to follow with that kind of style
(it's still not ideal, but I'm not sure what else we can do to clean this up
without starting over with a complete redesign).

This happens in other places too.

These lines in the 'a' handling are indented improperly:

                  opcode |= cmpltr << 13;
                  INSERT_FIELD_AND_CONTINUE (opcode, flag, 12);

They need to be moved two columns to the right.  Similar problems occur with
the '@' handling.

In the 'b' case the INSERT_FIELD_AND_CONTINUE needs to be moved to the left
two columns.

Do not write "abort()", instead write "abort ()".  Seems like a nit, but
we need to try and be consistent with the coding standards.

You have some comments that wrap when viewed on an 80 column screen.  They need
to be cleaned up.

This code in 'b' does not work if we had previously come in from the 'B' case
and had found a 64bit completer completer.  *s will have already been
advanced past the ,*:


                    cmpltr = 0;
                    if (*s == ',')
                      {
                        s++;



I believe you made a similar mistake in the 'X' case where it falls into
'x'.

I'm not sure the disassembler changes are right, particularly in how they
handle the 64bit stuff.  But then again,  I would claim we shouldn't be
trying to add the 64bit stuff as part of this patch anyway.

Please break out the basic reorganization from the 64bit stuff.  Let's get
the reorgs done and installed, then we can add the 64bit stuff separately.


jeff



       reply	other threads:[~1999-07-28  3:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199907092055.NAA11875@cygnus.com>
1999-07-28  3:19 ` Jeffrey A Law [this message]
1999-07-28  7:11   ` Jerry Quinn
1999-08-05 14:41     ` Jeffrey A Law
1999-08-05 14:41       ` Jeffrey A Law
1999-07-28 10:12   ` Jerry Quinn
1999-08-05 16:02     ` Jeffrey A Law
1999-08-05 16:02       ` Jeffrey A Law
     [not found] <65154398@toto.iv>
1999-07-12 13:17 ` Jerry Quinn
1999-07-09 13:53 Jerry Quinn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16893.933157125@upchuck.cygnus.com \
    --to=law@cygnus.com \
    --cc=binutils@sourceware.cygnus.com \
    --cc=jquinn@nortelnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).