Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Simon Marchi <simon.marchi@ericsson.com>
Cc: Yao Qi <qiyaoltc@gmail.com>,  <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/3] arm-tdep.c: Refactor arm_process_displaced_insn
Date: Fri, 12 Feb 2016 16:56:00 -0000	[thread overview]
Message-ID: <861t8hoojg.fsf@gmail.com> (raw)
In-Reply-To: <56BCBDE9.1010106@ericsson.com> (Simon Marchi's message of "Thu,	11 Feb 2016 11:59:21 -0500")

Simon Marchi <simon.marchi@ericsson.com> writes:

> Well, my goal was to use variables with names that refer to these tables:
>
> http://nova.polymtl.ca/~simark/ss/fileJVxJNx.png
> (ARM Architecture Reference Manual, section A5.1)

Yes, I clearly understand your goal, but I don't think the change is
necessary.  However, I can't see anything harmful or negative in this
patch, and looks the patch is useful in terms of helping you reference
the doc easily, I am OK.

>
> If you only use the bits (insn, 28, 31) notation, I think you lose readability,
> because the you have to do one more indirection in the doc, to go see what those
> bits mean.

but if you write code like "if (bits (insn, 28, 31) != INST_NV)", people
do understand what those bits mean.

>>> +  op1 = bits (insn, 25, 27);
>>> +  op = bit (insn, 4);
>>> +
>>> +  if (cond != 0xf)
>> 
>> if (bits (insn, 28, 31) != INST_NV)
>> 
>> this is consistent with other places in arm-tdep.c
>
> I agree, if there is a define for that it should be used.  What does _NV stand
> for though?

NV means Never.

>> 
>> 'op' is only used here, let us define it in this block, or use
>> 'bit (insn, 4)' instead.
>
> Ok for moving it, but I would suggest keeping the variable op, for
> the same reason as cond mentioned above.

OK, that is fine, since this is the personal flavour of writing code.

-- 
Yao (齐尧)


  reply	other threads:[~2016-02-12 16:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-10 16:17 [PATCH 0/3] Minor refactorings in arm-tdep.c instruction decoding Simon Marchi
2016-02-10 16:17 ` [PATCH 1/3] arm-tdep.c: Refactor arm_process_displaced_insn Simon Marchi
2016-02-11 11:22   ` Yao Qi
2016-02-11 16:59     ` Simon Marchi
2016-02-12 16:56       ` Yao Qi [this message]
2016-02-10 16:17 ` [PATCH 2/3] arm-tdep.c: Refactor arm_decode_dp_misc Simon Marchi
2016-02-11 11:52   ` Yao Qi
2016-02-11 17:10     ` Yao Qi
2016-02-11 17:18     ` Simon Marchi
2016-02-10 16:17 ` [PATCH 3/3] arm-tdep.c: Refactor arm_decode_media Simon Marchi
2016-02-11 11:58   ` Yao Qi
2016-02-11 11:17 ` [PATCH 0/3] Minor refactorings in arm-tdep.c instruction decoding Yao Qi
2016-02-16 15:26   ` Simon Marchi

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=861t8hoojg.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.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